summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--testing/toxic/chat.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/testing/toxic/chat.c b/testing/toxic/chat.c
index dceb1d7b..854d3817 100644
--- a/testing/toxic/chat.c
+++ b/testing/toxic/chat.c
@@ -60,6 +60,8 @@ static void chat_onNickChange(ToxWindow* self, int num, uint8_t* nick, uint16_t
60 nick[len-1] = '\0'; 60 nick[len-1] = '\0';
61 fix_name(nick); 61 fix_name(nick);
62 62
63 snprintf(self->title, sizeof(self->title), "[%s (%d)]", nick, num);
64
63 wattron(ctx->history, COLOR_PAIR(3)); 65 wattron(ctx->history, COLOR_PAIR(3));
64 wprintw(ctx->history, " * Your partner changed nick to '%s'\n", nick); 66 wprintw(ctx->history, " * Your partner changed nick to '%s'\n", nick);
65 wattroff(ctx->history, COLOR_PAIR(3)); 67 wattroff(ctx->history, COLOR_PAIR(3));
@@ -144,7 +146,11 @@ ToxWindow new_chat(int friendnum) {
144 ret.onNickChange = &chat_onNickChange; 146 ret.onNickChange = &chat_onNickChange;
145 ret.onStatusChange = &chat_onStatusChange; 147 ret.onStatusChange = &chat_onStatusChange;
146 148
147 snprintf(ret.title, sizeof(ret.title), "[chat %d]", friendnum); 149 uint8_t nick[MAX_NAME_LENGTH] = {0};
150 getname(friendnum, (uint8_t*) &nick);
151 fix_name(nick);
152
153 snprintf(ret.title, sizeof(ret.title), "[%s (%d)]", nick, friendnum);
148 154
149 ChatContext* x = calloc(1, sizeof(ChatContext)); 155 ChatContext* x = calloc(1, sizeof(ChatContext));
150 x->friendnum = friendnum; 156 x->friendnum = friendnum;