summaryrefslogtreecommitdiff
path: root/src/irc
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2013-12-08 20:14:12 +0100
committerFlorent Le Coz <louiz@louiz.org>2013-12-08 20:14:12 +0100
commitb11126a19dbaadf4c32fb8dbec22754ad0712c26 (patch)
tree140a9c33a264adfb4eee7a0e2add0b6c5ec1671c /src/irc
parentcb718def0cb51aac4c2125e3864522740fcb2573 (diff)
downloadbiboumi-b11126a19dbaadf4c32fb8dbec22754ad0712c26.tar.gz
biboumi-b11126a19dbaadf4c32fb8dbec22754ad0712c26.tar.bz2
biboumi-b11126a19dbaadf4c32fb8dbec22754ad0712c26.tar.xz
biboumi-b11126a19dbaadf4c32fb8dbec22754ad0712c26.zip
Provide a JID for IRC users, and add a stringprep dependency for this
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