feat: notify users on new message from remote users, fix use of parseInt in generating chat notification

re: #12834
This commit is contained in:
Julian Lam
2024-10-09 13:46:51 -04:00
parent e9a27db29d
commit 2464d13cde
2 changed files with 3 additions and 4 deletions

View File

@@ -259,7 +259,7 @@ Notes.assertPrivate = async (object) => {
}
// Add message to room
await messaging.sendMessage({
const message = await messaging.sendMessage({
mid: object.id,
uid: object.attributedTo,
roomId: roomId,
@@ -268,6 +268,7 @@ Notes.assertPrivate = async (object) => {
timestamp: Date.now(),
// ip: caller.ip,
});
messaging.notifyUsersInRoom(object.attributedTo, roomId, message);
// Set real timestamp back so that the message shows even though it predates room joining
await messaging.setMessageField(object.id, 'timestamp', timestamp);