]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
m_filter: Minor cosmetic changes (#1645).
authorRobby <Robby-@users.noreply.github.com>
Mon, 20 May 2019 15:57:59 +0000 (17:57 +0200)
committerPeter Powell <petpow@saberuk.com>
Mon, 20 May 2019 15:57:59 +0000 (16:57 +0100)
docs/conf/helpop.conf.example
src/modules/m_filter.cpp

index 5b89c91f20f172fa7bfca9ee2a9b53195b523c56..fbe1e7a6b193cf1266d675cc2c1421e8c3299319 100644 (file)
@@ -508,7 +508,7 @@ q    Block quit messages
 o    Don't match against opers
 r    Don't match against registered users
 c    Strip all formatting codes from the message before matching
-*    Represents all of the above flags except r 
+*    Represents all of the above flags except r
 -    Does nothing, a non-op for when you do not want to specify any
      flags
 
index cad26be62f1a8304364e41befc56cce364e5b7f8..c0798f7d0353452a9b8a8d89bd6fa37cfcd92386 100644 (file)
@@ -59,12 +59,12 @@ class FilterResult
        bool from_config;
 
        bool flag_no_opers;
-       bool flag_no_registered;
        bool flag_part_message;
        bool flag_quit_message;
        bool flag_privmsg;
        bool flag_notice;
        bool flag_strip_color;
+       bool flag_no_registered;
 
        FilterResult(dynamic_reference<RegexFactory>& RegexEngine, const std::string& free, const std::string& rea, FilterAction act, unsigned long gt, const std::string& fla, bool cfg)
                : freeform(free)
@@ -81,8 +81,8 @@ class FilterResult
 
        char FillFlags(const std::string &fl)
        {
-               flag_no_opers = flag_no_registered = flag_part_message = flag_quit_message = flag_privmsg =
-                       flag_notice = flag_strip_color = false;
+               flag_no_opers = flag_part_message = flag_quit_message = flag_privmsg =
+                       flag_notice = flag_strip_color = flag_no_registered = false;
 
                for (std::string::const_iterator n = fl.begin(); n != fl.end(); ++n)
                {
@@ -134,9 +134,11 @@ class FilterResult
                        flags.push_back('p');
                if (flag_notice)
                        flags.push_back('n');
-               /* Order is important here, 'c' must be the last char in the string as it is unsupported
-                * on < 2.0.10, and the logic in FillFlags() stops parsing when it ecounters an unknown
-                * character.
+
+               /* Order is important here, as the logic in FillFlags() stops parsing when it encounters
+                * an unknown character. So the following characters must be last in the string.
+                * 'c' is unsupported on < 2.0.10
+                * 'r' is unsupported on < 3.2.0
                 */
                if (flag_strip_color)
                        flags.push_back('c');