summaryrefslogtreecommitdiff
path: root/bucky/db/index.js
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2017-12-22 07:46:52 +0100
committerJules Laplace <julescarbon@gmail.com>2017-12-22 07:47:41 +0100
commitfe7ee50baa8f96836ecefa2088d129b90705125c (patch)
treed148e031ac882a1af0ea35629d6cd27c560d50fb /bucky/db/index.js
parentfa4ed0f3b1ce5decfc6ee59d38e63e78a7793de4 (diff)
new mail alert
Diffstat (limited to 'bucky/db/index.js')
-rw-r--r--bucky/db/index.js3
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 */