diff options
Diffstat (limited to 'lib/okpush/db.js')
| -rw-r--r-- | lib/okpush/db.js | 5 |
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() } |
