mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
fix: #9560, don't save post diffs if content didn't change
This commit is contained in:
@@ -53,8 +53,8 @@ module.exports = function (Posts) {
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
await Posts.setPostFields(data.pid, result.post);
|
await Posts.setPostFields(data.pid, result.post);
|
||||||
|
const contentChanged = data.content !== oldContent;
|
||||||
if (meta.config.enablePostHistory === 1) {
|
if (meta.config.enablePostHistory === 1 && contentChanged) {
|
||||||
await Posts.diffs.save({
|
await Posts.diffs.save({
|
||||||
pid: data.pid,
|
pid: data.pid,
|
||||||
uid: data.uid,
|
uid: data.uid,
|
||||||
@@ -72,7 +72,7 @@ module.exports = function (Posts) {
|
|||||||
returnPostData.cid = topic.cid;
|
returnPostData.cid = topic.cid;
|
||||||
returnPostData.topic = topic;
|
returnPostData.topic = topic;
|
||||||
returnPostData.editedISO = utils.toISOString(editPostData.edited);
|
returnPostData.editedISO = utils.toISOString(editPostData.edited);
|
||||||
returnPostData.changed = oldContent !== data.content;
|
returnPostData.changed = contentChanged;
|
||||||
|
|
||||||
await topics.notifyFollowers(returnPostData, data.uid, {
|
await topics.notifyFollowers(returnPostData, data.uid, {
|
||||||
type: 'post-edit',
|
type: 'post-edit',
|
||||||
|
|||||||
Reference in New Issue
Block a user