Commits

jdhore committed 8a60c52

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.

Comments (0)

Files changed (7)

 	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;
 	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
 	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;

modules/core/m_part.c

 	 *  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()))))
 	{
 		"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,
 		&ConfigFileEntry.caller_id_wait,
 	{ "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 },
 	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;