summaryrefslogtreecommitdiff
path: root/src/coremods/core_user
diff options
context:
space:
mode:
authorlinuxdaemon <linuxdaemon@snoonet.org>2019-02-20 01:29:15 -0600
committerPeter Powell <petpow@saberuk.com>2019-02-20 08:38:35 +0000
commit20ef7d19f7b684ea34ff1cd96450744920ab4a65 (patch)
treeb0e13ecb726b78aa1457c9b0f7a9fa477441bec5 /src/coremods/core_user
parentc495b5d9cf8bed4f07c0b77a1f9e98dcc1f62068 (diff)
Fix not showing all modes on a channel
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.
Diffstat (limited to 'src/coremods/core_user')
-rw-r--r--src/coremods/core_user/cmd_mode.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/coremods/core_user/cmd_mode.cpp b/src/coremods/core_user/cmd_mode.cpp
index f58a41aa4..228c352c0 100644
--- a/src/coremods/core_user/cmd_mode.cpp
+++ b/src/coremods/core_user/cmd_mode.cpp
@@ -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);
}
}