summaryrefslogtreecommitdiff
path: root/src/irc
diff options
context:
space:
mode:
Diffstat (limited to 'src/irc')
-rw-r--r--src/irc/irc_client.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/irc/irc_client.cpp b/src/irc/irc_client.cpp
index 1a9e61b..af3df62 100644
--- a/src/irc/irc_client.cpp
+++ b/src/irc/irc_client.cpp
@@ -377,10 +377,18 @@ void IrcClient::on_channel_mode(const IrcMessage& message)
iid.chan = message.arguments[0];
iid.server = this->hostname;
IrcUser user(message.prefix);
+ std::string mode_arguments;
+ for (size_t i = 1; i < message.arguments.size(); ++i)
+ {
+ if (!message.arguments[i].empty())
+ {
+ if (i != 1)
+ mode_arguments += " ";
+ mode_arguments += message.arguments[i];
+ }
+ }
this->bridge->send_message(iid, "", std::string("Mode ") + iid.chan +
- " [" + message.arguments[1] +
- (message.arguments.size() > 2 ? (" " + message.arguments[2]): "")
- + "] by " + user.nick,
+ " [" + mode_arguments + "] by " + user.nick,
true);
}