mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: remove notification
This commit is contained in:
1 parent
c5b2552f59
commit
3ab02d72d8
2 files changed
+1
-9
No files matched your search
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "hydrooj",
|
"name": "hydrooj",
|
||||||
"version": "2.26.17",
|
"version": "2.26.18",
|
||||||
"bin": "bin/hydrooj.js",
|
"bin": "bin/hydrooj.js",
|
||||||
"main": "dist/loader.js",
|
"main": "dist/loader.js",
|
||||||
"typings": "dist/loader.d.ts",
|
"typings": "dist/loader.d.ts",
|
||||||
|
|||||||
@@ -214,12 +214,6 @@ class DiscussionDetailHandler extends DiscussionHandler {
|
|||||||
await this.limitRate('add_discussion', 3600, 60);
|
await this.limitRate('add_discussion', 3600, 60);
|
||||||
// Notify related users
|
// Notify related users
|
||||||
await discussion.addReply(domainId, did, this.user._id, content, this.request.ip);
|
await discussion.addReply(domainId, did, this.user._id, content, this.request.ip);
|
||||||
const replies: DiscussionReplyDoc[] = await discussion.getMultiReply(domainId, did).toArray();
|
|
||||||
const uids = new Set(replies.map((drdoc) => drdoc.owner));
|
|
||||||
uids.delete(this.user._id);
|
|
||||||
const str = JSON.stringify({ message: '{0} replied to discussion {1}/{2}.', params: [this.user._id, domainId, did] });
|
|
||||||
const tasks = Array.from(uids).map((uid) => message.send(1, uid, str));
|
|
||||||
await Promise.all(tasks);
|
|
||||||
this.back();
|
this.back();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -229,8 +223,6 @@ class DiscussionDetailHandler extends DiscussionHandler {
|
|||||||
this.checkPerm(PERM.PERM_REPLY_DISCUSSION);
|
this.checkPerm(PERM.PERM_REPLY_DISCUSSION);
|
||||||
await this.limitRate('add_discussion', 3600, 60);
|
await this.limitRate('add_discussion', 3600, 60);
|
||||||
await discussion.addTailReply(domainId, drid, this.user._id, content, this.request.ip);
|
await discussion.addTailReply(domainId, drid, this.user._id, content, this.request.ip);
|
||||||
const str = JSON.stringify({ message: '{0} replied to discussion reply {1}/{2}.', params: [this.user._id, domainId, drid] });
|
|
||||||
if (!this.user.own(this.drdoc)) await message.send(1, this.drdoc.owner, str);
|
|
||||||
this.back();
|
this.back();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user