Loading src/webclient/comms.c +14 −0 Original line number Diff line number Diff line Loading @@ -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" Loading Loading @@ -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) Loading Loading
src/webclient/comms.c +14 −0 Original line number Diff line number Diff line Loading @@ -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" Loading Loading @@ -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) Loading