diff --git a/doc/example.conf b/doc/example.conf index d215c1d..a210279 100755 --- a/doc/example.conf +++ b/doc/example.conf @@ -515,6 +515,7 @@ general { max_nick_time = 20 seconds; max_nick_changes = 5; anti_spam_exit_message_time = 5 minutes; + use_part_messages = yes; ts_warn_delta = 30 seconds; ts_max_delta = 5 minutes; client_exit = yes; diff --git a/doc/reference.conf b/doc/reference.conf index ea3a8df..b9fcf3d 100755 --- a/doc/reference.conf +++ b/doc/reference.conf @@ -1118,10 +1118,16 @@ general { max_nick_time = 20 seconds; 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. */ - 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 * a warning is given, or before the link is dropped. all servers diff --git a/include/s_conf.h b/include/s_conf.h index 05ffeba..ae87cf7 100644 --- a/include/s_conf.h +++ b/include/s_conf.h @@ -161,6 +161,7 @@ struct config_file_entry int dots_in_ident; int failed_oper_notice; int anti_nick_flood; + int use_part_messages; int anti_spam_exit_message_time; int max_accept; int max_monitor; diff --git a/modules/core/m_part.c b/modules/core/m_part.c index 3159a3f..09ff236 100644 --- a/modules/core/m_part.c +++ b/modules/core/m_part.c @@ -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 */ 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 + ConfigFileEntry.anti_spam_exit_message_time) < rb_current_time())))) { diff --git a/modules/m_info.c b/modules/m_info.c index 85209a9..4501a18 100644 --- a/modules/m_info.c +++ b/modules/m_info.c @@ -109,6 +109,12 @@ static struct InfoStruct info_table[] = { &ConfigFileEntry.anti_spam_exit_message_time, "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", OUTPUT_DECIMAL, diff --git a/src/newconf.c b/src/newconf.c index ca9dff5..11e85f4 100644 --- a/src/newconf.c +++ b/src/newconf.c @@ -2196,6 +2196,7 @@ static struct ConfEntry conf_general_table[] = { "identify_command", CF_QSTRING, NULL, REALLEN, &ConfigFileEntry.identifycommand }, { "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 }, { "min_nonwildcard_simple", CF_INT, NULL, 0, &ConfigFileEntry.min_nonwildcard_simple }, { "non_redundant_klines", CF_YESNO, NULL, 0, &ConfigFileEntry.non_redundant_klines }, diff --git a/src/s_conf.c b/src/s_conf.c index 6239ed2..ef704d2 100644 --- a/src/s_conf.c +++ b/src/s_conf.c @@ -696,6 +696,7 @@ set_default_conf(void) ConfigFileEntry.nick_delay = 900; /* 15 minutes */ ConfigFileEntry.target_change = YES; ConfigFileEntry.anti_spam_exit_message_time = 0; + ConfigFileEntry.use_part_messages = YES; ConfigFileEntry.ts_warn_delta = TS_WARN_DELTA_DEFAULT; ConfigFileEntry.ts_max_delta = TS_MAX_DELTA_DEFAULT; ConfigFileEntry.client_exit = YES;