summaryrefslogtreecommitdiff
path: root/src/irc
diff options
context:
space:
mode:
Diffstat (limited to 'src/irc')
-rw-r--r--src/irc/irc_client.cpp8
-rw-r--r--src/irc/irc_message.cpp2
2 files changed, 5 insertions, 5 deletions
diff --git a/src/irc/irc_client.cpp b/src/irc/irc_client.cpp
index 0d4d102..0f29a2b 100644
--- a/src/irc/irc_client.cpp
+++ b/src/irc/irc_client.cpp
@@ -193,11 +193,11 @@ void IrcClient::set_and_forward_user_list(const IrcMessage& message)
std::vector<std::string> nicks = utils::split(message.arguments[3], ' ');
for (const std::string& nick: nicks)
{
- IrcUser* user = channel->add_user(nick);
+ const IrcUser* user = channel->add_user(nick);
if (user->nick != channel->get_self()->nick)
{
log_debug("Adding user [" << nick << "] to chan " << chan_name);
- this->bridge->send_user_join(this->hostname, chan_name, user->nick);
+ this->bridge->send_user_join(this->hostname, chan_name, user);
}
}
}
@@ -214,8 +214,8 @@ void IrcClient::on_channel_join(const IrcMessage& message)
}
else
{
- IrcUser* user = channel->add_user(nick);
- this->bridge->send_user_join(this->hostname, chan_name, user->nick);
+ const IrcUser* user = channel->add_user(nick);
+ this->bridge->send_user_join(this->hostname, chan_name, user);
}
}
diff --git a/src/irc/irc_message.cpp b/src/irc/irc_message.cpp
index 18fa3ec..eb3eb47 100644
--- a/src/irc/irc_message.cpp
+++ b/src/irc/irc_message.cpp
@@ -9,7 +9,7 @@ IrcMessage::IrcMessage(std::string&& line)
if (line[0] == ':')
{
pos = line.find(" ");
- this->prefix = line.substr(1, pos);
+ this->prefix = line.substr(1, pos - 1);
line = line.substr(pos + 1, std::string::npos);
}
// command