From e5b02b16ba83b55ef12dff19c18cb03d9e1fad32 Mon Sep 17 00:00:00 2001 From: tomsmeding Date: Tue, 23 May 2017 09:35:01 +0200 Subject: server: WIP firebase: add cmd_delete_firebase_token --- command.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/command.c b/command.c index c5891d5..fcbb64f 100644 --- a/command.c +++ b/command.c @@ -306,6 +306,15 @@ static bool cmd_firebase_token(struct conn_data *data,const char *tag,const char return net_send_ok(data->fd,tag); } +static bool cmd_delete_firebase_token(struct conn_data *data,const char *tag,const char **args){ + if(data->userid==-1){ + net_send_error(data->fd,tag,"Not logged in"); + return false; + } + db_delete_token(data->userid,args[0]); + return net_send_ok(data->fd,tag); +} + struct cmd_info{ const char *cmdname; @@ -327,6 +336,7 @@ static const struct cmd_info commands[]={ {"ping",0,false,cmd_ping}, {"is_online",1,false,cmd_is_online}, {"firebase_token",1,false,cmd_firebase_token}, + {"delete_firebase_token",1,false,cmd_delete_firebase_token}, }; #define NCOMMANDS (sizeof(commands)/sizeof(commands[0])) -- cgit v1.2.3-70-g09d2