v1.18.x
Baris Usakli 6 years ago
parent e2ecbae06c
commit a228dc2de9

@ -28,7 +28,7 @@ module.exports = function (SocketPosts) {
return next(new Error('[[error:no-privileges]]'));
}
topics.movePostToTopic(pid, data.tid, next);
topics.movePostToTopic(socket.uid, pid, data.tid, next);
},
function (next) {
socketHelpers.sendNotificationToPostOwner(pid, socket.uid, 'move', 'notifications:moved_your_post');

@ -52,8 +52,8 @@ module.exports = function (Topics) {
}
Topics.create({ uid: results.postData.uid, title: title, cid: cid }, next);
},
function (results, next) {
Topics.updateTopicBookmarks(fromTid, pids, function () { next(null, results); });
function (tid, next) {
Topics.updateTopicBookmarks(fromTid, pids, function (err) { next(err, tid); });
},
function (_tid, next) {
tid = _tid;
@ -63,7 +63,7 @@ module.exports = function (Topics) {
return next(err || new Error(canEdit.message));
}
Topics.movePostToTopic(pid, tid, next);
Topics.movePostToTopic(uid, pid, tid, next);
});
}, next);
},
@ -77,7 +77,7 @@ module.exports = function (Topics) {
], callback);
};
Topics.movePostToTopic = function (pid, tid, callback) {
Topics.movePostToTopic = function (callerUid, pid, tid, callback) {
var postData;
async.waterfall([
function (next) {
@ -125,7 +125,7 @@ module.exports = function (Topics) {
});
},
function (next) {
plugins.fireHook('action:post.move', { post: postData, tid: tid });
plugins.fireHook('action:post.move', { uid: callerUid, post: postData, tid: tid });
next();
},
], callback);

@ -17,7 +17,7 @@ module.exports = function (Topics) {
},
function (pids, next) {
async.eachSeries(pids, function (pid, next) {
Topics.movePostToTopic(pid, mergeIntoTid, next);
Topics.movePostToTopic(uid, pid, mergeIntoTid, next);
}, next);
},
function (next) {

@ -508,7 +508,7 @@ describe('Topic\'s', function () {
function (categoryData, next) {
assert.equal(categoryData[0].post_count, 4);
assert.equal(categoryData[1].post_count, 2);
topics.movePostToTopic(movedPost.pid, tid2, next);
topics.movePostToTopic(1, movedPost.pid, tid2, next);
},
function (next) {
checkCidSets(previousPost, topic2LastReply, next);

Loading…
Cancel
Save