[mw-devel] [Git][arthur/mw][master] Add replay command to mwpoll

Justin Mitchell arthur at sucs.org
Thu Oct 8 11:52:27 BST 2015


Justin Mitchell pushed to branch master at Justin Mitchell / mw


Commits:
3fb9c8ef by Justin Mitchell at 2015-10-08T11:52:13Z
Add replay command to mwpoll

- - - - -


1 changed file:

- src/webclient/comms.c


Changes:

=====================================
src/webclient/comms.c
=====================================
--- a/src/webclient/comms.c
+++ b/src/webclient/comms.c
@@ -21,6 +21,7 @@
 #include <special.h>
 #include <perms.h>
 #include <bb.h>
+#include <util.h>
 #include "import.h"
 #include "comms.h"
 #include "mwstring.h"
@@ -453,6 +454,19 @@ static int handle_command(CONNECTION *co)
 		user->idletime = lastcomm;
                 return 1;
         }else
+        if (co->authd && strncasecmp(buff, "replay ", 7)==0) {
+		AUTOFREE_BUFFER style=NULL;
+		AUTOFREE_BUFFER value=NULL;
+		AUTOFREE_BUFFER line = NULL;
+		char *tmpu;
+		style = remove_first_word(buff);
+		value = remove_first_word(style);
+		if ((tmpu = strchr(style, ' '))!=NULL) *tmpu=0;
+		asprintf(&line, "{\"%s\":%ld}", style, atol(value));
+                ipc_send_to_username(NULL, IPC_REPLAY, line);
+		user->idletime = lastcomm;
+                return 1;
+        }else
 	if (co->authd && strcasecmp(buff, "who")==0) {
 		const char *line = fetch_who(0);
 		if (line != NULL) 



View it on GitLab: https://projects.sucs.org/arthur/mw/commit/3fb9c8ef28732dc46d66544119b3e4063c6fb2aa
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sucs.org/pipermail/mw-devel/attachments/20151008/6803def6/attachment.html>


More information about the mw-devel mailing list