mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-02-19 21:17:54 +01:00
Added hooks into topic follow and unfollow
This commit is contained in:
@@ -12,6 +12,7 @@ var notifications = require('../notifications');
|
||||
var privileges = require('../privileges');
|
||||
var meta = require('../meta');
|
||||
var emailer = require('../emailer');
|
||||
var plugins = require('../plugins');
|
||||
|
||||
module.exports = function(Topics) {
|
||||
|
||||
@@ -56,6 +57,7 @@ module.exports = function(Topics) {
|
||||
return next(new Error('[[error:no-topic]]'));
|
||||
}
|
||||
db.setAdd('tid:' + tid + ':followers', uid, next);
|
||||
plugins.fireHook('action:topic.follow', {uid : uid, tid : tid});
|
||||
},
|
||||
function(next) {
|
||||
db.sortedSetAdd('uid:' + uid + ':followed_tids', Date.now(), tid, next);
|
||||
@@ -74,6 +76,7 @@ module.exports = function(Topics) {
|
||||
return next(new Error('[[error:no-topic]]'));
|
||||
}
|
||||
db.setRemove('tid:' + tid + ':followers', uid, next);
|
||||
plugins.fireHook('action:topic.unfollow', {uid : uid, tid : tid});
|
||||
},
|
||||
function(next) {
|
||||
db.sortedSetRemove('uid:' + uid + ':followed_tids', tid, next);
|
||||
|
||||
Reference in New Issue
Block a user