mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-29 10:06:13 +01:00
fix editing OP was causing title change event to be logged eventhough title didn't change
This commit is contained in:
@@ -12,6 +12,7 @@ var plugins = require('../plugins');
|
||||
var cache = require('./cache');
|
||||
var pubsub = require('../pubsub');
|
||||
var utils = require('../utils');
|
||||
var translator = require('../translator');
|
||||
|
||||
module.exports = function (Posts) {
|
||||
pubsub.on('post:edit', function (pid) {
|
||||
@@ -149,6 +150,7 @@ module.exports = function (Posts) {
|
||||
topicData.tags = data.tags;
|
||||
topicData.oldTitle = results.topic.title;
|
||||
topicData.timestamp = results.topic.timestamp;
|
||||
var renamed = translator.escape(validator.escape(String(title))) !== results.topic.title;
|
||||
plugins.fireHook('action:topic.edit', { topic: topicData, uid: data.uid });
|
||||
next(null, {
|
||||
tid: tid,
|
||||
@@ -158,7 +160,7 @@ module.exports = function (Posts) {
|
||||
oldTitle: results.topic.title,
|
||||
slug: topicData.slug,
|
||||
isMainPost: true,
|
||||
renamed: title !== results.topic.title,
|
||||
renamed: renamed,
|
||||
tags: tags,
|
||||
});
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user