diff options
Diffstat (limited to 'toxcore/Messenger.c')
-rw-r--r-- | toxcore/Messenger.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/toxcore/Messenger.c b/toxcore/Messenger.c index 4344fdcb..b65f09ae 100644 --- a/toxcore/Messenger.c +++ b/toxcore/Messenger.c | |||
@@ -1206,8 +1206,10 @@ int join_groupchat(Messenger *m, int32_t friendnumber, const uint8_t *friend_gro | |||
1206 | 1206 | ||
1207 | IP_Port friend_ip = get_friend_ipport(m, friendnumber); | 1207 | IP_Port friend_ip = get_friend_ipport(m, friendnumber); |
1208 | 1208 | ||
1209 | if (friend_ip.ip.family == 0) | 1209 | if (friend_ip.ip.family == 0) { |
1210 | del_groupchat(m, groupnum); | ||
1210 | return -1; | 1211 | return -1; |
1212 | } | ||
1211 | 1213 | ||
1212 | id_copy(data, friend_group_public_key); | 1214 | id_copy(data, friend_group_public_key); |
1213 | id_copy(data + crypto_box_PUBLICKEYBYTES, m->chats[groupnum]->self_public_key); | 1215 | id_copy(data + crypto_box_PUBLICKEYBYTES, m->chats[groupnum]->self_public_key); |
@@ -1218,6 +1220,7 @@ int join_groupchat(Messenger *m, int32_t friendnumber, const uint8_t *friend_gro | |||
1218 | return groupnum; | 1220 | return groupnum; |
1219 | } | 1221 | } |
1220 | 1222 | ||
1223 | del_groupchat(m, groupnum); | ||
1221 | return -1; | 1224 | return -1; |
1222 | } | 1225 | } |
1223 | 1226 | ||
@@ -2598,6 +2601,10 @@ static int friends_list_load(Messenger *m, const uint8_t *data, uint32_t length) | |||
2598 | 2601 | ||
2599 | if (temp.status >= 3) { | 2602 | if (temp.status >= 3) { |
2600 | int fnum = m_addfriend_norequest(m, temp.client_id); | 2603 | int fnum = m_addfriend_norequest(m, temp.client_id); |
2604 | |||
2605 | if (fnum < 0) | ||
2606 | continue; | ||
2607 | |||
2601 | setfriendname(m, fnum, temp.name, ntohs(temp.name_length)); | 2608 | setfriendname(m, fnum, temp.name, ntohs(temp.name_length)); |
2602 | set_friend_statusmessage(m, fnum, temp.statusmessage, ntohs(temp.statusmessage_length)); | 2609 | set_friend_statusmessage(m, fnum, temp.statusmessage, ntohs(temp.statusmessage_length)); |
2603 | set_friend_userstatus(m, fnum, temp.userstatus); | 2610 | set_friend_userstatus(m, fnum, temp.userstatus); |