summaryrefslogtreecommitdiff
path: root/lib/okpush/db.js
diff options
context:
space:
mode:
authorstone <jules+okfprojz@okfoc.us>2017-09-25 13:08:10 -0400
committerstone <jules+okfprojz@okfoc.us>2017-09-25 13:08:10 -0400
commit252a7e4cfdf4d7fccc1ce2a50cfa7ab2f33903fc (patch)
tree00f404f7e87b20b6edefce2e52dff55ad8677a7f /lib/okpush/db.js
parent9fef3483d9c3b2e5e3508b8e5bb5ed080e65ca93 (diff)
parentbdba73ab985fdd6112f36dff02cd0eff937759b1 (diff)
Merge branch 'cms' of ghghgh.us:stone-island into cms
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()
}