summaryrefslogtreecommitdiff
path: root/lib/okpush/db.js
diff options
context:
space:
mode:
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()
}