mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-09 15:35:47 +01:00
closes #1369
This commit is contained in:
@@ -240,4 +240,19 @@ var winston = require('winston'),
|
||||
], callback);
|
||||
};
|
||||
|
||||
ThreadTools.follow = function(tid, uid, callback) {
|
||||
callback = callback || function() {};
|
||||
async.waterfall([
|
||||
function (next) {
|
||||
ThreadTools.exists(tid, next);
|
||||
},
|
||||
function (exists, next) {
|
||||
if (!exists) {
|
||||
return next(new Error('[[error:no-topic]]'));
|
||||
}
|
||||
db.setAdd('tid:' + tid + ':followers', uid, next);
|
||||
}
|
||||
], callback);
|
||||
};
|
||||
|
||||
}(exports));
|
||||
|
||||
Reference in New Issue
Block a user