diff --git a/config/env/torrents.js b/config/env/torrents.js index 246712de..ca4c5998 100644 --- a/config/env/torrents.js +++ b/config/env/torrents.js @@ -346,9 +346,9 @@ module.exports = { torrentThumbsUp: {title: 'TITLE_TORRENT_THUMBS_UP', content: 'CONTENT_TORRENT_THUMBS_UP', enable: true}, torrentReviewed: {title: 'TITLE_TORRENT_REVIEWED', content: 'CONTENT_TORRENT_REVIEWED', enable: true}, torrentVipChanged: {title: 'TITLE_TORRENT_VIP_CHANGED', content: 'CONTENT_TORRENT_VIP_CHANGED', enable: true}, + torrentHnRChanged: {title: 'TITLE_TORRENT_HNR_CHANGED', content: 'CONTENT_TORRENT_HNR_CHANGED', enable: true}, torrentDeleted: {title: 'TITLE_TORRENT_DELETED', content: 'CONTENT_TORRENT_DELETED', enable: true}, - torrentHnRChanged: {title: 'TITLE_TORRENT_HNR_CHANGED', content: 'CONTENT_TORRENT_HNR_CHANGED', enable: true}, torrentSaleChanged: {title: 'TITLE_TORRENT_SALE_CHANGED', content: 'CONTENT_TORRENT_SALE_CHANGED', enable: true} } }, diff --git a/modules/core/client/app/trans-string-en.js b/modules/core/client/app/trans-string-en.js index a89bbedd..4fa72a99 100644 --- a/modules/core/client/app/trans-string-en.js +++ b/modules/core/client/app/trans-string-en.js @@ -1329,7 +1329,10 @@ CONTENT_TORRENT_REVIEWED: '### Congratulate! \n :clap: You uploaded torrent [{{torrent_file_name}}](/torrents/{{torrent_id}}) was reviewed by user [{{by_name}}](/userinfo/{{by_id}}).', TITLE_TORRENT_VIP_CHANGED: 'Torrent VIP status changed', - CONTENT_TORRENT_VIP_CHANGED: '### VIP status changed! \n You uploaded torrent [{{torrent_file_name}}](/torrents/{{torrent_id}}) VIP status was changed by user [{{by_name}}](/userinfo/{{by_id}}), current status is **{{vip_status}}**.' + CONTENT_TORRENT_VIP_CHANGED: '### VIP status changed! \n You uploaded torrent [{{torrent_file_name}}](/torrents/{{torrent_id}}) VIP status was changed by user [{{by_name}}](/userinfo/{{by_id}}), current status is **{{vip_status}}**.', + + TITLE_TORRENT_HNR_CHANGED: 'Torrent H&R status changed', + CONTENT_TORRENT_HNR_CHANGED: '### H&R status changed! \n You uploaded torrent [{{torrent_file_name}}](/torrents/{{torrent_id}}) H&R status was changed by user [{{by_name}}](/userinfo/{{by_id}}), current status is **{{hnr_status}}**.' } }; diff --git a/modules/core/client/app/trans-string-zh.js b/modules/core/client/app/trans-string-zh.js index 2d1e1572..a79ef1e0 100644 --- a/modules/core/client/app/trans-string-zh.js +++ b/modules/core/client/app/trans-string-zh.js @@ -1329,7 +1329,10 @@ CONTENT_TORRENT_REVIEWED: '### 恭喜! \n :clap: 您上传的种子 [{{torrent_file_name}}](/torrents/{{torrent_id}}) 被管理员用户 [{{by_name}}](/userinfo/{{by_id}}) 审核通过.', TITLE_TORRENT_VIP_CHANGED: '种子 VIP 状态改变', - CONTENT_TORRENT_VIP_CHANGED: '### VIP 状态改变! \n 您上传的种子 [{{torrent_file_name}}](/torrents/{{torrent_id}}) VIP 状态已经由管理员用户 [{{by_name}}](/userinfo/{{by_id}}) 修改, 当前状态为: **{{vip_status}}**.' + CONTENT_TORRENT_VIP_CHANGED: '### VIP 状态改变! \n 您上传的种子 [{{torrent_file_name}}](/torrents/{{torrent_id}}) VIP 状态已经由管理员用户 [{{by_name}}](/userinfo/{{by_id}}) 修改, 当前状态为: **{{vip_status}}**.', + + TITLE_TORRENT_HNR_CHANGED: '种子 H&R 状态改变', + CONTENT_TORRENT_HNR_CHANGED: '### H&R 状态改变! \n 您上传的种子 [{{torrent_file_name}}](/torrents/{{torrent_id}}) H&R 状态已经由管理员用户 [{{by_name}}](/userinfo/{{by_id}}) 修改, 当前状态为: **{{hnr_status}}**.' } }; diff --git a/modules/torrents/server/controllers/torrents.server.controller.js b/modules/torrents/server/controllers/torrents.server.controller.js index 121b0117..2c693625 100644 --- a/modules/torrents/server/controllers/torrents.server.controller.js +++ b/modules/torrents/server/controllers/torrents.server.controller.js @@ -797,6 +797,17 @@ exports.toggleHnRStatus = function (req, res) { //remove the complete data and update user`s warning number when the H&R prop to false if (!torrent.torrent_hnr) removeTorrentHnRWarning(torrent._id); + + //add server message + if (serverNoticeConfig.action.torrentHnRChanged.enable) { + serverMessage.addMessage(torrent.user._id, serverNoticeConfig.action.torrentHnRChanged.title, serverNoticeConfig.action.torrentHnRChanged.content, { + torrent_file_name: torrent.torrent_filename, + torrent_id: torrent._id, + by_name: req.user.displayName, + by_id: req.user._id, + hnr_status: torrent.torrent_hnr ? 'ON' : 'OFF' + }); + } } }); };