summaryrefslogtreecommitdiff
path: root/src/irc/irc_client.cpp
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2014-04-15 04:56:50 +0200
committerFlorent Le Coz <louiz@louiz.org>2014-04-15 04:56:50 +0200
commit5739d418e2b35dfc038fe1a12f8b5c7eeeed6868 (patch)
treee428fe413cf62850cb4dcda00bf1d753843177b6 /src/irc/irc_client.cpp
parent0d9c1ba31336f137202471841fd4fc7ca78a5c11 (diff)
downloadbiboumi-5739d418e2b35dfc038fe1a12f8b5c7eeeed6868.tar.gz
biboumi-5739d418e2b35dfc038fe1a12f8b5c7eeeed6868.tar.bz2
biboumi-5739d418e2b35dfc038fe1a12f8b5c7eeeed6868.tar.xz
biboumi-5739d418e2b35dfc038fe1a12f8b5c7eeeed6868.zip
Better way to leave the dummy room
Diffstat (limited to 'src/irc/irc_client.cpp')
-rw-r--r--src/irc/irc_client.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/irc/irc_client.cpp b/src/irc/irc_client.cpp
index 78acce5..f44821e 100644
--- a/src/irc/irc_client.cpp
+++ b/src/irc/irc_client.cpp
@@ -199,7 +199,7 @@ void IrcClient::send_part_command(const std::string& chan_name, const std::strin
if (channel->joined == true)
{
if (chan_name.empty())
- this->bridge->send_muc_leave(Iid(std::string("%") + this->hostname), std::string(this->current_nick), "", true);
+ this->leave_dummy_channel(status_message);
else
this->send_message(IrcMessage("PART", {chan_name, status_message}));
}
@@ -652,3 +652,13 @@ DummyIrcChannel& IrcClient::get_dummy_channel()
{
return this->dummy_channel;
}
+
+void IrcClient::leave_dummy_channel(const std::string& exit_message)
+{
+ if (!this->dummy_channel.joined)
+ return;
+ this->dummy_channel.joined = false;
+ this->dummy_channel.joining = false;
+ this->dummy_channel.remove_all_users();
+ this->bridge->send_muc_leave(Iid(std::string("%") + this->hostname), std::string(this->current_nick), exit_message, true);
+}