Fixed bug where group chat would see connection as offline when it was online.

Clarified something in the docs.
This commit is contained in:
irungentoo 2014-12-02 19:35:54 -05:00
parent 505bab76bd
commit 607003509b
No known key found for this signature in database
GPG Key ID: 10349DC9BED89E98
2 changed files with 6 additions and 1 deletions

View File

@ -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]

View File

@ -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);