@ -37,9 +37,9 @@ MessageObject:
roomId:
type: number
deleted:
type: boolean
system:
edited:
timestampISO:
@ -59,9 +59,9 @@ get:
type: string
@ -67,6 +67,7 @@ module.exports = function (Messaging) {
Messaging.addMessageToRoom(roomId, mid, timestamp),
Messaging.markRead(uid, roomId),
db.sortedSetAdd('messages:mid', timestamp, mid),
db.incrObjectField('global', 'messageCount'),
];
if (roomData.public) {
tasks.push(
@ -4,7 +4,6 @@
const db = require('../../database');
const batch = require('../../batch');
module.exports = {
name: 'Set mid on message objects and create messages:mid',
timestamp: Date.UTC(2023, 6, 27),
@ -41,5 +40,7 @@ module.exports = {
}, {
batch: 500,
});
const count = await db.sortedSetCard(`messages:mid`);
await db.setObjectField('global', 'messageCount', count);
},
};