pruning empy notifications for daily emailer

This commit is contained in:
Julian Lam
2014-09-02 18:36:28 -04:00
parent 4f48f1865f
commit e6d0eede4f

View File

@@ -69,6 +69,10 @@ module.exports = function(User) {
winston.error('[user/jobs] Could not send daily digests: ' + err.message);
return next(err);
}
// Remove expired notifications
notifications = notifications.filter(Boolean);
// Turn relative URLs into absolute ones
for(var i=0; i<notifications.length; ++i) {
if (notifications[i].image.indexOf('http') !== 0) {