core: await message.send in discussion

This commit is contained in:
undefined committed 2024-09-30 22:27:05 +08:00
1 parent 655ed27994
commit d95eb495ea
1 file changed
+2 -6
+2 -6
View File
@@ -238,9 +238,7 @@ class DiscussionDetailHandler extends DiscussionHandler {
message: 'User {0} mentioned you in {1:link}', message: 'User {0} mentioned you in {1:link}',
params: [this.user.uname, `/d/${domainId}${this.request.path}`], params: [this.user.uname, `/d/${domainId}${this.request.path}`],
}); });
for (const uid of uids) { await Promise.all(uids.map((i) => message.send(1, i, msg, message.FLAG_RICHTEXT | message.FLAG_UNREAD)));
message.send(1, uid, msg, message.FLAG_RICHTEXT | message.FLAG_UNREAD);
}
const drid = await discussion.addReply(domainId, did, this.user._id, content, this.request.ip); const drid = await discussion.addReply(domainId, did, this.user._id, content, this.request.ip);
this.back({ drid }); this.back({ drid });
} }
@@ -257,9 +255,7 @@ class DiscussionDetailHandler extends DiscussionHandler {
message: 'User {0} mentioned you in {1:link}', message: 'User {0} mentioned you in {1:link}',
params: [this.user.uname, `/d/${domainId}${this.request.path}`], params: [this.user.uname, `/d/${domainId}${this.request.path}`],
}); });
for (const uid of uids) { await Promise.all(uids.map((i) => message.send(1, i, msg, message.FLAG_RICHTEXT | message.FLAG_UNREAD)));
message.send(1, uid, msg, message.FLAG_RICHTEXT | message.FLAG_UNREAD);
}
await discussion.addTailReply(domainId, drid, this.user._id, content, this.request.ip); await discussion.addTailReply(domainId, drid, this.user._id, content, this.request.ip);
this.back(); this.back();
} }