Skip to content

Node.js based forum software built for the modern web

feat: closes #7070

Barış Soner Uşaklı7ca62b839914
diff --git a/src/topics/merge.js b/src/topics/merge.js
index e97261f8d7..5095606729 100644
--- a/src/topics/merge.js
+++ b/src/topics/merge.js
@@ -1,6 +1,7 @@
'use strict';
-var async = require('async');
+const async = require('async');
+const plugins = require('../plugins');
module.exports = function (Topics) {
Topics.merge = function (tids, uid, callback) {
@@ -34,7 +35,13 @@ module.exports = function (Topics) {
}, next);
},
], next);
- }, callback);
+ }, function (err) {
+ if (err) {
+ return callback(err);
+ }
+ plugins.fireHook('action:topic.merge', { uid: uid, tids: tids, mergeIntoTid: mergeIntoTid, otherTids: otherTids });
+ callback();
+ });
};
function findOldestTopic(tids) {