ammend 2.1.5 added setting for experimental irc support

This commit is contained in:
fourtf 2019-09-22 17:12:09 +02:00
parent 2c25c8a5f5
commit ca0db97d09
4 changed files with 35 additions and 26 deletions

View file

@ -66,29 +66,30 @@ void IrcServer::initializeConnection(IrcConnection *connection,
connection->setRealName(this->data_->real.isEmpty() ? this->data_->user
: this->data_->nick);
#if 0
switch (this->data_->authType)
if (getSettings()->enableExperimentalIrc)
{
case IrcAuthType::Sasl:
connection->setSaslMechanism("PLAIN");
[[fallthrough]];
case 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);
}
switch (this->data_->authType)
{
case IrcAuthType::Sasl:
connection->setSaslMechanism("PLAIN");
[[fallthrough]];
case 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;
});
break;
default:
this->open(Both);
delete conn;
});
break;
default:
this->open(Both);
}
}
#endif
QObject::connect(
connection, &Communi::IrcConnection::socketError, this,

View file

@ -203,6 +203,7 @@ public:
#ifdef Q_OS_LINUX
BoolSetting useKeyring = {"/misc/useKeyring", true};
#endif
BoolSetting enableExperimentalIrc = {"/misc/experimentalIrc", false};
IntSetting startUpNotification = {"/misc/startUpNotification", 0};
QStringSetting currentVersion = {"/misc/currentVersion", ""};

View file

@ -190,8 +190,12 @@ SelectChannelDialog::SelectChannelDialog(QWidget *parent)
auto tab = notebook->addPage(obj.getElement());
tab->setCustomTitle("Irc (Beta)");
tab->setEnable(false);
tab->setVisible(false);
if (!getSettings()->enableExperimentalIrc)
{
tab->setEnable(false);
tab->setVisible(false);
}
}
layout->setStretchFactor(notebook.getElement(), 1);
@ -220,9 +224,10 @@ SelectChannelDialog::SelectChannelDialog(QWidget *parent)
// restore ui state
// fourtf: enable when releasing irc
#if 0
this->ui_.notebook->selectIndex(getSettings()->lastSelectChannelTab);
#endif
if (getSettings()->enableExperimentalIrc)
{
this->ui_.notebook->selectIndex(getSettings()->lastSelectChannelTab);
}
this->ui_.irc.servers->getTableView()->selectRow(
getSettings()->lastSelectIrcConn);

View file

@ -497,7 +497,9 @@ void GeneralPage::initLayout(SettingsLayout &layout)
layout.addCheckbox("Load message history on connect",
s.loadTwitchMessageHistoryOnConnect);
layout.addCheckbox("Show unhandled irc messages",
layout.addCheckbox("Enable experimental IRC support (requires restart)",
s.enableExperimentalIrc);
layout.addCheckbox("Show unhandled IRC messages",
s.showUnhandledIrcMessages);
layout.addTitle("Cache");