Support multiple nick session, except for IQs

ref #2556
This commit is contained in:
louiz’
2016-06-08 01:42:43 +02:00
parent 507d0c2cbe
commit 2d11a5f494
8 changed files with 118 additions and 59 deletions
+6 -9
View File
@@ -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()