mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Fixed bug where group chat would see connection as offline when it was online.
Clarified something in the docs.
This commit is contained in:
parent
505bab76bd
commit
607003509b
|
@ -23,7 +23,7 @@ Response packet
|
||||||
|
|
||||||
|
|
||||||
Peer online packet:
|
Peer online packet:
|
||||||
[uint8_t id 97][uint16_t group chat number][33 bytes group chat identifier[1 byte type][32 bytes id]]
|
[uint8_t id 97][uint16_t group chat number (local)][33 bytes group chat identifier[1 byte type][32 bytes id]]
|
||||||
|
|
||||||
Peer leave packet:
|
Peer leave packet:
|
||||||
[uint8_t id 98][uint16_t group chat number][uint8_t id 1]
|
[uint8_t id 98][uint16_t group chat number][uint8_t id 1]
|
||||||
|
|
|
@ -1383,12 +1383,17 @@ static int handle_packet_online(Group_Chats *g_c, int friendcon_id, uint8_t *dat
|
||||||
if (index == -1)
|
if (index == -1)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
if (g->close[index].type == GROUPCHAT_CLOSE_ONLINE) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
if (count_close_connected(g) == 0) {
|
if (count_close_connected(g) == 0) {
|
||||||
send_peer_query(g_c, friendcon_id, other_groupnum);
|
send_peer_query(g_c, friendcon_id, other_groupnum);
|
||||||
}
|
}
|
||||||
|
|
||||||
g->close[index].group_number = other_groupnum;
|
g->close[index].group_number = other_groupnum;
|
||||||
g->close[index].type = GROUPCHAT_CLOSE_ONLINE;
|
g->close[index].type = GROUPCHAT_CLOSE_ONLINE;
|
||||||
|
send_packet_online(g_c->fr_c, friendcon_id, groupnumber, g->identifier);
|
||||||
|
|
||||||
if (g->number_joined != -1 && count_close_connected(g) >= DESIRED_CLOSE_CONNECTIONS) {
|
if (g->number_joined != -1 && count_close_connected(g) >= DESIRED_CLOSE_CONNECTIONS) {
|
||||||
int fr_close_index = friend_in_close(g, g->number_joined);
|
int fr_close_index = friend_in_close(g, g->number_joined);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user