Add use_part_messages config option. When disabled, this will show

all PARTs without a message/reason. Recommended to set to no if
a static quit message is set.
This commit is contained in:
JD Horelick 2010-03-13 22:56:38 -05:00
parent c0e2aa60b8
commit e78f685073
7 changed files with 19 additions and 3 deletions

View File

@ -515,6 +515,7 @@ general {
max_nick_time = 20 seconds; max_nick_time = 20 seconds;
max_nick_changes = 5; max_nick_changes = 5;
anti_spam_exit_message_time = 5 minutes; anti_spam_exit_message_time = 5 minutes;
use_part_messages = yes;
ts_warn_delta = 30 seconds; ts_warn_delta = 30 seconds;
ts_max_delta = 5 minutes; ts_max_delta = 5 minutes;
client_exit = yes; client_exit = yes;

View File

@ -1118,10 +1118,16 @@ general {
max_nick_time = 20 seconds; max_nick_time = 20 seconds;
max_nick_changes = 5; max_nick_changes = 5;
/* anti spam time: the minimum time a user must be connected before /* anti spam time: the minimum time a user must be connected before
* custom quit messages are allowed. * custom quit messages are allowed.
*/ */
anti_spam_exit_message_time = 5 minutes; anti_spam_exit_message_time = 5 minutes;
/* use part messages: This option controls whether users should be
* allowed to send PART messages to channels. It should probably
* be set to no if static_quit is set.
*/
use_part_messages = yes;
/* ts delta: the time delta allowed between server clocks before /* ts delta: the time delta allowed between server clocks before
* a warning is given, or before the link is dropped. all servers * a warning is given, or before the link is dropped. all servers

View File

@ -161,6 +161,7 @@ struct config_file_entry
int dots_in_ident; int dots_in_ident;
int failed_oper_notice; int failed_oper_notice;
int anti_nick_flood; int anti_nick_flood;
int use_part_messages;
int anti_spam_exit_message_time; int anti_spam_exit_message_time;
int max_accept; int max_accept;
int max_monitor; int max_monitor;

View File

@ -124,7 +124,7 @@ part_one_client(struct Client *client_p, struct Client *source_p, char *name, ch
* only allow /part reasons in -m chans * only allow /part reasons in -m chans
*/ */
if(reason[0] && (is_any_op(msptr) || !MyConnect(source_p) || if(reason[0] && (is_any_op(msptr) || !MyConnect(source_p) ||
((can_send(chptr, source_p, msptr) > 0 && ((can_send(chptr, source_p, msptr) > 0 && ConfigFileEntry.use_part_messages &&
(source_p->localClient->firsttime + (source_p->localClient->firsttime +
ConfigFileEntry.anti_spam_exit_message_time) < rb_current_time())))) ConfigFileEntry.anti_spam_exit_message_time) < rb_current_time()))))
{ {

View File

@ -109,6 +109,12 @@ static struct InfoStruct info_table[] = {
&ConfigFileEntry.anti_spam_exit_message_time, &ConfigFileEntry.anti_spam_exit_message_time,
"Duration a client must be connected for to have an exit message" "Duration a client must be connected for to have an exit message"
}, },
{
"use_part_messages",
OUTPUT_BOOLEAN_YN,
&ConfigFileEntry.use_part_messages,
"Whether or not the server should allow users to show messages on PART"
},
{ {
"caller_id_wait", "caller_id_wait",
OUTPUT_DECIMAL, OUTPUT_DECIMAL,

View File

@ -2196,6 +2196,7 @@ static struct ConfEntry conf_general_table[] =
{ "identify_command", CF_QSTRING, NULL, REALLEN, &ConfigFileEntry.identifycommand }, { "identify_command", CF_QSTRING, NULL, REALLEN, &ConfigFileEntry.identifycommand },
{ "anti_spam_exit_message_time", CF_TIME, NULL, 0, &ConfigFileEntry.anti_spam_exit_message_time }, { "anti_spam_exit_message_time", CF_TIME, NULL, 0, &ConfigFileEntry.anti_spam_exit_message_time },
{ "use_part_messages", CF_YESNO, NULL, 0, &ConfigFileEntry.use_part_messages },
{ "disable_fake_channels", CF_YESNO, NULL, 0, &ConfigFileEntry.disable_fake_channels }, { "disable_fake_channels", CF_YESNO, NULL, 0, &ConfigFileEntry.disable_fake_channels },
{ "min_nonwildcard_simple", CF_INT, NULL, 0, &ConfigFileEntry.min_nonwildcard_simple }, { "min_nonwildcard_simple", CF_INT, NULL, 0, &ConfigFileEntry.min_nonwildcard_simple },
{ "non_redundant_klines", CF_YESNO, NULL, 0, &ConfigFileEntry.non_redundant_klines }, { "non_redundant_klines", CF_YESNO, NULL, 0, &ConfigFileEntry.non_redundant_klines },

View File

@ -696,6 +696,7 @@ set_default_conf(void)
ConfigFileEntry.nick_delay = 900; /* 15 minutes */ ConfigFileEntry.nick_delay = 900; /* 15 minutes */
ConfigFileEntry.target_change = YES; ConfigFileEntry.target_change = YES;
ConfigFileEntry.anti_spam_exit_message_time = 0; ConfigFileEntry.anti_spam_exit_message_time = 0;
ConfigFileEntry.use_part_messages = YES;
ConfigFileEntry.ts_warn_delta = TS_WARN_DELTA_DEFAULT; ConfigFileEntry.ts_warn_delta = TS_WARN_DELTA_DEFAULT;
ConfigFileEntry.ts_max_delta = TS_MAX_DELTA_DEFAULT; ConfigFileEntry.ts_max_delta = TS_MAX_DELTA_DEFAULT;
ConfigFileEntry.client_exit = YES; ConfigFileEntry.client_exit = YES;