mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Behaviour changes for the group chat callback.
This commit is contained in:
parent
2967b67b7f
commit
bc06c7b2b0
|
@ -255,10 +255,7 @@ static int delpeer(Group_Chat *chat, int peernum)
|
||||||
chat->group = temp;
|
chat->group = temp;
|
||||||
|
|
||||||
if (chat->peer_namelistchange != NULL) {
|
if (chat->peer_namelistchange != NULL) {
|
||||||
(*chat->peer_namelistchange)(chat, chat->numpeers, CHAT_CHANGE_PEER_DEL, chat->group_namelistchange_userdata);
|
(*chat->peer_namelistchange)(chat, peernum, CHAT_CHANGE_PEER_DEL, chat->group_namelistchange_userdata);
|
||||||
|
|
||||||
if (chat->numpeers != (uint32_t)peernum)
|
|
||||||
(*chat->peer_namelistchange)(chat, peernum, CHAT_CHANGE_PEER_NAME, chat->group_namelistchange_userdata);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -291,9 +288,9 @@ static void setnick(Group_Chat *chat, int peernum, uint8_t *contents, uint16_t c
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* same name as already stored? */
|
/* same name as already stored? */
|
||||||
if ((chat->group[peernum].nick_len == contents_len) &&
|
if (chat->group[peernum].nick_len == contents_len)
|
||||||
!memcmp(chat->group[peernum].nick, contents, contents_len))
|
if (!memcmp(chat->group[peernum].nick, contents, contents_len))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
memcpy(chat->group[peernum].nick, contents, contents_len);
|
memcpy(chat->group[peernum].nick, contents, contents_len);
|
||||||
/* Force null termination */
|
/* Force null termination */
|
||||||
|
|
Loading…
Reference in New Issue
Block a user