From 713f2347bc4a464876aa233c0418d2b3298c1030 Mon Sep 17 00:00:00 2001 From: Jfreegman Date: Mon, 2 Sep 2013 01:14:51 -0400 Subject: [PATCH] add statusmsg command to chat windows --- src/chat.c | 10 +++++++++- src/prompt.c | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/chat.c b/src/chat.c index 75f68a3..db98c58 100644 --- a/src/chat.c +++ b/src/chat.c @@ -353,6 +353,13 @@ void execute(ToxWindow *self, ChatContext *ctx, Tox *m, char *cmd) } } + else if (!strncmp(cmd, "/statusmsg ", strlen("/statusmsg "))) { + char *msg = strchr(cmd, ' '); + msg++; + wprintw(ctx->history, "Status message set to: %s\n", msg); + tox_set_statusmessage(m, ( uint8_t *) msg, strlen(msg) + 1); + } + else if (!strncmp(cmd, "/nick ", strlen("/nick "))) { char *nick; nick = strchr(cmd, ' '); @@ -416,12 +423,13 @@ void print_help(ChatContext *self) wattroff(self->history, A_BOLD); wprintw(self->history, " /status : Set your status\n"); + wprintw(self->history, " /statusmsg : Set your status message\n"); wprintw(self->history, " /nick : Set your nickname\n"); wprintw(self->history, " /me : Do an action\n"); wprintw(self->history, " /myid : Print your ID\n"); wprintw(self->history, " /clear : Clear the screen\n"); wprintw(self->history, " /close : Close the current chat window\n"); - wprintw(self->history, " /quit or /exit : Exit program\n"); + wprintw(self->history, " /quit or /exit : Exit Toxic\n"); wprintw(self->history, " /help : Print this message again\n\n"); wattroff(self->history, COLOR_PAIR(2)); diff --git a/src/prompt.c b/src/prompt.c index 521f624..97dcd9b 100644 --- a/src/prompt.c +++ b/src/prompt.c @@ -228,7 +228,7 @@ void cmd_help(ToxWindow *self, Tox *m, char **args) wprintw(self->window, " mynick : Print your current nickname\n"); wprintw(self->window, " accept : Accept friend request\n"); wprintw(self->window, " myid : Print your ID\n"); - wprintw(self->window, " quit/exit : Exit program\n"); + wprintw(self->window, " quit/exit : Exit Toxic\n"); wprintw(self->window, " help : Print this message again\n"); wprintw(self->window, " clear : Clear this window\n");