aboutsummaryrefslogtreecommitdiff
path: root/command.c
diff options
context:
space:
mode:
Diffstat (limited to 'command.c')
-rw-r--r--command.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/command.c b/command.c
index e5b8ae3..a7d5b02 100644
--- a/command.c
+++ b/command.c
@@ -238,13 +238,13 @@ static struct cmd_retval cmd_send(struct conn_data *data,const char *tag,const c
}
i64 timestamp=make_timestamp();
- db_create_message(roomid,data->userid,make_timestamp(),message);
- bool closed=net_send_ok(data->fd,tag);
+ i64 msgid=db_create_message(roomid,data->userid,make_timestamp(),message);
+ bool closed=net_send_number(data->fd,tag,msgid);
char *pushbuf=NULL;
char *username=db_get_username(data->userid);
- i64 pushbuflen=asprintf(&pushbuf,"_push message %s %s %" PRIi64 " %s\n",
- roomname,username,timestamp,message);
+ i64 pushbuflen=asprintf(&pushbuf,"_push message %s %s %" PRIi64 " %" PRIi64 " %s\n",
+ roomname,username,timestamp,msgid,message);
event_emit_message(timestamp,message,username,roomname);
firebase_send_message(roomname,roomid,username,message);