From 3ab02d72d8f0cacc31485787a2918b98b0487795 Mon Sep 17 00:00:00 2001 From: undefined Date: Wed, 19 May 2021 23:17:04 +0800 Subject: [PATCH] core: remove notification --- packages/hydrooj/package.json | 2 +- packages/hydrooj/src/handler/discussion.ts | 8 -------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/packages/hydrooj/package.json b/packages/hydrooj/package.json index 683d456e8..baa5fc974 100644 --- a/packages/hydrooj/package.json +++ b/packages/hydrooj/package.json @@ -1,6 +1,6 @@ { "name": "hydrooj", - "version": "2.26.17", + "version": "2.26.18", "bin": "bin/hydrooj.js", "main": "dist/loader.js", "typings": "dist/loader.d.ts", diff --git a/packages/hydrooj/src/handler/discussion.ts b/packages/hydrooj/src/handler/discussion.ts index 7f537d068..f9c621ff9 100644 --- a/packages/hydrooj/src/handler/discussion.ts +++ b/packages/hydrooj/src/handler/discussion.ts @@ -214,12 +214,6 @@ class DiscussionDetailHandler extends DiscussionHandler { await this.limitRate('add_discussion', 3600, 60); // Notify related users 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(); } @@ -229,8 +223,6 @@ class DiscussionDetailHandler extends DiscussionHandler { this.checkPerm(PERM.PERM_REPLY_DISCUSSION); await this.limitRate('add_discussion', 3600, 60); 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(); }