[mw-devel] [Git][arthur/mw][master] Fix timestamps on gag messages

Andrew Price welshbyte at sucs.org
Sun Feb 17 16:57:55 GMT 2019


Andrew Price pushed to branch master at Justin Mitchell / mw


Commits:
8e9579cb by Andrew Price at 2019-02-17T16:55:05Z
Fix timestamps on gag messages

Fixes #33

- - - - -


1 changed file:

- src/server/actions.c


Changes:

=====================================
src/server/actions.c
=====================================
@@ -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);



View it on GitLab: https://projects.sucs.org/arthur/mw/commit/8e9579cb2aab9af50af8d44681c22da84152e148

-- 
View it on GitLab: https://projects.sucs.org/arthur/mw/commit/8e9579cb2aab9af50af8d44681c22da84152e148
You're receiving this email because of your account on projects.sucs.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sucs.org/pipermail/mw-devel/attachments/20190217/af137e91/attachment-0001.html>


More information about the mw-devel mailing list