Skip to content

Commit

Permalink
send Name message when a peer rejoins
Browse files Browse the repository at this point in the history
This handles the case that one peer is frozen to a second, but not vice versa.
  • Loading branch information
zugz committed Aug 15, 2018
1 parent 473b358 commit a0e6429
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/minpgc.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ and not currently mentioned in the spec.)

If we receive a Rejoin packet from a peer we update its dht key, add a
temporary groupchat connection for the peer, and, once the connection is
online, send out a New Peer message announcing the peer.
online, send out a New Peer message announcing the peer, and a Name message.

Whenever we make a new friend connection, we check if the public key is that
of any frozen peer. If so, we send it a Rejoin packet, add a temporary
Expand Down
7 changes: 5 additions & 2 deletions toxcore/group.c
Original file line number Diff line number Diff line change
Expand Up @@ -1831,6 +1831,8 @@ static int handle_packet_online(Group_Chats *g_c, int friendcon_id, const uint8_
if (peer_index != -1) {
group_new_peer_send(g_c, groupnumber, g->group[peer_index].peer_number, real_pk, temp_pk);
}

group_name_send(g_c, groupnumber, g_c->m->name, g_c->m->name_length);
}

ping_groupchat(g_c, groupnumber);
Expand Down Expand Up @@ -2379,8 +2381,9 @@ static void handle_message_packet_group(Group_Chats *g_c, uint32_t groupnumber,
const int index = note_peer_active(g_c, groupnumber, peer_number, userdata);

if (index == -1) {
/* We don't know the peer this packet came from so we query the list of peers from that peer.
(They would not have relayed it if they didn't know the peer.) */
/* 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.) */
send_peer_query(g_c, g->close[close_index].number, g->close[close_index].group_number);
return;
}
Expand Down

0 comments on commit a0e6429

Please sign in to comment.