when new notifications are pushed to uids clear their old notifications.
This commit is contained in:
barisusakli
2014-09-10 20:51:16 -04:00
parent 5204dc1e23
commit 35a903f9c8
4 changed files with 24 additions and 0 deletions

View File

@@ -141,6 +141,10 @@ var async = require('async'),
return callback(err);
}
var oneWeekAgo = Date.now() - 604800000;
db.sortedSetsRemoveRangeByScore(unreadKeys, 0, oneWeekAgo);
db.sortedSetsRemoveRangeByScore(readKeys, 0, oneWeekAgo);
plugins.fireHook('action:notification.pushed', {notification: notification, uids: uids});
for(var i=0; i<uids.length; ++i) {