feat: add action:messaging.save

v1.18.x
Barış Soner Uşaklı 5 years ago
parent 0283ffd04d
commit ac5c560c54

@ -34,7 +34,7 @@ module.exports = function (Messaging) {
Messaging.addMessage = async (data) => {
const mid = await db.incrObjectField('global', 'nextMid');
const timestamp = data.timestamp || new Date().getTime();
const timestamp = data.timestamp || Date.now();
let message = {
content: String(data.content),
timestamp: timestamp,
@ -72,6 +72,7 @@ module.exports = function (Messaging) {
messages[0].newSet = isNewSet;
messages[0].mid = mid;
messages[0].roomId = data.roomId;
plugins.fireHook('action:messaging.save', { message: messages[0], data: data });
return messages[0];
};

Loading…
Cancel
Save