summaryrefslogtreecommitdiff
path: root/toxcore/group.c
diff options
context:
space:
mode:
authorirungentoo <irungentoo@gmail.com>2014-10-01 16:15:07 -0400
committerirungentoo <irungentoo@gmail.com>2014-10-01 16:15:07 -0400
commite6fcef495848097bf9de35bea627f1d545586aed (patch)
tree6b9357bedb75d723d48528d851e80eb3aea66403 /toxcore/group.c
parentde1a531cb1b0b07a67f42d0e6212d9d72501f1e6 (diff)
If connection is already connected, send a online packet to it.
Diffstat (limited to 'toxcore/group.c')
-rw-r--r--toxcore/group.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/toxcore/group.c b/toxcore/group.c
index 5e070623..90e968c3 100644
--- a/toxcore/group.c
+++ b/toxcore/group.c
@@ -267,6 +267,8 @@ static unsigned int pk_in_closest_peers(Group_c *g, uint8_t *real_pk)
267 return 0; 267 return 0;
268} 268}
269 269
270static int send_packet_online(Friend_Connections *fr_c, int friendcon_id, uint16_t group_num, uint8_t *identifier);
271
270static int connect_to_closest(Group_Chats *g_c, int groupnumber) 272static int connect_to_closest(Group_Chats *g_c, int groupnumber)
271{ 273{
272 Group_c *g = get_group_c(g_c, groupnumber); 274 Group_c *g = get_group_c(g_c, groupnumber);
@@ -313,6 +315,9 @@ static int connect_to_closest(Group_Chats *g_c, int groupnumber)
313 } 315 }
314 316
315 add_conn_to_groupchat(g_c, friendcon_id, groupnumber, 1); 317 add_conn_to_groupchat(g_c, friendcon_id, groupnumber, 1);
318 if (friend_con_connected(g_c->fr_c, friendcon_id) == FRIENDCONN_STATUS_CONNECTED) {
319 send_packet_online(g_c->fr_c, friendcon_id, groupnumber, g->identifier);
320 }
316 } 321 }
317 322
318 g->changed = 0; 323 g->changed = 0;
@@ -398,8 +403,6 @@ static int remove_close_conn(Group_Chats *g_c, int groupnumber, int friendcon_id
398 return -1; 403 return -1;
399} 404}
400 405
401static int send_packet_online(Friend_Connections *fr_c, int friendcon_id, uint16_t group_num, uint8_t *identifier);
402
403static void set_conns_type_close(Group_Chats *g_c, int groupnumber, int friendcon_id, uint8_t type) 406static void set_conns_type_close(Group_Chats *g_c, int groupnumber, int friendcon_id, uint8_t type)
404{ 407{
405 Group_c *g = get_group_c(g_c, groupnumber); 408 Group_c *g = get_group_c(g_c, groupnumber);