1
0
mirror of https://github.com/Tha14/toxic.git synced 2024-11-22 16:53:01 +01:00

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
This commit is contained in:
jfreegman 2020-12-03 11:49:48 -05:00
parent 2fcbc4fa1c
commit 2640919318
No known key found for this signature in database
GPG Key ID: 3627F3144076AE63

View File

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