mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Merge pull request #233 from Spittie/patch-1
Add nicknames to the chat list
This commit is contained in:
commit
22d010b60f
|
@ -60,6 +60,8 @@ static void chat_onNickChange(ToxWindow* self, int num, uint8_t* nick, uint16_t
|
||||||
nick[len-1] = '\0';
|
nick[len-1] = '\0';
|
||||||
fix_name(nick);
|
fix_name(nick);
|
||||||
|
|
||||||
|
snprintf(self->title, sizeof(self->title), "[%s (%d)]", nick, num);
|
||||||
|
|
||||||
wattron(ctx->history, COLOR_PAIR(3));
|
wattron(ctx->history, COLOR_PAIR(3));
|
||||||
wprintw(ctx->history, " * Your partner changed nick to '%s'\n", nick);
|
wprintw(ctx->history, " * Your partner changed nick to '%s'\n", nick);
|
||||||
wattroff(ctx->history, COLOR_PAIR(3));
|
wattroff(ctx->history, COLOR_PAIR(3));
|
||||||
|
@ -144,7 +146,11 @@ ToxWindow new_chat(int friendnum) {
|
||||||
ret.onNickChange = &chat_onNickChange;
|
ret.onNickChange = &chat_onNickChange;
|
||||||
ret.onStatusChange = &chat_onStatusChange;
|
ret.onStatusChange = &chat_onStatusChange;
|
||||||
|
|
||||||
snprintf(ret.title, sizeof(ret.title), "[chat %d]", friendnum);
|
uint8_t nick[MAX_NAME_LENGTH] = {0};
|
||||||
|
getname(friendnum, (uint8_t*) &nick);
|
||||||
|
fix_name(nick);
|
||||||
|
|
||||||
|
snprintf(ret.title, sizeof(ret.title), "[%s (%d)]", nick, friendnum);
|
||||||
|
|
||||||
ChatContext* x = calloc(1, sizeof(ChatContext));
|
ChatContext* x = calloc(1, sizeof(ChatContext));
|
||||||
x->friendnum = friendnum;
|
x->friendnum = friendnum;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user