diff options
| author | Alexandre Kühn <aku@odoo.com> | 2018-12-05 14:34:56 +0000 |
|---|---|---|
| committer | Alexandre Kühn <aku@odoo.com> | 2018-12-06 14:51:28 +0000 |
| commit | 9117d968e056d7c4e1112079e7e0ea0dd63cf9a5 (patch) | |
| tree | 5576d8d25369d0249f0d22eaeaa7bc26a1ed6d57 /addons/mail/static/src | |
| parent | ae5d22fa0766360a43752d6d25dd0c4260dac34f (diff) | |
[FIX] mail: get members on channel_info
Before this commit, when accessing a channel after a page reload,
the list of members in a channel was not known until the composer
on this channel has the focus, either in the Discuss app or in a
chat window.
This was a good-enough condition when information about members
was limited to mention suggestions, which requires having the
focus on the composer. However, with the 'is typing' features
on channels, it requires being aware of the members of the channel
at the moment of the rendering in discuss or in a chat window.
This commit fixes the issue by providing the list of channel
members when retrieving information about the channel.
Without this fix, the 'is typing' notifications could sometimes
not determine the name(s) and email(s) of user(s) typing something.
Diffstat (limited to 'addons/mail/static/src')
| -rw-r--r-- | addons/mail/static/src/js/models/threads/channel.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/addons/mail/static/src/js/models/threads/channel.js b/addons/mail/static/src/js/models/threads/channel.js index ff90ca8edfb..f6839873ef7 100644 --- a/addons/mail/static/src/js/models/threads/channel.js +++ b/addons/mail/static/src/js/models/threads/channel.js @@ -29,6 +29,10 @@ var Channel = SearchableThread.extend(ThreadTypingMixin, { * @param {boolean} params.data.is_moderator whether the current user is * moderator of this channel. * @param {string} [params.data.last_message_date] date in server-format + * @param {Object[]} [params.data.members=[]] + * @param {integer} [params.data.members[i].id] + * @param {string} [params.data.members[i].name] + * @param {string} [params.data.members[i].email] * @param {integer} [params.data.message_unread_counter] * @param {boolean} [params.data.moderation=false] whether the channel is * moderated or not @@ -61,7 +65,7 @@ var Channel = SearchableThread.extend(ThreadTypingMixin, { this._isModerated = data.moderation; this._isMyselfModerator = data.is_moderator; this._lastMessageDate = undefined; - this._members = []; + this._members = data.members || []; // Deferred that is resolved on fetched members of this channel. this._membersDef = undefined; // number of messages that are 'needaction', which is equivalent to the |
