mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-29 18:16:17 +01:00
notification changes
-only send a notification when the person you follow creates a topic -you still get a notification per post if you are following a topic -changed notifications.push so that it sends the notifications over a period of time, currently to 50 users per second -optimized topics.notifyFollowers and user.notifications.sendTopicNotification, they no longer query the database for the topic and post data instead they get it as params -you can no longer follow yourself :) -changed mongo sortedSetRemove so that it doesn't use $in if there is only a single value to remove
This commit is contained in:
@@ -61,18 +61,21 @@ module.exports = function(db, module) {
|
||||
};
|
||||
|
||||
module.sortedSetRemove = function(key, value, callback) {
|
||||
function done(err) {
|
||||
callback(err);
|
||||
}
|
||||
callback = callback || helpers.noop;
|
||||
if (!key) {
|
||||
return callback();
|
||||
}
|
||||
if (!Array.isArray(value)) {
|
||||
value = [value];
|
||||
}
|
||||
value = value.map(helpers.valueToString);
|
||||
|
||||
db.collection('objects').remove({_key: key, value: {$in: value}}, function(err) {
|
||||
callback(err);
|
||||
});
|
||||
if (Array.isArray(value)) {
|
||||
value = value.map(helpers.valueToString);
|
||||
db.collection('objects').remove({_key: key, value: {$in: value}}, done);
|
||||
} else {
|
||||
value = helpers.valueToString(value);
|
||||
db.collection('objects').remove({_key: key, value: value}, done);
|
||||
}
|
||||
};
|
||||
|
||||
module.sortedSetsRemove = function(keys, value, callback) {
|
||||
|
||||
Reference in New Issue
Block a user