diff --git a/src/chat.c b/src/chat.c index db98c58..b885197 100644 --- a/src/chat.c +++ b/src/chat.c @@ -104,9 +104,7 @@ static void chat_onNickChange(ToxWindow *self, int num, uint8_t *nick, uint16_t nick[len - 1] = '\0'; snprintf(self->title, sizeof(self->title), "[%s (%d)]", nick, num); - wattron(ctx->history, COLOR_PAIR(3)); wprintw(ctx->history, "* Your partner changed nick to '%s'\n", nick); - wattroff(ctx->history, COLOR_PAIR(3)); } static void chat_onStatusChange(ToxWindow *self, int num, uint8_t *status, uint16_t len) @@ -123,10 +121,7 @@ static void chat_onStatusChange(ToxWindow *self, int num, uint8_t *status, uint1 status[len - 1] = '\0'; - wattron(ctx->history, COLOR_PAIR(3)); - wprintw(ctx->history, "* Your partner changed status to '%s'\n", status); - wattroff(ctx->history, COLOR_PAIR(3)); - + wprintw(ctx->history, "* Your partner changed status message to '%s'\n", status); } /* check that the string has one non-space character */ @@ -344,12 +339,12 @@ void execute(ToxWindow *self, ChatContext *ctx, Tox *m, char *cmd) if (msg == NULL) { tox_set_userstatus(m, status_kind); - wprintw(ctx->history, "Status set to: %s\n", status_text); + wprintw(ctx->history, "Status message set to: %s\n", status_text); } else { msg++; tox_set_userstatus(m, status_kind); tox_set_statusmessage(m, ( uint8_t *) msg, strlen(msg) + 1); - wprintw(ctx->history, "Status set to: %s, %s\n", status_text, msg); + wprintw(ctx->history, "Status message set to: %s, %s\n", status_text, msg); } } diff --git a/src/friendlist.c b/src/friendlist.c index 6d48b0f..817513d 100644 --- a/src/friendlist.c +++ b/src/friendlist.c @@ -173,7 +173,7 @@ static void friendlist_onDraw(ToxWindow *self, Tox *m) for (i = 0; i < num_friends; ++i) { if (friends[i].active) { - bool is_online = tox_friendstatus(m, i) == TOX_FRIEND_ONLINE; + bool is_online = tox_friendstatus(m, friends[i].num) == TOX_FRIEND_ONLINE; if (i == num_selected) wprintw(self->window, " > "); @@ -181,8 +181,8 @@ static void friendlist_onDraw(ToxWindow *self, Tox *m) wprintw(self->window, " "); if (is_online) { - TOX_USERSTATUS status = tox_get_userstatus(m, i); - int colour; + TOX_USERSTATUS status = tox_get_userstatus(m, friends[i].num); + int colour = 3; switch(status) { case TOX_USERSTATUS_NONE: @@ -206,8 +206,9 @@ static void friendlist_onDraw(ToxWindow *self, Tox *m) if (strncmp(friends[i].statusmsg, NOSTATUSMSG, strlen(NOSTATUSMSG))) wprintw(self->window, "(%s)\n", friends[i].statusmsg); + } else { - wprintw(self->window, "%s (Offline)\n", friends[i].name); + wprintw(self->window, "(Offline)\n"); } } } diff --git a/src/prompt.c b/src/prompt.c index 97dcd9b..ef0b2d6 100644 --- a/src/prompt.c +++ b/src/prompt.c @@ -223,7 +223,7 @@ void cmd_help(ToxWindow *self, Tox *m, char **args) wprintw(self->window, " connect : Connect to DHT server\n"); wprintw(self->window, " add : Add friend\n"); wprintw(self->window, " status : Set your status\n"); - wprintw(self->window, " statusmsg : Set your status\n"); + wprintw(self->window, " statusmsg : Set your status message\n"); wprintw(self->window, " nick : Set your nickname\n"); wprintw(self->window, " mynick : Print your current nickname\n"); wprintw(self->window, " accept : Accept friend request\n"); @@ -310,11 +310,11 @@ void cmd_status(ToxWindow *self, Tox *m, char **args) if (msg == NULL) { tox_set_userstatus(m, status_kind); - wprintw(self->window, "Status set to: %s\n", status_text); + wprintw(self->window, "Status message set to: %s\n", status_text); } else { tox_set_userstatus(m, status_kind); tox_set_statusmessage(m, (uint8_t *) msg, strlen(msg) + 1); - wprintw(self->window, "Status set to: %s, %s\n", status_text, msg); + wprintw(self->window, "Status message set to: %s, %s\n", status_text, msg); } } @@ -322,7 +322,7 @@ void cmd_statusmsg(ToxWindow *self, Tox *m, char **args) { char *msg = args[1]; tox_set_statusmessage(m, (uint8_t *) msg, strlen(msg) + 1); - wprintw(self->window, "Status set to: %s\n", msg); + wprintw(self->window, "Status message set to: %s\n", msg); } static void execute(ToxWindow *self, Tox *m, char *u_cmd) diff --git a/src/windows.c b/src/windows.c index 83d60df..2ae9806 100644 --- a/src/windows.c +++ b/src/windows.c @@ -60,7 +60,7 @@ void on_action(Tox *m, int friendnumber, uint8_t *string, uint16_t length, void void on_nickchange(Tox *m, int friendnumber, uint8_t *string, uint16_t length, void *userdata) { - wprintw(prompt->window, "\n(nickchange) %d: %s\n", friendnumber, string); + wprintw(prompt->window, "\n(nick change) %d: %s\n", friendnumber, string); int i; for (i = 0; i < MAX_WINDOWS_NUM; ++i) { @@ -71,7 +71,7 @@ void on_nickchange(Tox *m, int friendnumber, uint8_t *string, uint16_t length, v void on_statuschange(Tox *m, int friendnumber, uint8_t *string, uint16_t length, void *userdata) { - wprintw(prompt->window, "\n(statuschange) %d: %s\n", friendnumber, string); + wprintw(prompt->window, "\n(message change) %d: %s\n", friendnumber, string); int i; for (i = 0; i < MAX_WINDOWS_NUM; ++i) {