From d83abccf0ed7cb09b2070b7a68bca5b011f4d333 Mon Sep 17 00:00:00 2001 From: irungentoo Date: Sat, 16 Nov 2013 20:14:01 -0500 Subject: [PATCH] Send our name when someone new joins the group chat. --- toxcore/group_chats.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/toxcore/group_chats.c b/toxcore/group_chats.c index 5376713c..5a68bc1a 100644 --- a/toxcore/group_chats.c +++ b/toxcore/group_chats.c @@ -393,6 +393,7 @@ static int handle_sendnodes(Group_Chat *chat, IP_Port source, int peernum, uint8 } #define GROUP_DATA_MIN_SIZE (crypto_box_PUBLICKEYBYTES + sizeof(uint32_t) + 1) +static void send_names_new_peer(Group_Chat *chat); static int handle_data(Group_Chat *chat, uint8_t *data, uint32_t len) { @@ -445,6 +446,7 @@ static int handle_data(Group_Chat *chat, uint8_t *data, uint32_t len) return 1; addpeer(chat, contents); + send_names_new_peer(chat); break; case GROUP_CHAT_PEER_NICK: @@ -638,7 +640,11 @@ static void del_dead_peers(Group_Chat *chat) } #define NICK_SEND_INTERVAL 180 - +static void send_names_new_peer(Group_Chat *chat) +{ + group_send_nick(chat, chat->nick, chat->nick_len); + chat->last_sent_nick = (unix_time() - NICK_SEND_INTERVAL) + 10; +} static void send_names(Group_Chat *chat) { /* send own nick from time to time, to let newly added peers be informed