Skipping digest sending if no notifs and no new topics, #2455

This commit is contained in:
Julian Lam
2014-11-24 13:21:51 -05:00
parent 1b526026a0
commit a31525c79f

View File

@@ -84,6 +84,11 @@ module.exports = (function(Digest) {
notifications = notifications.filter(Boolean);
// If there are no notifications and no new topics, don't bother sending a digest
if (!notifications.length && !data.topics.topics.length) {
return next();
}
for(var i=0; i<notifications.length; ++i) {
if (notifications[i].image.indexOf('http') !== 0) {
notifications[i].image = nconf.get('url') + notifications[i].image;