Better way to leave the dummy room

This commit is contained in:
Florent Le Coz
2014-04-15 04:56:50 +02:00
parent 0d9c1ba313
commit 5739d418e2
5 changed files with 26 additions and 2 deletions
+11 -1
View File
@@ -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);
}