Skip to content
This repository has been archived by the owner on Jan 30, 2022. It is now read-only.

Commit

Permalink
Add ability to hide quit messages of K/G/Z:lined users
Browse files Browse the repository at this point in the history
This add set::options::secret-ban-reasons in the configuration file

Suggested by Aubrey (#3993)
  • Loading branch information
Zoddo committed Jan 3, 2016
1 parent 293af0b commit 57f01ea
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 7 deletions.
1 change: 1 addition & 0 deletions doc/conf/examples/example.conf
Expand Up @@ -390,6 +390,7 @@ set {
options {
hide-ulines; /* hide U-lines in /MAP and /LINKS */
show-connect-info; /* show "looking up your hostname" messages on connect */
/* secret-ban-reasons; don't publicly display K/G/Z:lines reasons (in the QUIT message) */
};

maxchannelsperuser 10; /* maximum number of channels a user may /JOIN */
Expand Down
1 change: 1 addition & 0 deletions doc/conf/examples/example.fr.conf
Expand Up @@ -413,6 +413,7 @@ set {
options {
hide-ulines; /* cacher les U-lines de /MAP et /LINKS */
show-connect-info; /* afficher les messages "looking up your hostname" à la connexion */
/* secret-ban-reasons; Ne pas afficher publiquement les raisons des K/G/Z:lines (dans le message de déconnexion (QUIT)) */
};

maxchannelsperuser 10; /* nombre max de salons par utilisateur */
Expand Down
1 change: 1 addition & 0 deletions doc/conf/examples/example.tr.conf
Expand Up @@ -387,6 +387,7 @@ set {
options {
hide-ulines; /* U-lines sat�rlar� /MAP ve /LINKS komutunda g�z�kmez */
show-connect-info; /* sunucuya ba�lan�rken "looking up your hostname" mesaj� g�r�nt�lenecektir */
/* secret-ban-reasons; don't publicly display K/G/Z:lines reasons (in the QUIT message) */
};

maxchannelsperuser 10; /* bir kullan�c�n�n maksimum girebilece�i kanal say�s� */
Expand Down
2 changes: 2 additions & 0 deletions include/dynconf.h
Expand Up @@ -64,6 +64,7 @@ struct zConfiguration {
unsigned dont_resolve:1;
unsigned use_ban_version:1;
unsigned mkpasswd_for_everyone:1;
unsigned secret_ban_reasons;
unsigned allow_insane_bans;
unsigned allow_part_if_shunned:1;
unsigned disable_cap:1;
Expand Down Expand Up @@ -217,6 +218,7 @@ extern MODVAR int ipv6_disabled;
#define IDENT_READ_TIMEOUT iConf.ident_read_timeout

#define MKPASSWD_FOR_EVERYONE iConf.mkpasswd_for_everyone
#define SECRET_BAN_REASONS iConf.secret_ban_reasons
#define ALLOW_INSANE_BANS iConf.allow_insane_bans
#define CHANCMDPFX iConf.channel_command_prefix

Expand Down
2 changes: 2 additions & 0 deletions src/modules/m_stats.c
Expand Up @@ -1257,6 +1257,8 @@ int stats_set(aClient *sptr, char *para)
sptr->name, DONT_RESOLVE);
sendto_one(sptr, ":%s %i %s :options::mkpasswd-for-everyone: %d", me.name, RPL_TEXT,
sptr->name, MKPASSWD_FOR_EVERYONE);
sendto_one(sptr, ":%s %i %s :options::secret-ban-reasons: %d", me.name, RPL_TEXT,
sptr->name, SECRET_BAN_REASONS);
sendto_one(sptr, ":%s %i %s :options::allow-insane-bans: %d", me.name, RPL_TEXT,
sptr->name, ALLOW_INSANE_BANS);
sendto_one(sptr, ":%s %i %s :options::allow-part-if-shunned: %d", me.name, RPL_TEXT,
Expand Down
27 changes: 20 additions & 7 deletions src/modules/m_tkl.c
Expand Up @@ -1198,9 +1198,15 @@ int _find_tkline_match(aClient *cptr, int xx)
me.name, cptr->name,
(lp->expire_at ? "banned" : "permanently banned"),
ircnetwork, lp->reason);
ircsnprintf(msge, sizeof(msge), "User has been %s from %s (%s)",
(lp->expire_at ? "banned" : "permanently banned"),
ircnetwork, lp->reason);

if (SECRET_BAN_REASONS)
ircsnprintf(msge, sizeof(msge), "User has been %s from %s",
(lp->expire_at ? "banned" : "permanently banned"),
ircnetwork);
else
ircsnprintf(msge, sizeof(msge), "User has been %s from %s (%s)",
(lp->expire_at ? "banned" : "permanently banned"),
ircnetwork, lp->reason);
return exit_client(cptr, cptr, &me, msge);
}
else
Expand All @@ -1210,17 +1216,24 @@ int _find_tkline_match(aClient *cptr, int xx)
me.name, cptr->name,
(lp->expire_at ? "banned" : "permanently banned"),
me.name, lp->reason, KLINE_ADDRESS);
ircsnprintf(msge, sizeof(msge), "User is %s (%s)",
(lp->expire_at ? "banned" : "permanently banned"),
lp->reason);
if (SECRET_BAN_REASONS)
ircsnprintf(msge, sizeof(msge), "User is %s",
(lp->expire_at ? "banned" : "permanently banned"));
else
ircsnprintf(msge, sizeof(msge), "User is %s (%s)",
(lp->expire_at ? "banned" : "permanently banned"),
lp->reason);
return exit_client(cptr, cptr, &me, msge);

}
}
if (lp->type & TKL_ZAP)
{
ircstp->is_ref++;
ircsnprintf(msge, sizeof(msge), "Z:lined (%s)",lp->reason);
if (SECRET_BAN_REASONS && IsRegistered(cptr))
msge = "Z:lined";
else
ircsnprintf(msge, sizeof(msge), "Z:lined (%s)",lp->reason);
return exit_client(cptr, cptr, &me, msge);
}

Expand Down
6 changes: 6 additions & 0 deletions src/s_conf.c
Expand Up @@ -6920,6 +6920,9 @@ int _conf_set(ConfigFile *conf, ConfigEntry *ce)
else if (!strcmp(cepp->ce_varname, "mkpasswd-for-everyone")) {
tempiConf.mkpasswd_for_everyone = 1;
}
else if (!strcmp(cepp->ce_varname, "secret-ban-reasons")) {
tempiConf.secret_ban_reasons = 1;
}
else if (!strcmp(cepp->ce_varname, "allow-insane-bans")) {
tempiConf.allow_insane_bans = 1;
}
Expand Down Expand Up @@ -7680,6 +7683,9 @@ int _test_set(ConfigFile *conf, ConfigEntry *ce)
else if (!strcmp(cepp->ce_varname, "mkpasswd-for-everyone")) {
CheckDuplicate(cepp, options_mkpasswd_for_everyone, "options::mkpasswd-for-everyone");
}
else if (!strcmp(cepp->ce_varname, "secret-ban-reasons")) {
CheckDuplicate(cepp, options_secret_ban_reasons, "options::secret-ban-reasons");
}
else if (!strcmp(cepp->ce_varname, "allow-insane-bans")) {
CheckDuplicate(cepp, options_allow_insane_bans, "options::allow-insane-bans");
}
Expand Down

0 comments on commit 57f01ea

Please sign in to comment.