]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Fix not showing all modes on a channel
authorlinuxdaemon <linuxdaemon@snoonet.org>
Wed, 20 Feb 2019 07:29:15 +0000 (01:29 -0600)
committerPeter Powell <petpow@saberuk.com>
Wed, 20 Feb 2019 08:38:35 +0000 (08:38 +0000)
Whenever a mode has a parameter, no modes past that mode will be shown
in RPL_CHANNELMODEIS.

References to items in a vector break when the vector's size is changed.

src/coremods/core_user/cmd_mode.cpp

index f58a41aa46c70590723bb7377b4ac302ca4b19f6..228c352c0fe6f100f7efeb3991fb5b246c24f9bb 100644 (file)
@@ -152,7 +152,8 @@ namespace
                // the user is a member of the channel.
                bool show_secret = chan->HasUser(user);
 
-               std::string& modes = num.push("+").GetParams().back();
+               size_t modepos = num.push("+").GetParams().size() - 1;
+               std::string modes;
                std::string param;
                for (unsigned char chr = 65; chr < 123; ++chr)
                {
@@ -182,6 +183,7 @@ namespace
                        num.push(param);
                        param.clear();
                }
+               num.GetParams()[modepos].append(modes);
        }
 }