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

Compare commits

...

2 Commits

Author SHA1 Message Date
jfreegman
85024bfce8
Update config man page 2022-06-27 10:40:03 -04:00
129bb6ba68
New option: Hide peer connection status in groups 2022-06-27 17:31:05 +03:00
6 changed files with 23 additions and 4 deletions

View File

@ -2,12 +2,12 @@
.\" Title: toxic.conf .\" Title: toxic.conf
.\" Author: [see the "AUTHORS" section] .\" Author: [see the "AUTHORS" section]
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/> .\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
.\" Date: 2021-05-24 .\" Date: 2020-11-12
.\" Manual: Toxic Manual .\" Manual: Toxic Manual
.\" Source: toxic __VERSION__ .\" Source: toxic __VERSION__
.\" Language: English .\" Language: English
.\" .\"
.TH "TOXIC\&.CONF" "5" "2021\-05\-24" "toxic __VERSION__" "Toxic Manual" .TH "TOXIC\&.CONF" "5" "2020\-11\-12" "toxic __VERSION__" "Toxic Manual"
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------
.\" * Define some portability stuff .\" * Define some portability stuff
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------
@ -138,6 +138,11 @@ Show welcome message on startup\&. true or false
Enable friend connection change notifications\&. true or false Enable friend connection change notifications\&. true or false
.RE .RE
.PP .PP
\fBshow_group_connection_msg\fR
.RS 4
Enable group connection change notifications (does not include quit messages)\&. true or false
.RE
.PP
\fBnodelist_update_freq\fR \fBnodelist_update_freq\fR
.RS 4 .RS 4
How often in days to update the DHT nodes list\&. (integer; 0 to disable) How often in days to update the DHT nodes list\&. (integer; 0 to disable)

View File

@ -87,6 +87,9 @@ OPTIONS
*show_connection_msg*;; *show_connection_msg*;;
Enable friend connection change notifications. true or false Enable friend connection change notifications. true or false
*show_group_connection_msg*;;
Enable group connection change notifications (does not include quit messages). true or false
*nodelist_update_freq*;; *nodelist_update_freq*;;
How often in days to update the DHT nodes list. (integer; 0 to disable) How often in days to update the DHT nodes list. (integer; 0 to disable)

View File

@ -56,6 +56,9 @@ ui = {
// true to show friend connection change messages on the home screen // true to show friend connection change messages on the home screen
show_connection_msg=true; show_connection_msg=true;
// true to show peer connection change messages in groups (setting to false does not include user quit messages)
show_group_connection_msg=true;
// How often in days to update the DHT nodes list. (0 to disable updates) // How often in days to update the DHT nodes list. (0 to disable updates)
nodeslist_update_freq=7; nodeslist_update_freq=7;

View File

@ -991,7 +991,7 @@ static void groupchat_onGroupPeerJoin(ToxWindow *self, Tox *m, uint32_t groupnum
++chat->max_idx; ++chat->max_idx;
} }
if (timed_out(chat->time_connected, 60)) { /* ignore join messages when we first connect to the group */ if (timed_out(chat->time_connected, 60) && user_settings->show_group_connection_msg == SHOW_GROUP_CONNECTION_MSG_ON) { /* ignore join messages when we first connect to the group */
line_info_add(self, true, peer->name, NULL, CONNECTION, 0, GREEN, "has joined the room"); line_info_add(self, true, peer->name, NULL, CONNECTION, 0, GREEN, "has joined the room");
write_to_log("has joined the room", peer->name, self->chatwin->log, true); write_to_log("has joined the room", peer->name, self->chatwin->log, true);
@ -1027,7 +1027,7 @@ void groupchat_onGroupPeerExit(ToxWindow *self, Tox *m, uint32_t groupnumber, ui
if (length > 0) { if (length > 0) {
line_info_add(self, true, name, NULL, DISCONNECTION, 0, RED, "[Quit]: %s", part_message); line_info_add(self, true, name, NULL, DISCONNECTION, 0, RED, "[Quit]: %s", part_message);
snprintf(log_str, sizeof(log_str), "has left the room (%s)", part_message); snprintf(log_str, sizeof(log_str), "has left the room (%s)", part_message);
} else { } else if (user_settings->show_group_connection_msg == SHOW_GROUP_CONNECTION_MSG_ON) {
const char *exit_string = get_group_exit_string(exit_type); const char *exit_string = get_group_exit_string(exit_type);
line_info_add(self, true, name, NULL, DISCONNECTION, 0, RED, "[%s]", exit_string); line_info_add(self, true, name, NULL, DISCONNECTION, 0, RED, "[%s]", exit_string);
snprintf(log_str, sizeof(log_str), "[%s]", exit_string); snprintf(log_str, sizeof(log_str), "[%s]", exit_string);

View File

@ -63,6 +63,7 @@ static struct ui_strings {
const char *show_typing_other; const char *show_typing_other;
const char *show_welcome_msg; const char *show_welcome_msg;
const char *show_connection_msg; const char *show_connection_msg;
const char *show_group_connection_msg;
const char *nodeslist_update_freq; const char *nodeslist_update_freq;
const char *autosave_freq; const char *autosave_freq;
@ -99,6 +100,7 @@ static struct ui_strings {
"show_typing_other", "show_typing_other",
"show_welcome_msg", "show_welcome_msg",
"show_connection_msg", "show_connection_msg",
"show_group_connection_msg",
"nodeslist_update_freq", "nodeslist_update_freq",
"autosave_freq", "autosave_freq",
"line_join", "line_join",
@ -136,6 +138,7 @@ static void ui_defaults(struct user_settings *settings)
settings->show_typing_other = SHOW_TYPING_ON; settings->show_typing_other = SHOW_TYPING_ON;
settings->show_welcome_msg = SHOW_WELCOME_MSG_ON; settings->show_welcome_msg = SHOW_WELCOME_MSG_ON;
settings->show_connection_msg = SHOW_CONNECTION_MSG_ON; settings->show_connection_msg = SHOW_CONNECTION_MSG_ON;
settings->show_group_connection_msg = SHOW_GROUP_CONNECTION_MSG_ON;
settings->nodeslist_update_freq = 1; settings->nodeslist_update_freq = 1;
settings->autosave_freq = 600; settings->autosave_freq = 600;
@ -405,6 +408,7 @@ int settings_load(struct user_settings *s, const char *patharg)
config_setting_lookup_bool(setting, ui_strings.show_typing_other, &s->show_typing_other); config_setting_lookup_bool(setting, ui_strings.show_typing_other, &s->show_typing_other);
config_setting_lookup_bool(setting, ui_strings.show_welcome_msg, &s->show_welcome_msg); config_setting_lookup_bool(setting, ui_strings.show_welcome_msg, &s->show_welcome_msg);
config_setting_lookup_bool(setting, ui_strings.show_connection_msg, &s->show_connection_msg); config_setting_lookup_bool(setting, ui_strings.show_connection_msg, &s->show_connection_msg);
config_setting_lookup_bool(setting, ui_strings.show_group_connection_msg, &s->show_group_connection_msg);
config_setting_lookup_int(setting, ui_strings.history_size, &s->history_size); config_setting_lookup_int(setting, ui_strings.history_size, &s->history_size);
config_setting_lookup_int(setting, ui_strings.notification_timeout, &s->notification_timeout); config_setting_lookup_int(setting, ui_strings.notification_timeout, &s->notification_timeout);

View File

@ -54,6 +54,7 @@ struct user_settings {
int show_typing_other; /* boolean */ int show_typing_other; /* boolean */
int show_welcome_msg; /* boolean */ int show_welcome_msg; /* boolean */
int show_connection_msg; /* boolean */ int show_connection_msg; /* boolean */
int show_group_connection_msg; /* boolean */
int nodeslist_update_freq; /* int (<= 0 to disable updates) */ int nodeslist_update_freq; /* int (<= 0 to disable updates) */
int autosave_freq; /* int (<= 0 to disable autosave) */ int autosave_freq; /* int (<= 0 to disable autosave) */
@ -122,6 +123,9 @@ enum settings_values {
SHOW_CONNECTION_MSG_OFF = 0, SHOW_CONNECTION_MSG_OFF = 0,
SHOW_CONNECTION_MSG_ON = 1, SHOW_CONNECTION_MSG_ON = 1,
SHOW_GROUP_CONNECTION_MSG_OFF = 0,
SHOW_GROUP_CONNECTION_MSG_ON = 1,
DFLT_HST_SIZE = 700, DFLT_HST_SIZE = 700,
MPLEX_OFF = 0, MPLEX_OFF = 0,