mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
setnick(): don't callback when an identical nickname is set again
This commit is contained in:
parent
56079c92c3
commit
0b0848d9ac
|
@ -290,6 +290,11 @@ static void setnick(Group_Chat *chat, int peernum, uint8_t *contents, uint16_t c
|
|||
if (contents_len > MAX_NICK_BYTES || contents_len == 0)
|
||||
return;
|
||||
|
||||
/* same name as already stored? */
|
||||
if ((chat->group[peernum].nick_len == contents_len) &&
|
||||
!memcmp(chat->group[peernum].nick, contents, contents_len))
|
||||
return;
|
||||
|
||||
memcpy(chat->group[peernum].nick, contents, contents_len);
|
||||
/* Force null termination */
|
||||
chat->group[peernum].nick[contents_len - 1] = 0;
|
||||
|
|
Loading…
Reference in New Issue
Block a user