1
0
mirror of https://github.com/Tha14/toxic.git synced 2025-07-01 16:16:46 +02:00

Change statusmsg to note for less confusion

This commit is contained in:
Jfreegman
2013-09-02 23:27:34 -04:00
parent e37aa54f3b
commit e5b5155c3e
6 changed files with 42 additions and 45 deletions

View File

@ -33,7 +33,7 @@ void cmd_nick(ToxWindow *, Tox *m, int, char **);
void cmd_mynick(ToxWindow *, Tox *m, int, char **);
void cmd_quit(ToxWindow *, Tox *m, int, char **);
void cmd_status(ToxWindow *, Tox *m, int, char **);
void cmd_statusmsg(ToxWindow *, Tox *m, int, char **);
void cmd_note(ToxWindow *, Tox *m, int, char **);
#define NUM_COMMANDS 14
@ -54,7 +54,7 @@ static struct {
{ "q", cmd_quit },
{ "quit", cmd_quit },
{ "status", cmd_status },
{ "statusmsg", cmd_statusmsg },
{ "note", cmd_note },
};
// XXX:
@ -118,7 +118,7 @@ void cmd_add(ToxWindow *self, Tox *m, int argc, char **argv)
/* check arguments */
if (argv[2] && argv[2][0] != '\"') {
wprintw(self->window, "Strings must be enclosed in quotes.\n");
wprintw(self->window, "Messages must be enclosed in quotes.\n");
return;
}
if (argc != 1 && argc != 2) {
@ -241,9 +241,9 @@ void cmd_help(ToxWindow *self, Tox *m, int argc, char **argv)
wattroff(self->window, A_BOLD);
wprintw(self->window, " connect <ip> <port> <key> : Connect to DHT server\n");
wprintw(self->window, " add <id> <message> : Add friend\n");
wprintw(self->window, " status <type> <message> : Set your status\n");
wprintw(self->window, " statusmsg <message> : Set your status message\n");
wprintw(self->window, " add <id> <message> : Add friend with optional message\n");
wprintw(self->window, " status <type> <message> : Set your status with optional note\n");
wprintw(self->window, " note <message> : Set a personal note\n");
wprintw(self->window, " nick <nickname> : Set your nickname\n");
wprintw(self->window, " mynick : Print your current nickname\n");
wprintw(self->window, " accept <number> : Accept friend request\n");
@ -253,8 +253,8 @@ void cmd_help(ToxWindow *self, Tox *m, int argc, char **argv)
wprintw(self->window, " clear : Clear this window\n");
wattron(self->window, A_BOLD);
wprintw(self->window, "NOTE: Strings must be enclosed in quotation marks.\n");
wprintw(self->window, "TIP: Use the TAB key to navigate through the tabs.\n\n");
wprintw(self->window, " * Messages must be enclosed in quotation marks.\n");
wprintw(self->window, " * Use the TAB key to navigate through the tabs.\n\n");
wattroff(self->window, A_BOLD);
wattroff(self->window, COLOR_PAIR(2));
@ -274,7 +274,7 @@ void cmd_msg(ToxWindow *self, Tox *m, int argc, char **argv)
msg = argv[2];
if (tox_sendmessage(m, atoi(id), (uint8_t *) msg, strlen(msg) + 1) == 0)
wprintw(self->window, "Error occurred while sending message.\n");
wprintw(self->window, "Failed to send message.\n");
else
wprintw(self->window, "Message successfully sent.\n");
}
@ -329,7 +329,7 @@ void cmd_status(ToxWindow *self, Tox *m, int argc, char **argv)
/* check arguments */
if (argv[2] && argv[2][0] != '\"') {
wprintw(self->window, "Strings must be enclosed in quotes.\n");
wprintw(self->window, "Messages must be enclosed in quotes.\n");
return;
}
if (argc != 1 && argc != 2) {
@ -355,25 +355,24 @@ void cmd_status(ToxWindow *self, Tox *m, int argc, char **argv)
return;
}
wprintw(self->window, "Status set to: %s\n", status_text);
tox_set_userstatus(m, status_kind);
msg = argv[2];
if (msg == NULL) {
tox_set_userstatus(m, status_kind);
wprintw(self->window, "Status message set to: %s\n", status_text);
} else {
tox_set_userstatus(m, status_kind);
if (msg != NULL) {
tox_set_statusmessage(m, (uint8_t *) msg, strlen(msg) + 1);
wprintw(self->window, "Status message set to: %s, %s\n", status_text, msg);
wprintw(self->window, "Personal note set to: %s\n", msg);
}
}
void cmd_statusmsg(ToxWindow *self, Tox *m, int argc, char **argv)
void cmd_note(ToxWindow *self, Tox *m, int argc, char **argv)
{
char *msg;
/* check arguments */
if (argv[1] && argv[1][0] != '\"') {
wprintw(self->window, "Strings must be enclosed in quotes.\n");
wprintw(self->window, "Messages must be enclosed in quotes.\n");
return;
}
if (argc != 1) {
@ -384,7 +383,7 @@ void cmd_statusmsg(ToxWindow *self, Tox *m, int argc, char **argv)
msg = argv[1];
tox_set_statusmessage(m, (uint8_t *) msg, strlen(msg) + 1);
wprintw(self->window, "Status message set to: %s\n", msg);
wprintw(self->window, "Personal note set to: %s\n", msg);
}
static void execute(ToxWindow *self, Tox *m, char *u_cmd)