mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 08:36:12 +01:00
feat: add action:messaging.save
This commit is contained in:
@@ -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];
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user