feat: closes #8308, edit post notif for watched topic posts

This commit is contained in:
Barış Soner Uşaklı
2020-05-10 22:21:32 -04:00
parent 6d57d8446a
commit a73c755b05
6 changed files with 27 additions and 17 deletions

View File

@@ -52,6 +52,13 @@ module.exports = function (Posts) {
postData.cid = topic.cid;
postData.topic = topic;
await topics.notifyFollowers(postData, data.uid, {
type: 'post-edit',
bodyShort: translator.compile('notifications:user_edited_post', editor.username, postData.topic.title),
nid: 'edit_post:' + postData.pid + ':uid:' + data.uid,
});
plugins.fireHook('action:post.edit', { post: _.clone(postData), data: data, uid: data.uid });
require('./cache').del(String(postData.pid));
@@ -79,6 +86,7 @@ module.exports = function (Posts) {
return {
tid: tid,
cid: topicData.cid,
title: validator.escape(String(topicData.title)),
isMainPost: false,
renamed: false,
};