diff options
Diffstat (limited to 'bucky/db/index.js')
| -rw-r--r-- | bucky/db/index.js | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/bucky/db/index.js b/bucky/db/index.js index d3ee2ea..b10e3d8 100644 --- a/bucky/db/index.js +++ b/bucky/db/index.js @@ -252,6 +252,9 @@ db.createMailbox = function(data){ db.bumpMailboxCount = function(mbox){ new db.Mailbox({ mbox: mbox }).fetch() } +db.checkMail = function(username){ + return knex.count('* as count').select().from('messages').where('recipient', '=', username).andWhere('unread', '=', 1) +} /* MESSAGES */ |
