diff options
author | louiz’ <louiz@louiz.org> | 2018-03-12 00:04:26 +0100 |
---|---|---|
committer | louiz’ <louiz@louiz.org> | 2018-03-12 00:13:59 +0100 |
commit | bb596582bd2d8b9aab3fe08e76a7d24d82bf614a (patch) | |
tree | 9ebe416dfb7b9b2dd6c6a4ba4b56a69b7c455456 /src/irc/irc_channel.cpp | |
parent | 158d743bf539399e48c64044639b90e5c1705ac1 (diff) | |
download | biboumi-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_channel.cpp')
-rw-r--r-- | src/irc/irc_channel.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/irc/irc_channel.cpp b/src/irc/irc_channel.cpp index 1fd34aa..58f8d5c 100644 --- a/src/irc/irc_channel.cpp +++ b/src/irc/irc_channel.cpp @@ -33,8 +33,9 @@ IrcUser* IrcChannel::find_user(const std::string& name) const return nullptr; } -void IrcChannel::remove_user(const IrcUser* user) +std::unique_ptr<IrcUser> IrcChannel::remove_user(const IrcUser* user) { + std::unique_ptr<IrcUser> result{}; const auto nick = user->nick; const bool is_self = (user == this->self); const auto it = std::find_if(this->users.begin(), this->users.end(), @@ -44,6 +45,7 @@ void IrcChannel::remove_user(const IrcUser* user) }); if (it != this->users.end()) { + result = std::move(*it); this->users.erase(it); if (is_self) { @@ -57,4 +59,5 @@ void IrcChannel::remove_all_users() { this->users.clear(); this->self = nullptr; + return result; } |