]> jfr.im git - irc/rqf/shadowircd.git/commitdiff
Add use_part_messages config option. When disabled, this will show
authorJD Horelick <redacted>
Sun, 14 Mar 2010 03:56:38 +0000 (22:56 -0500)
committerJD Horelick <redacted>
Sun, 14 Mar 2010 03:56:38 +0000 (22:56 -0500)
all PARTs without a message/reason. Recommended to set to no if
a static quit message is set.

doc/example.conf
doc/reference.conf
include/s_conf.h
modules/core/m_part.c
modules/m_info.c
src/newconf.c
src/s_conf.c

index d215c1ddb4ba1023fdf1458439416811e01d43ad..a21027932d70a5a4718e4ee0f73549b8ff159a5e 100755 (executable)
@@ -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;
index ea3a8df8e9ee3a1da5919fe8d65aa1c7397df211..b9fcf3dfb24d40f0afd6e11439a2dabff07c621e 100755 (executable)
@@ -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
index 05ffeba22e943f2d5a813d1cf4055c7f7b308c91..ae87cf7e866bfde82ff127b6b3ccf54a32bb2585 100644 (file)
@@ -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;
index 3159a3f7c0ded6c9ab7d80d1f78afe5d6d7c6d2c..09ff23662e54e7d1279d3d79fdecafbe1f152a70 100644 (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
         */
        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()))))
        {
index 85209a9b21ee4b693774ef89e05b73c0f74622eb..4501a185f75854eefd30c139df643254d927a371 100644 (file)
@@ -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,
index ca9dff58707f945ecb10a8a68c4cb95eccba3a7a..11e85f445ed1dc99a6e9c0975c11d02cdd0effa1 100644 (file)
@@ -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 },
index 6239ed2e7416370afb809e5f286e03009c316b29..ef704d28cd0ec3ce98e4dc23cbfe282d98a341fb 100644 (file)
@@ -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;