From fe7ee50baa8f96836ecefa2088d129b90705125c Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Fri, 22 Dec 2017 07:46:52 +0100 Subject: new mail alert --- bucky/db/index.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'bucky/db/index.js') 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 */ -- cgit v1.2.3-70-g09d2