topics.isFollowing works with multiple tids now

This commit is contained in:
barisusakli
2015-01-12 16:57:18 -05:00
parent f417e07b9d
commit 08c1dad3ee
6 changed files with 20 additions and 12 deletions

View File

@@ -239,11 +239,11 @@ var winston = require('winston'),
if (!exists) {
return next(new Error('[[error:no-topic]]'));
}
topics.isFollowing(tid, uid, next);
topics.isFollowing([tid], uid, next);
},
function (isFollowing, next) {
db[isFollowing ? 'setRemove' : 'setAdd']('tid:' + tid + ':followers', uid, function(err) {
next(err, !isFollowing);
db[isFollowing[0] ? 'setRemove' : 'setAdd']('tid:' + tid + ':followers', uid, function(err) {
next(err, !isFollowing[0]);
});
}
], callback);