From 0cfd3e87bba5faee5994dc915ab6485f0cf6832c Mon Sep 17 00:00:00 2001 From: tomsmeding Date: Wed, 24 May 2017 09:43:03 +0200 Subject: server: Only send push notifs to offline users --- firebase.c | 2 ++ user_data.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/firebase.c b/firebase.c index d11545f..1f4fb26 100644 --- a/firebase.c +++ b/firebase.c @@ -4,6 +4,7 @@ #include #include "db.h" #include "firebase.h" +#include "user_data.h" #define JS_PLUGIN_PATH "firebase-io/firebase-io.js" @@ -126,6 +127,7 @@ void firebase_send_message(const char *room,i64 roomid,const char *user,const ch struct db_user_list members=db_list_members(roomid); for(i64 i=0;idata.fds_len!=0); - *nfds=item->data.fds_len; + if(nfds)*nfds=item->data.fds_len; return item->data.fds; } -- cgit v1.2.3-70-g09d2