diff options
Diffstat (limited to 'addons/mail/static/src/models/thread/thread.js')
| -rw-r--r-- | addons/mail/static/src/models/thread/thread.js | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/addons/mail/static/src/models/thread/thread.js b/addons/mail/static/src/models/thread/thread.js index bb23735c62e..e692f00fe87 100644 --- a/addons/mail/static/src/models/thread/thread.js +++ b/addons/mail/static/src/models/thread/thread.js @@ -1402,6 +1402,20 @@ function factory(dependencies) { } /** + * Compute an url string that can be used inside a href attribute + * + * @private + * @returns {string} + */ + _computeUrl() { + const baseHref = this.env.session.url('/web'); + if (this.model === 'mail.channel') { + return `${baseHref}#action=mail.action_discuss&active_id=${this.model}_${this.id}`; + } + return `${baseHref}#model=${this.model}&id=${this.id}`; + } + + /** * @private * @param {Object} param0 * @param {boolean} param0.isTyping @@ -2086,6 +2100,17 @@ function factory(dependencies) { default: '', dependencies: ['orderedOtherTypingMembers'], }), + /** + * URL to access to the conversation. + */ + url: attr({ + compute: '_computeUrl', + default: '', + dependencies: [ + 'id', + 'model', + ] + }), uuid: attr(), }; |
