mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-11 16:35:47 +01:00
fixes #4696
This commit is contained in:
@@ -102,9 +102,11 @@ define('notifications', ['sounds', 'translator', 'components'], function(sound,
|
|||||||
ajaxify.refresh();
|
ajaxify.refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!unreadNotifs[notifData.nid]) {
|
socket.emit('notifications.getCount', function(err, count) {
|
||||||
incrementNotifCount(1);
|
Notifications.updateNotifCount(count);
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!unreadNotifs[notifData.nid]) {
|
||||||
sound.play('notification');
|
sound.play('notification');
|
||||||
unreadNotifs[notifData.nid] = true;
|
unreadNotifs[notifData.nid] = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -167,6 +167,12 @@ SocketHelpers.sendNotificationToTopicOwner = function(tid, fromuid, command, not
|
|||||||
SocketHelpers.rescindUpvoteNotification = function(pid, fromuid) {
|
SocketHelpers.rescindUpvoteNotification = function(pid, fromuid) {
|
||||||
var nid = 'upvote:post:' + pid + ':uid:' + fromuid;
|
var nid = 'upvote:post:' + pid + ':uid:' + fromuid;
|
||||||
notifications.rescind(nid);
|
notifications.rescind(nid);
|
||||||
|
|
||||||
|
posts.getPostField(pid, 'uid', function(err, uid) {
|
||||||
|
user.notifications.getUnreadCount(uid, function(err, count) {
|
||||||
|
websockets.in('uid_' + uid).emit('event:notifications.updateCount', count);
|
||||||
|
});
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
SocketHelpers.emitToTopicAndCategory = function(event, data) {
|
SocketHelpers.emitToTopicAndCategory = function(event, data) {
|
||||||
|
|||||||
Reference in New Issue
Block a user