summaryrefslogtreecommitdiff
path: root/lib/okpush/db.js
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2017-09-25 19:07:54 +0200
committerJules Laplace <julescarbon@gmail.com>2017-09-25 19:07:54 +0200
commitbdba73ab985fdd6112f36dff02cd0eff937759b1 (patch)
treea4af98001c26e53ff932e5650459059fb3b0583c /lib/okpush/db.js
parent709af63b290214b79271d96518e2ed51468e09f3 (diff)
test
Diffstat (limited to 'lib/okpush/db.js')
-rw-r--r--lib/okpush/db.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/okpush/db.js b/lib/okpush/db.js
index 09afdf34..4e000725 100644
--- a/lib/okpush/db.js
+++ b/lib/okpush/db.js
@@ -109,7 +109,7 @@ function getDeviceCount (channels, cb) {
/* notifications */
-function addNotification (channel, cb) {
+function addNotification (channel, message, cb) {
var now = new Date
Channel.findOrCreate({channel: channel}, {last_push: now}, function(err, note, created) {
if (err) {
@@ -123,8 +123,9 @@ function addNotification (channel, cb) {
}
cb(null, note)
})
- new Notification ({
+ return new Notification ({
channel: channel,
+ message: message || "",
date: now,
}).save()
}