unregister caps_slot_ on event
This commit is contained in:
parent
a9d6eb3811
commit
7cd92ececb
@ -19,12 +19,15 @@ Registration::Registration(
|
||||
|
||||
auto Registration::on_connect() -> void
|
||||
{
|
||||
auto &connection = client_->get_connection();
|
||||
|
||||
client_->list_caps();
|
||||
caps_slot_ = client_->sig_cap_ls.connect([self = shared_from_this()](auto &caps) {
|
||||
self->caps_slot_.disconnect();
|
||||
self->on_cap_list(caps);
|
||||
});
|
||||
|
||||
slot_ = client_->get_connection().sig_ircmsg.connect(
|
||||
slot_ = connection.sig_ircmsg.connect(
|
||||
[self = shared_from_this()](const auto cmd, auto &msg)
|
||||
{
|
||||
self->on_ircmsg(cmd, msg);
|
||||
@ -33,10 +36,10 @@ auto Registration::on_connect() -> void
|
||||
|
||||
if (not settings_.password.empty())
|
||||
{
|
||||
client_->get_connection().send_pass(settings_.password);
|
||||
connection.send_pass(settings_.password);
|
||||
}
|
||||
client_->get_connection().send_user(settings_.username, settings_.realname);
|
||||
client_->get_connection().send_nick(settings_.nickname);
|
||||
connection.send_user(settings_.username, settings_.realname);
|
||||
connection.send_nick(settings_.nickname);
|
||||
}
|
||||
|
||||
auto Registration::on_cap_list(const std::unordered_map<std::string, std::string> &caps) -> void
|
||||
|
Loading…
x
Reference in New Issue
Block a user