summaryrefslogtreecommitdiff
path: root/addons/mail/static/src/xml/thread.xml
diff options
context:
space:
mode:
authorXavierDo <xdo@odoo.com>2019-01-07 11:19:00 +0000
committerXavierDo <xdo@odoo.com>2019-02-07 08:54:33 +0000
commit07a261db7196d3f7aa7d50d98575c5b6efca9242 (patch)
tree3cc3debc34ecfdf484b174dc8c5850e7e07651f4 /addons/mail/static/src/xml/thread.xml
parent768844040f887868759309ad101fe50191fc949a (diff)
[IMP] bus, mail, mail_bot: add im_status service
This commit is a refactoring of im_status management. This commit also add im_status in two places, near the author in a mail thread and on each suggestion when using mentions. A service to manage im_status will have multiple benefits here: -centralise information, avoid to call the server multiple time for the same im_status -update all im_status at once and keep consistency in display. With this commit, the im_status updates are now done by rpc call. Updates where previously made with the bus but this has some drawback, since the bus will only give the information 50 seconds after the beginning of the request, in the worst case, we van wait 2*50 seconds to get an update. More than that, the im_status where only updates for pinned dm_chat. Dm chat are synchronized cross tabs, making the use of the bus possible for this purpose. Since we will need to display im_status not linked to dm_chat, the list to update will be different from tab to tab making the use of bus difficult for this purpose. Technical notes: -im_search has been moved from bus to mail addons since it concerns mail.channel -Update of an im_status should be reflected everywhere in the page. Since im_status is a rendered template used in multiple widget, we should add the correct logic to all concerened widget. The current solution is simple: use a jquery selector to find every place where im_status is rendered. -we add a new im_status: im_partner. This will indicate that that the partner has no user linked to him, making it possible to avoid to ask for status updates for this partner. -The update will only be done when the tab is focused. (and will be done asap once the tab get focus back)
Diffstat (limited to 'addons/mail/static/src/xml/thread.xml')
-rw-r--r--addons/mail/static/src/xml/thread.xml18
1 files changed, 12 insertions, 6 deletions
diff --git a/addons/mail/static/src/xml/thread.xml b/addons/mail/static/src/xml/thread.xml
index be73917a1b5..f6d6ad599ec 100644
--- a/addons/mail/static/src/xml/thread.xml
+++ b/addons/mail/static/src/xml/thread.xml
@@ -258,12 +258,18 @@
<div t-att-class="'o_thread_message ' + (message.getID() === options.selectedMessageID ? 'o_thread_selected_message ' : ' ') + (message.isDiscussion() or message.isNotification() ? ' o_mail_discussion ' : ' o_mail_not_discussion ')" t-att-data-message-id="message.getID()">
<div t-if="options.displayAvatars" class="o_thread_message_sidebar">
<t t-if="message.hasAuthor()">
- <img t-if="displayAuthorMessages[message.getID()]"
- alt=""
- t-att-src="message.getAvatarSource()"
- data-oe-model="res.partner"
- t-att-data-oe-id="message.shouldRedirectToAuthor() ? message.getAuthorID() : ''"
- t-attf-class="o_thread_message_avatar rounded-circle #{message.shouldRedirectToAuthor() ? 'o_mail_redirect' : ''}"/>
+ <div t-if="displayAuthorMessages[message.getID()]" class="o_thread_message_sidebar_image">
+ <img
+ alt=""
+ t-att-src="message.getAvatarSource()"
+ data-oe-model="res.partner"
+ t-att-data-oe-id="message.shouldRedirectToAuthor() ? message.getAuthorID() : ''"
+ t-attf-class="o_thread_message_avatar rounded-circle #{message.shouldRedirectToAuthor() ? 'o_mail_redirect' : ''}"/>
+ <t t-call="mail.UserStatus">
+ <t t-set="status" t-value="message.getAuthorImStatus()"/>
+ <t t-set="partnerID" t-value="message.getAuthorID()"/>
+ </t>
+ </div>
</t>
<t t-else="">
<img t-if="displayAuthorMessages[message.getID()]"