Commit 8e9579cb authored by Andrew Price's avatar Andrew Price

Fix timestamps on gag messages

Fixes #33
parent 4dd8cd35
Pipeline #538 passed with stage
in 7 minutes and 55 seconds
......@@ -176,6 +176,7 @@ void accept_action(ipc_connection_t *conn, ipc_message_t *msg)
}
ipc_message_t * event = ipcmsg_create(IPC_EVENT, msg->head.src);
event->head.when = msg->head.when;
ipcmsg_destination(event, -1);
json_t * ej = json_init(NULL);
json_addstring(ej, "target", victim_name);
......@@ -190,12 +191,14 @@ void accept_action(ipc_connection_t *conn, ipc_message_t *msg)
_autofree char *buff=NULL;
asprintf(&buff,"+%d", gtnum);
ipc_message_t *update = ipcmsg_create(IPC_GAG, msg->head.src);
update->head.when = msg->head.when;
ipcmsg_destination(update, toid);
ipcmsg_append(update, buff, strlen(buff));
msg_attach_to_username(update, victim_name);
ipcmsg_destroy(update);
ipc_message_t *gm = ipcmsg_create(IPC_EVENT, msg->head.src);
update->head.when = msg->head.when;
json_t * gj = json_init(NULL);
json_addstring(gj, "target", victim_name);
json_addint(gj, "success", success);
......@@ -218,6 +221,7 @@ void accept_action(ipc_connection_t *conn, ipc_message_t *msg)
if (strcasecmp(command, "ungag")==0) {
ipc_message_t * event = ipcmsg_create(IPC_EVENT, msg->head.src);
event->head.when = msg->head.when;
ipcmsg_destination(event, -1);
json_t * ej = json_init(NULL);
json_addstring(ej, "target", victim_name);
......@@ -235,12 +239,14 @@ void accept_action(ipc_connection_t *conn, ipc_message_t *msg)
_autofree char *buff=NULL;
asprintf(&buff,"-");
ipc_message_t *update = ipcmsg_create(IPC_GAG, msg->head.src);
update->head.when = msg->head.when;
ipcmsg_destination(update, toid);
ipcmsg_append(update, buff, strlen(buff));
msg_attach_to_username(update, victim_name);
ipcmsg_destroy(update);
ipc_message_t *gm = ipcmsg_create(IPC_EVENT, msg->head.src);
update->head.when = msg->head.when;
json_t * gj = json_init(NULL);
json_addstring(gj, "target", victim_name);
json_addint(gj, "success", success);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment