setnick(): don't callback when an identical nickname is set again

This commit is contained in:
Coren[m] 2013-11-25 19:18:11 +01:00
parent 56079c92c3
commit 0b0848d9ac
No known key found for this signature in database
GPG Key ID: AFA6943800F5DC6D

View File

@ -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;