summaryrefslogtreecommitdiff
path: root/bucky/app/bucky.js
diff options
context:
space:
mode:
Diffstat (limited to 'bucky/app/bucky.js')
-rw-r--r--bucky/app/bucky.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/bucky/app/bucky.js b/bucky/app/bucky.js
index cd70790..47eb7e1 100644
--- a/bucky/app/bucky.js
+++ b/bucky/app/bucky.js
@@ -611,9 +611,15 @@ var bucky = module.exports = {
next()
})
},
+ checkMail: function(req, res, next){
+ db.checkMail(req.user.get('username')).then(function(mail){
+ res.mail = mail ? mail[0] : { count: 0 }
+ next()
+ })
+ },
markMessageUnread: function(req, res, next){
if (res.message.get('unread')) {
- res.message.set('unread', false)
+ res.message.set('unread', 0)
res.message.save().then(() => next())
} else {
next()