summaryrefslogtreecommitdiff
path: root/src/bridge/bridge.cpp
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2014-02-20 02:19:50 +0100
committerFlorent Le Coz <louiz@louiz.org>2014-02-20 02:19:50 +0100
commit190c4ff1762e5e762e913f98033369ed75ed5291 (patch)
tree622383f469eac0904465e3ac53dd5b5ae5b1bcd5 /src/bridge/bridge.cpp
parente390b79a12a150b13570f7f0b19f50e1b0ead3a0 (diff)
downloadbiboumi-190c4ff1762e5e762e913f98033369ed75ed5291.tar.gz
biboumi-190c4ff1762e5e762e913f98033369ed75ed5291.tar.bz2
biboumi-190c4ff1762e5e762e913f98033369ed75ed5291.tar.xz
biboumi-190c4ff1762e5e762e913f98033369ed75ed5291.zip
QUIT the irc server when the last channel is left
Diffstat (limited to 'src/bridge/bridge.cpp')
-rw-r--r--src/bridge/bridge.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/bridge/bridge.cpp b/src/bridge/bridge.cpp
index 6460e6b..5122a69 100644
--- a/src/bridge/bridge.cpp
+++ b/src/bridge/bridge.cpp
@@ -42,7 +42,7 @@ void Bridge::shutdown()
{
for (auto it = this->irc_clients.begin(); it != this->irc_clients.end(); ++it)
{
- it->second->send_quit_command();
+ it->second->send_quit_command("Gateway shutdown");
}
}
@@ -193,6 +193,9 @@ void Bridge::send_message(const Iid& iid, const std::string& nick, const std::st
void Bridge::send_muc_leave(Iid&& iid, std::string&& nick, const std::string& message, const bool self)
{
this->xmpp->send_muc_leave(std::move(iid.chan) + "%" + std::move(iid.server), std::move(nick), this->make_xmpp_body(message), this->user_jid, self);
+ IrcClient* irc = this->get_irc_client(iid.server);
+ if (irc && irc->number_of_joined_channels() == 0)
+ irc->send_quit_command("");
}
void Bridge::send_nick_change(Iid&& iid,