1
0
mirror of https://github.com/Tha14/toxic.git synced 2024-12-23 15:33:25 +01:00

add statusmsg command to chat windows

This commit is contained in:
Jfreegman 2013-09-02 01:14:51 -04:00
parent 73d6fba055
commit 713f2347bc
2 changed files with 10 additions and 2 deletions

View File

@ -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 <type> <message> : Set your status\n");
wprintw(self->history, " /statusmsg <message> : Set your status message\n");
wprintw(self->history, " /nick <nickname> : Set your nickname\n");
wprintw(self->history, " /me <action> : 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));

View File

@ -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 <number> : 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");