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

remove superfluous prompt alerts and some visual changes

This commit is contained in:
Jfreegman
2013-09-05 01:34:23 -04:00
parent f7d96b0779
commit 369233ba04
4 changed files with 70 additions and 92 deletions

View File

@ -314,7 +314,8 @@ void cmd_nick(ToxWindow *self, Tox *m, int argc, char **argv)
}
nick = argv[1];
nick[strlen(++nick)-1] = L'\0';
if (nick[0] == '\"')
nick[strlen(++nick)-1] = L'\0';
tox_setname(m, (uint8_t *) nick, strlen(nick) + 1);
wprintw(self->window, "Nickname set to: %s\n", nick);
@ -358,19 +359,31 @@ void cmd_status(ToxWindow *self, Tox *m, int argc, char **argv)
if (!strncmp(status, "online", strlen("online"))) {
status_kind = TOX_USERSTATUS_NONE;
status_text = "Online";
} else if (!strncmp(status, "away", strlen("away"))) {
status_kind = TOX_USERSTATUS_AWAY;
status_text = "Away";
} else if (!strncmp(status, "busy", strlen("busy"))) {
status_kind = TOX_USERSTATUS_BUSY;
status_text = "Busy";
} else {
wprintw(self->window, "Invalid status.\n");
return;
wprintw(self->window, "Status set to: ");
wattron(self->window, COLOR_PAIR(GREEN) | A_BOLD);
wprintw(self->window, "[Online]\n");
wattroff(self->window, COLOR_PAIR(GREEN) | A_BOLD);
}
wprintw(self->window, "Status set to: %s\n", status_text);
else if (!strncmp(status, "away", strlen("away"))) {
status_kind = TOX_USERSTATUS_AWAY;
wprintw(self->window, "Status set to: ");
wattron(self->window, COLOR_PAIR(YELLOW) | A_BOLD);
wprintw(self->window, "[Away]\n");
wattroff(self->window, COLOR_PAIR(YELLOW) | A_BOLD);
}
else if (!strncmp(status, "busy", strlen("busy"))) {
status_kind = TOX_USERSTATUS_BUSY;
wprintw(self->window, "Status set to: ");
wattron(self->window, COLOR_PAIR(RED) | A_BOLD);
wprintw(self->window, "[Busy]\n");
wattroff(self->window, COLOR_PAIR(RED) | A_BOLD);
}
else
wprintw(self->window, "Invalid status.\n");
tox_set_userstatus(m, status_kind);
if (msg != NULL) {