mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Avoid sending group messages to a peer before we have its group number
This commit is contained in:
parent
6bc12232ac
commit
86935beb2f
|
@ -1041,7 +1041,10 @@ static void remove_conn_reason(Group_Chats *g_c, uint32_t groupnumber, uint16_t
|
|||
|
||||
if (reason == GROUPCHAT_CLOSE_REASON_INTRODUCER) {
|
||||
--g->num_introducer_connections;
|
||||
send_peer_introduced(g_c, g->close[i].number, g->close[i].group_number);
|
||||
|
||||
if (g->close[i].type == GROUPCHAT_CLOSE_ONLINE) {
|
||||
send_peer_introduced(g_c, g->close[i].number, g->close[i].group_number);
|
||||
}
|
||||
}
|
||||
|
||||
if (g->close[i].reasons == 0) {
|
||||
|
@ -2237,6 +2240,10 @@ static void handle_direct_packet(Group_Chats *g_c, uint32_t groupnumber, const u
|
|||
return;
|
||||
}
|
||||
|
||||
if (g->close[close_index].type != GROUPCHAT_CLOSE_ONLINE) {
|
||||
return;
|
||||
}
|
||||
|
||||
send_peers(g_c, groupnumber, g->close[close_index].number, g->close[close_index].group_number);
|
||||
}
|
||||
|
||||
|
@ -2582,6 +2589,10 @@ static void handle_message_packet_group(Group_Chats *g_c, uint32_t groupnumber,
|
|||
return;
|
||||
}
|
||||
|
||||
if (g->close[close_index].type != GROUPCHAT_CLOSE_ONLINE) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* If we don't know the peer this packet came from, then we query the
|
||||
* list of peers from the relaying peer.
|
||||
* (They would not have relayed it if they didn't know the peer.) */
|
||||
|
|
Loading…
Reference in New Issue
Block a user