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:
37
src/prompt.c
37
src/prompt.c
@ -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) {
|
||||
|
Reference in New Issue
Block a user