summaryrefslogtreecommitdiff
path: root/src/bridge/bridge.cpp
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2013-12-27 12:01:26 +0100
committerFlorent Le Coz <louiz@louiz.org>2014-01-04 01:59:35 +0100
commite8e592d1ace5413a1e7d8b59b9467c78d8d68ea9 (patch)
tree5652ccbca535cffa442a1a13729e4ac93ba4dfe2 /src/bridge/bridge.cpp
parentaa53276859a5fc80071d24111a311297e058e603 (diff)
downloadbiboumi-e8e592d1ace5413a1e7d8b59b9467c78d8d68ea9.tar.gz
biboumi-e8e592d1ace5413a1e7d8b59b9467c78d8d68ea9.tar.bz2
biboumi-e8e592d1ace5413a1e7d8b59b9467c78d8d68ea9.tar.xz
biboumi-e8e592d1ace5413a1e7d8b59b9467c78d8d68ea9.zip
Remove disconnected IrcClients
Diffstat (limited to 'src/bridge/bridge.cpp')
-rw-r--r--src/bridge/bridge.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/bridge/bridge.cpp b/src/bridge/bridge.cpp
index 3a755a3..c93d710 100644
--- a/src/bridge/bridge.cpp
+++ b/src/bridge/bridge.cpp
@@ -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;