diff options
author | louiz’ <louiz@louiz.org> | 2016-06-08 01:32:39 +0200 |
---|---|---|
committer | louiz’ <louiz@louiz.org> | 2016-06-08 01:42:43 +0200 |
commit | 2d11a5f49454717c404b25825f18e696281207d9 (patch) | |
tree | 8e6df453d71dc75b001e59bcc061096cf41e8866 /src/irc/irc_channel.cpp | |
parent | 507d0c2cbe3c41e3d8e6d38862fe418cb551adf3 (diff) | |
download | biboumi-2d11a5f49454717c404b25825f18e696281207d9.tar.gz biboumi-2d11a5f49454717c404b25825f18e696281207d9.tar.bz2 biboumi-2d11a5f49454717c404b25825f18e696281207d9.tar.xz biboumi-2d11a5f49454717c404b25825f18e696281207d9.zip |
Support multiple nick session, except for IQs
ref #2556
Diffstat (limited to 'src/irc/irc_channel.cpp')
-rw-r--r-- | src/irc/irc_channel.cpp | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/irc/irc_channel.cpp b/src/irc/irc_channel.cpp index b1b3983..9801513 100644 --- a/src/irc/irc_channel.cpp +++ b/src/irc/irc_channel.cpp @@ -1,4 +1,5 @@ #include <irc/irc_channel.hpp> +#include <algorithm> IrcChannel::IrcChannel(): joined(false), @@ -36,15 +37,11 @@ IrcUser* IrcChannel::find_user(const std::string& name) const void IrcChannel::remove_user(const IrcUser* user) { - for (auto it = this->users.begin(); it != this->users.end(); ++it) - { - IrcUser* u = it->get(); - if (u->nick == user->nick) - { - this->users.erase(it); - break ; - } - } + this->users.erase(std::remove_if(this->users.begin(), this->users.end(), + [user](const std::unique_ptr<IrcUser>& u) + { + return user->nick == u->nick; + }), this->users.end()); } void IrcChannel::remove_all_users() |