diff options
-rw-r--r-- | command.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -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])) |