summaryrefslogtreecommitdiff
path: root/src/irc/irc_client.cpp
diff options
context:
space:
mode:
authorlouiz’ <louiz@louiz.org>2018-03-12 00:04:26 +0100
committerlouiz’ <louiz@louiz.org>2018-03-12 00:13:59 +0100
commitbb596582bd2d8b9aab3fe08e76a7d24d82bf614a (patch)
tree9ebe416dfb7b9b2dd6c6a4ba4b56a69b7c455456 /src/irc/irc_client.cpp
parent158d743bf539399e48c64044639b90e5c1705ac1 (diff)
downloadbiboumi-bb596582bd2d8b9aab3fe08e76a7d24d82bf614a.tar.gz
biboumi-bb596582bd2d8b9aab3fe08e76a7d24d82bf614a.tar.bz2
biboumi-bb596582bd2d8b9aab3fe08e76a7d24d82bf614a.tar.xz
biboumi-bb596582bd2d8b9aab3fe08e76a7d24d82bf614a.zip
Add a <item/> node in the presence of a leaving participant
fix #3339
Diffstat (limited to 'src/irc/irc_client.cpp')
-rw-r--r--src/irc/irc_client.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/irc/irc_client.cpp b/src/irc/irc_client.cpp
index a866726..c5ef36c 100644
--- a/src/irc/irc_client.cpp
+++ b/src/irc/irc_client.cpp
@@ -951,18 +951,18 @@ void IrcClient::on_part(const IrcMessage& message)
{
std::string nick = user->nick;
bool self = channel->get_self() && channel->get_self()->nick == nick;
- channel->remove_user(user);
- Iid iid;
- iid.set_local(chan_name);
- iid.set_server(this->hostname);
- iid.type = Iid::Type::Channel;
+ auto user_ptr = channel->remove_user(user);
if (self)
{
this->channels.erase(utils::tolower(chan_name));
// channel pointer is now invalid
channel = nullptr;
}
- this->bridge.send_muc_leave(iid, std::move(nick), txt, self, true);
+ Iid iid;
+ iid.set_local(chan_name);
+ iid.set_server(this->hostname);
+ iid.type = Iid::Type::Channel;
+ this->bridge.send_muc_leave(iid, *user_ptr, txt, self, true);
}
}
@@ -979,8 +979,7 @@ void IrcClient::on_error(const IrcMessage& message)
IrcChannel* channel = pair.second.get();
if (!channel->joined)
continue;
- std::string own_nick = channel->get_self()->nick;
- this->bridge.send_muc_leave(iid, std::move(own_nick), leave_message, true, false);
+ this->bridge.send_muc_leave(iid, *channel->get_self(), leave_message, true, false);
}
this->channels.clear();
this->send_gateway_message("ERROR: " + leave_message);
@@ -1005,7 +1004,7 @@ void IrcClient::on_quit(const IrcMessage& message)
iid.set_local(chan_name);
iid.set_server(this->hostname);
iid.type = Iid::Type::Channel;
- this->bridge.send_muc_leave(iid, user->nick, txt, self, false);
+ this->bridge.send_muc_leave(iid, *user, txt, self, false);
channel->remove_user(user);
}
}