Merge pull request #299 from edk0/tkline-reason

Add config option to hide durations of temporary K/D-lines
This commit is contained in:
Aaron Jones 2019-12-31 08:00:24 +00:00 committed by GitHub
commit 5eb10743f9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 10 additions and 1 deletions

View file

@ -580,6 +580,7 @@ general {
global_snotices = yes;
dline_with_reason = yes;
kline_with_reason = yes;
hide_tkdline_duration = no;
kline_reason = "K-Lined";
identify_service = "NickServ@services.int";
identify_command = "IDENTIFY";

View file

@ -1178,6 +1178,11 @@ general {
*/
kline_with_reason = yes;
/* tkline duration: when showing users their k/dline reason (see
* kline_with_reason), don't add "Temporary K-line 123 min."
*/
hide_tkdline_duration = no;
/* kline reason: make the users quit message on channels this
* reason instead of the oper's reason.
*/

View file

@ -178,6 +178,7 @@ struct config_file_entry
int ts_warn_delta;
int dline_with_reason;
int kline_with_reason;
int hide_tkdline_duration;
int warn_no_nline;
int nick_delay;
int non_redundant_klines;

View file

@ -2757,6 +2757,7 @@ static struct ConfEntry conf_general_table[] =
{ "hide_spoof_ips", CF_YESNO, NULL, 0, &ConfigFileEntry.hide_spoof_ips },
{ "dline_with_reason", CF_YESNO, NULL, 0, &ConfigFileEntry.dline_with_reason },
{ "kline_with_reason", CF_YESNO, NULL, 0, &ConfigFileEntry.kline_with_reason },
{ "hide_tkdline_duration", CF_YESNO, NULL, 0, &ConfigFileEntry.hide_tkdline_duration },
{ "map_oper_only", CF_YESNO, NULL, 0, &ConfigFileEntry.map_oper_only },
{ "max_accept", CF_INT, NULL, 0, &ConfigFileEntry.max_accept },
{ "max_monitor", CF_INT, NULL, 0, &ConfigFileEntry.max_monitor },

View file

@ -1339,7 +1339,8 @@ get_user_ban_reason(struct ConfItem *aconf)
{
static char reasonbuf[BUFSIZE];
if (aconf->flags & CONF_FLAGS_TEMPORARY &&
if (!ConfigFileEntry.hide_tkdline_duration &&
aconf->flags & CONF_FLAGS_TEMPORARY &&
(aconf->status == CONF_KILL || aconf->status == CONF_DLINE))
snprintf(reasonbuf, sizeof reasonbuf,
"Temporary %c-line %d min. - ",