-
-
Notifications
You must be signed in to change notification settings - Fork 121
Expand file tree
/
Copy pathmessage_model.esm.js
More file actions
23 lines (22 loc) · 879 Bytes
/
message_model.esm.js
File metadata and controls
23 lines (22 loc) · 879 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import {Message} from "@mail/core/common/message_model";
import {patch} from "@web/core/utils/patch";
patch(Message.prototype, {
async messageReply(message) {
var self = this;
const thread = message.thread;
await this.store.env.services.orm
.call("mail.message", "reply_message", [message.id])
.then(function (result) {
return self.store.env.services.action.doAction(result, {
onClose: async () => {
await self.store.env.services["mail.store"].Thread.getOrFetch(
thread,
["messages"]
);
self.store.env.bus.trigger("update-messages");
await thread?.fetchNewMessages();
},
});
});
},
});