diff options
author | irungentoo <irungentoo@gmail.com> | 2013-11-25 19:45:04 -0500 |
---|---|---|
committer | irungentoo <irungentoo@gmail.com> | 2013-11-25 19:45:04 -0500 |
commit | bc06c7b2b01fabca410deec83a884a079f03d03c (patch) | |
tree | 224b26b86fb1aba1e21b20ac35444f0f008a165d /toxcore | |
parent | 2967b67b7f3dd27ae1c8fb99f37e42016b946f26 (diff) |
Behaviour changes for the group chat callback.
Diffstat (limited to 'toxcore')
-rw-r--r-- | toxcore/group_chats.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/toxcore/group_chats.c b/toxcore/group_chats.c index ec9229c4..1637f181 100644 --- a/toxcore/group_chats.c +++ b/toxcore/group_chats.c | |||
@@ -255,10 +255,7 @@ static int delpeer(Group_Chat *chat, int peernum) | |||
255 | chat->group = temp; | 255 | chat->group = temp; |
256 | 256 | ||
257 | if (chat->peer_namelistchange != NULL) { | 257 | if (chat->peer_namelistchange != NULL) { |
258 | (*chat->peer_namelistchange)(chat, chat->numpeers, CHAT_CHANGE_PEER_DEL, chat->group_namelistchange_userdata); | 258 | (*chat->peer_namelistchange)(chat, peernum, CHAT_CHANGE_PEER_DEL, chat->group_namelistchange_userdata); |
259 | |||
260 | if (chat->numpeers != (uint32_t)peernum) | ||
261 | (*chat->peer_namelistchange)(chat, peernum, CHAT_CHANGE_PEER_NAME, chat->group_namelistchange_userdata); | ||
262 | } | 259 | } |
263 | 260 | ||
264 | return 0; | 261 | return 0; |
@@ -291,9 +288,9 @@ static void setnick(Group_Chat *chat, int peernum, uint8_t *contents, uint16_t c | |||
291 | return; | 288 | return; |
292 | 289 | ||
293 | /* same name as already stored? */ | 290 | /* same name as already stored? */ |
294 | if ((chat->group[peernum].nick_len == contents_len) && | 291 | if (chat->group[peernum].nick_len == contents_len) |
295 | !memcmp(chat->group[peernum].nick, contents, contents_len)) | 292 | if (!memcmp(chat->group[peernum].nick, contents, contents_len)) |
296 | return; | 293 | return; |
297 | 294 | ||
298 | memcpy(chat->group[peernum].nick, contents, contents_len); | 295 | memcpy(chat->group[peernum].nick, contents, contents_len); |
299 | /* Force null termination */ | 296 | /* Force null termination */ |