mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-29 18:16:17 +01:00
checks
This commit is contained in:
@@ -89,7 +89,9 @@ SocketTopics.markAsRead = function(socket, tids, callback) {
|
|||||||
if (!tids.length) {
|
if (!tids.length) {
|
||||||
return callback();
|
return callback();
|
||||||
}
|
}
|
||||||
|
tids = tids.filter(function(tid) {
|
||||||
|
return tid && utils.isNumber(tid);
|
||||||
|
});
|
||||||
topics.markAsRead(tids, socket.uid, function(err) {
|
topics.markAsRead(tids, socket.uid, function(err) {
|
||||||
if (err) {
|
if (err) {
|
||||||
return callback(err);
|
return callback(err);
|
||||||
|
|||||||
@@ -206,6 +206,9 @@ module.exports = function(Topics) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
Topics.markTopicNotificationsRead = function(tid, uid) {
|
Topics.markTopicNotificationsRead = function(tid, uid) {
|
||||||
|
if (!tid) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
user.notifications.getUnreadByField(uid, 'tid', tid, function(err, nids) {
|
user.notifications.getUnreadByField(uid, 'tid', tid, function(err, nids) {
|
||||||
if (err) {
|
if (err) {
|
||||||
return winston.error(err.stack);
|
return winston.error(err.stack);
|
||||||
|
|||||||
Reference in New Issue
Block a user