mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 09:36:08 +08:00
core: fix message send when no rcpts
This commit is contained in:
1 file changed
+1
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user