From 2640919318449285bc3d2b17d467c277a3c858d8 Mon Sep 17 00:00:00 2001 From: jfreegman Date: Thu, 3 Dec 2020 11:49:48 -0500 Subject: [PATCH] Don't announce when ghost peers leave the group This appears to be a toxcore bug, but nonetheless it looks ugly. Also changed group -> conference for join/part messages --- src/conference.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/conference.c b/src/conference.c index 84f4016..4b5b3b4 100644 --- a/src/conference.c +++ b/src/conference.c @@ -710,7 +710,7 @@ static void update_peer_list(ToxWindow *self, Tox *m, uint32_t conferencenum, ui peer->peernum = i; if (new_peer && peer->name_length > 0 && timed_out(chat->start_time, CONFERENCE_EVENT_WAIT)) { - const char *msg = "has joined the group"; + const char *msg = "has joined the conference"; line_info_add(self, true, peer->name, NULL, CONNECTION, 0, GREEN, msg); write_to_log(msg, peer->name, ctx->log, true); } @@ -726,8 +726,8 @@ static void update_peer_list(ToxWindow *self, Tox *m, uint32_t conferencenum, ui ConferencePeer *old_peer = &old_peer_list[i]; if (old_peer->active) { - if (!find_peer_by_pubkey(chat->peer_list, chat->num_peers, old_peer->pubkey, NULL)) { - const char *msg = "has left the group"; + if (old_peer->name_length > 0 && !find_peer_by_pubkey(chat->peer_list, chat->num_peers, old_peer->pubkey, NULL)) { + const char *msg = "has left the conference"; line_info_add(self, true, old_peer->name, NULL, DISCONNECTION, 0, RED, msg); write_to_log(msg, old_peer->name, ctx->log, true); } @@ -793,7 +793,7 @@ static void conference_onConferencePeerNameChange(ToxWindow *self, Tox *m, uint3 write_to_log(log_event, peer->name, ctx->log, true); } else { // this is kind of a hack; peers always join a group with no name set and then set it after - const char *msg = "has joined the group"; + const char *msg = "has joined the conference"; line_info_add(self, true, name, NULL, CONNECTION, 0, GREEN, msg); write_to_log(msg, name, ctx->log, true); }