Commit 1997fb5c authored by louiz’'s avatar louiz’

Small refactor in on_quit()

parent c23c99da
...@@ -1017,19 +1017,17 @@ void IrcClient::on_quit(const IrcMessage& message) ...@@ -1017,19 +1017,17 @@ void IrcClient::on_quit(const IrcMessage& message)
const std::string& chan_name = pair.first; const std::string& chan_name = pair.first;
IrcChannel* channel = pair.second.get(); IrcChannel* channel = pair.second.get();
const IrcUser* user = channel->find_user(message.prefix); const IrcUser* user = channel->find_user(message.prefix);
if (!user)
continue;
bool self = false; bool self = false;
if (user == channel->get_self()) if (user == channel->get_self())
self = true; self = true;
if (user) Iid iid;
{ iid.set_local(chan_name);
std::string nick = user->nick; iid.set_server(this->hostname);
channel->remove_user(user); iid.type = Iid::Type::Channel;
Iid iid; this->bridge.send_muc_leave(iid, user->nick, txt, self, false);
iid.set_local(chan_name); channel->remove_user(user);
iid.set_server(this->hostname);
iid.type = Iid::Type::Channel;
this->bridge.send_muc_leave(iid, std::move(nick), txt, self, false);
}
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment