[REF] mail: move mail.message/toggle_star to new service
Part of task-3265211 Part-of: odoo/odoo#129583
This commit is contained in:
@@ -55,6 +55,13 @@ export class MailCoreCommon {
|
||||
this.env.bus.trigger("mail.message/delete", { message });
|
||||
}
|
||||
});
|
||||
this.busService.subscribe("mail.message/toggle_star", (payload) => {
|
||||
const { message_ids: messageIds, starred } = payload;
|
||||
for (const messageId of messageIds) {
|
||||
const message = this.messageService.insert({ id: messageId });
|
||||
this.messageService.updateStarred(message, starred);
|
||||
}
|
||||
});
|
||||
this.busService.subscribe("mail.record/insert", (payload) => {
|
||||
if (payload.Thread) {
|
||||
this.threadService.insert(payload.Thread);
|
||||
|
||||
@@ -128,14 +128,6 @@ export class Messaging {
|
||||
handleNotification(notifications) {
|
||||
for (const notif of notifications) {
|
||||
switch (notif.type) {
|
||||
case "mail.message/toggle_star": {
|
||||
const { message_ids: messageIds, starred } = notif.payload;
|
||||
for (const messageId of messageIds) {
|
||||
const message = this.messageService.insert({ id: messageId });
|
||||
this.messageService.updateStarred(message, starred);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "mail.message/notification_update":
|
||||
{
|
||||
notif.payload.elements.map((message) => {
|
||||
|
||||
Reference in New Issue
Block a user