added irc authentificate type

This commit is contained in:
fourtf
2019-09-15 11:35:17 +02:00
parent 9bbc4f8a5e
commit 2a56cef848
5 changed files with 49 additions and 33 deletions
+17 -10
View File
@@ -63,17 +63,24 @@ void IrcServer::initializeConnection(IrcConnection *connection,
connection->setRealName(this->data_->real.isEmpty() ? this->data_->user
: this->data_->nick);
this->data_->getPassword(
this, [conn = new QObjectRef(connection) /* can't copy */,
this](const QString &password) mutable {
if (*conn)
{
(*conn)->setPassword(password);
this->open(Both);
}
if (this->data_->authType == IrcAuthType::Pass)
{
this->data_->getPassword(
this, [conn = new QObjectRef(connection) /* can't copy */,
this](const QString &password) mutable {
if (*conn)
{
(*conn)->setPassword(password);
this->open(Both);
}
delete conn;
});
delete conn;
});
}
else
{
this->open(Both);
}
}
std::shared_ptr<Channel> IrcServer::createChannel(const QString &channelName)