From: Michael Stapelberg Date: Fri, 12 Mar 2010 14:29:44 +0000 (+0100) Subject: ipc: also send a reply for COMMAND messages X-Git-Tag: 3.e~6^2~87 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=d6f726283ca2445a9c24065db2b57767cba37371;p=i3%2Fi3 ipc: also send a reply for COMMAND messages --- diff --git a/include/i3/ipc.h b/include/i3/ipc.h index 131c4b16..19d93298 100644 --- a/include/i3/ipc.h +++ b/include/i3/ipc.h @@ -34,6 +34,9 @@ * */ +/** Command reply type */ +#define I3_IPC_REPLY_TYPE_COMMAND 0 + /** Workspaces reply type */ #define I3_IPC_REPLY_TYPE_WORKSPACES 1 diff --git a/src/ipc.c b/src/ipc.c index 629ec89d..8bae4f07 100644 --- a/src/ipc.c +++ b/src/ipc.c @@ -181,6 +181,12 @@ static void ipc_handle_message(int fd, uint8_t *message, int size, parse_command(global_conn, (const char*)command); free(command); + /* For now, every command gets a positive acknowledge + * (will change with the new command parser) */ + const char *reply = "{\"success\":true}"; + ipc_send_message(fd, (const unsigned char*)reply, + I3_IPC_REPLY_TYPE_COMMAND, strlen(reply)); + break; } case I3_IPC_MESSAGE_TYPE_GET_WORKSPACES: