Skip to content

Commit

Permalink
new hope
Browse files Browse the repository at this point in the history
  • Loading branch information
IngvarX authored and JFreegman committed Jul 7, 2020
1 parent 738d29a commit 5f6f807
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions toxcore/group_chats.c
Original file line number Diff line number Diff line change
Expand Up @@ -4291,13 +4291,7 @@ static int handle_gc_handshake_request(Messenger *m, int groupnumber, IP_Port *i

++chat->connection_O_metre;

int peer_exists = get_peernum_of_enc_pk(chat, sender_pk);

if (peer_exists != -1) {
gc_peer_delete(m, groupnumber, peer_exists, nullptr, 0);
}

int peernumber = peer_add(m, groupnumber, ipp, sender_pk);
int peernumber = get_peernum_of_enc_pk(chat, sender_pk);

if (peernumber < 0) {
fprintf(stderr, "peer_add failed in handle_gc_handshake_request\n");
Expand Down Expand Up @@ -5741,6 +5735,17 @@ int handle_gc_invite_confirmed_packet(GC_Session *c, int friend_number, const ui
tcp_relays[i].public_key);
}

#if 0

// TODO: move handshake sending to callback
int index;
for (index = 0; index < 10; index++) {
usleep(50000);
do_tcp_connections(chat->tcp_conn);
}

#endif

if (send_gc_handshake_packet(chat, peer_id, GH_REQUEST, HS_INVITE_REQUEST, HJ_PRIVATE) == -1) {
return -1;
}
Expand Down

0 comments on commit 5f6f807

Please sign in to comment.