diff options
author | tomsmeding <tom.smeding@gmail.com> | 2017-05-24 09:43:03 +0200 |
---|---|---|
committer | tomsmeding <tom.smeding@gmail.com> | 2017-05-24 09:43:03 +0200 |
commit | 0cfd3e87bba5faee5994dc915ab6485f0cf6832c (patch) | |
tree | d65e50e1591c0f81727d38601c911b9f168fd304 /user_data.c | |
parent | ce2945afa3c4a477eef7fd0db3d58b6395c18774 (diff) |
server: Only send push notifs to offline users
Diffstat (limited to 'user_data.c')
-rw-r--r-- | user_data.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/user_data.c b/user_data.c index 5e7c028..e7d2e2a 100644 --- a/user_data.c +++ b/user_data.c @@ -90,10 +90,10 @@ void userdata_unregister(i64 userid,int fd){ const int* userdata_online(i64 userid,i64 *nfds){ struct hash_item *item=find_userdata(userid); if(!item){ - *nfds=0; + if(nfds)*nfds=0; return NULL; } assert(item->data.fds_len!=0); - *nfds=item->data.fds_len; + if(nfds)*nfds=item->data.fds_len; return item->data.fds; } |