core: fix message send when no rcpts

This commit is contained in:
undefined committed 2025-06-11 11:42:22 +08:00
1 parent a973ca2a30
commit b14200e44c
1 file changed
+1
+1
View File
@@ -26,6 +26,7 @@ class MessageModel {
const base = {
_id, from, content, flag,
};
if (!to.length) return base;
await MessageModel.coll.insertMany(to.map((t) => ({ ...base, to: t })));
bus.broadcast('user/message', to, base);
if (flag & MessageModel.FLAG_UNREAD) await user.inc(to, 'unreadMsg', 1);