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;
+4 -1
View File
@@ -28,7 +28,10 @@ public:
* QUIT all connected IRC servers.
*/
void shutdown();
/**
* Remove all inactive IrcClients
*/
void clean();
static Xmpp::body make_xmpp_body(const std::string& str);
/***
**