Skip to content

Commit 94f868a

Browse files
committed
don't show group quit notifications when disabled in config
1 parent 18b5abf commit 94f868a

4 files changed

Lines changed: 10 additions & 9 deletions

File tree

doc/toxic.conf.5

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
.\" Title: toxic.conf
33
.\" Author: [see the "AUTHORS" section]
44
.\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
5-
.\" Date: 2022-06-27
5+
.\" Date: 2023-03-04
66
.\" Manual: Toxic Manual
77
.\" Source: toxic __VERSION__
88
.\" Language: English
99
.\"
10-
.TH "TOXIC\&.CONF" "5" "2022\-06\-27" "toxic __VERSION__" "Toxic Manual"
10+
.TH "TOXIC\&.CONF" "5" "2023\-03\-04" "toxic __VERSION__" "Toxic Manual"
1111
.\" -----------------------------------------------------------------
1212
.\" * Define some portability stuff
1313
.\" -----------------------------------------------------------------
@@ -140,7 +140,7 @@ Enable friend connection change notifications\&. true or false
140140
.PP
141141
\fBshow_group_connection_msg\fR
142142
.RS 4
143-
Enable group connection change notifications (does not include quit messages)\&. true or false
143+
Enable group connection change notifications\&. true or false
144144
.RE
145145
.PP
146146
\fBnodelist_update_freq\fR

doc/toxic.conf.5.asc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ OPTIONS
8888
Enable friend connection change notifications. true or false
8989

9090
*show_group_connection_msg*;;
91-
Enable group connection change notifications (does not include quit messages). true or false
91+
Enable group connection change notifications. true or false
9292

9393
*nodelist_update_freq*;;
9494
How often in days to update the DHT nodes list. (integer; 0 to disable)

misc/toxic.conf.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ ui = {
5656
// true to show friend connection change messages on the home screen
5757
show_connection_msg=true;
5858

59-
// true to show peer connection change messages in groups (setting to false does not include user quit messages)
59+
// true to show peer connection change messages in groups
6060
show_group_connection_msg=true;
6161

6262
// How often in days to update the DHT nodes list. (0 to disable updates)

src/groupchats.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1162,9 +1162,9 @@ static void groupchat_onGroupPeerJoin(ToxWindow *self, Tox *m, uint32_t groupnum
11621162
++chat->max_idx;
11631163
}
11641164

1165+
/* ignore join messages when we first connect to the group */
11651166
if (timed_out(chat->time_connected, 60)
1166-
&& user_settings->show_group_connection_msg ==
1167-
SHOW_GROUP_CONNECTION_MSG_ON) { /* ignore join messages when we first connect to the group */
1167+
&& user_settings->show_group_connection_msg == SHOW_GROUP_CONNECTION_MSG_ON) {
11681168
line_info_add(self, true, peer->name, NULL, CONNECTION, 0, GREEN, "has joined the room");
11691169

11701170
write_to_log("has joined the room", peer->name, self->chatwin->log, true);
@@ -1194,15 +1194,16 @@ void groupchat_onGroupPeerExit(ToxWindow *self, Tox *m, uint32_t groupnumber, ui
11941194
return;
11951195
}
11961196

1197-
if (exit_type != TOX_GROUP_EXIT_TYPE_SELF_DISCONNECTED) {
1197+
if (exit_type != TOX_GROUP_EXIT_TYPE_SELF_DISCONNECTED
1198+
&& user_settings->show_group_connection_msg == SHOW_GROUP_CONNECTION_MSG_ON) {
11981199
char log_str[TOX_MAX_NAME_LENGTH + MAX_STR_SIZE];
11991200

12001201
if (length > 0) {
12011202
line_info_add(self, true, name, NULL, DISCONNECTION, 0, RED, "[Quit]: %s", part_message);
12021203
snprintf(log_str, sizeof(log_str), "has left the room (%s)", part_message);
12031204
write_to_log(log_str, name, self->chatwin->log, true);
12041205
sound_notify(self, silent, NT_WNDALERT_2, NULL);
1205-
} else if (user_settings->show_group_connection_msg == SHOW_GROUP_CONNECTION_MSG_ON) {
1206+
} else {
12061207
const char *exit_string = get_group_exit_string(exit_type);
12071208
line_info_add(self, true, name, NULL, DISCONNECTION, 0, RED, "[%s]", exit_string);
12081209
snprintf(log_str, sizeof(log_str), "[%s]", exit_string);

0 commit comments

Comments
 (0)