mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-08 06:55:46 +01:00
closes #1742
This commit is contained in:
@@ -5,6 +5,7 @@ var async = require('async'),
|
||||
categories = require('../categories'),
|
||||
privileges = require('../privileges'),
|
||||
user = require('../user'),
|
||||
topics = require('../topics'),
|
||||
websockets = require('./index'),
|
||||
|
||||
SocketCategories = {};
|
||||
@@ -83,4 +84,22 @@ SocketCategories.getCategoriesByPrivilege = function(socket, privilege, callback
|
||||
categories.getCategoriesByPrivilege(socket.uid, privilege, callback);
|
||||
};
|
||||
|
||||
SocketCategories.watch = function(socket, cid, callback) {
|
||||
user.watchCategory(socket.uid, cid, function(err) {
|
||||
if (err) {
|
||||
return callback(err);
|
||||
}
|
||||
topics.pushUnreadCount(socket.uid, callback);
|
||||
});
|
||||
};
|
||||
|
||||
SocketCategories.ignore = function(socket, cid, callback) {
|
||||
user.ignoreCategory(socket.uid, cid, function(err) {
|
||||
if (err) {
|
||||
return callback(err);
|
||||
}
|
||||
topics.pushUnreadCount(socket.uid, callback);
|
||||
});
|
||||
};
|
||||
|
||||
module.exports = SocketCategories;
|
||||
|
||||
Reference in New Issue
Block a user