Remove disconnected IrcClients

This commit is contained in:
Florent Le Coz
2014-01-04 01:59:35 +01:00
parent aa53276859
commit e8e592d1ac
6 changed files with 41 additions and 3 deletions
+13
View File
@@ -29,6 +29,19 @@ void Bridge::shutdown()
}
}
void Bridge::clean()
{
auto it = this->irc_clients.begin();
while (it != this->irc_clients.end())
{
IrcClient* client = it->second.get();
if (!client->is_connected())
it = this->irc_clients.erase(it);
else
++it;
}
}
Xmpp::body Bridge::make_xmpp_body(const std::string& str)
{
std::string res;