[REF] mail: move discuss.channel/transient_message to discuss folder

Part of task-3265211

Part-of: odoo/odoo#128593
This commit is contained in:
Sébastien Theys
2023-07-17 18:13:39 +02:00
parent 95592d7fa5
commit 91c331c185
2 changed files with 9 additions and 10 deletions
@@ -166,16 +166,6 @@ export class Messaging {
case "mail.record/insert":
this._handleNotificationRecordInsert(notif);
break;
case "discuss.channel/transient_message": {
const channel =
this.store.threads[createLocalId("discuss.channel", notif.payload.res_id)];
const message = this.messageService.createTransient(
Object.assign(notif.payload, { body: markup(notif.payload.body) })
);
channel.messages.push(message);
channel.transientMessages.push(message);
break;
}
case "mail.link.preview/delete":
{
const { id, message_id } = notif.payload;
@@ -85,6 +85,15 @@ export class DiscussCoreCommon {
this._handleNotificationNewMessage(notif);
}
});
this.busService.subscribe("discuss.channel/transient_message", (payload) => {
const channel =
this.store.threads[createLocalId("discuss.channel", payload.res_id)];
const message = this.messageService.createTransient(
Object.assign(payload, { body: markup(payload.body) })
);
channel.messages.push(message);
channel.transientMessages.push(message);
});
this.busService.start();
});
}