aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortomsmeding <tom.smeding@gmail.com>2017-05-24 11:27:40 +0200
committertomsmeding <tom.smeding@gmail.com>2017-05-24 11:27:52 +0200
commit24e9d1ea30092f2b0ee938b279108e71edcb5239 (patch)
tree681cd07295b498707fe604e3a4d9564628807d68
parent66b3a7833a86ce868a1cad19cd5bbe2a62d10980 (diff)
server: Replace notifs if from same room
-rwxr-xr-xfirebase-io/firebase-io.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/firebase-io/firebase-io.js b/firebase-io/firebase-io.js
index 8a94076..bfcca0f 100755
--- a/firebase-io/firebase-io.js
+++ b/firebase-io/firebase-io.js
@@ -71,11 +71,13 @@ function processMessage(type,fields){
switch(type){
case "message":
const user=fields.get("user");
+ const room=fields.get("room");
const token=fields.get("token");
const payload={
notification: {
- title: user+" ("+fields.get("room")+")",
+ title: user+" ("+room+")",
body: fields.get("message"),
+ tag: room,
}
};
firebase.messaging().sendToDevice(token,payload)