chore: refactor TwitchIrcServer (#5421)
This commit is contained in:
@@ -375,35 +375,33 @@ IndirectChannel SelectChannelDialog::getSelectedChannel() const
|
||||
return this->selectedChannel_;
|
||||
}
|
||||
|
||||
auto *app = getApp();
|
||||
|
||||
switch (this->ui_.notebook->getSelectedIndex())
|
||||
{
|
||||
case TAB_TWITCH: {
|
||||
if (this->ui_.twitch.channel->isChecked())
|
||||
{
|
||||
return app->twitch->getOrAddChannel(
|
||||
return getIApp()->getTwitchAbstract()->getOrAddChannel(
|
||||
this->ui_.twitch.channelName->text().trimmed());
|
||||
}
|
||||
else if (this->ui_.twitch.watching->isChecked())
|
||||
{
|
||||
return app->twitch->watchingChannel;
|
||||
return getIApp()->getTwitch()->getWatchingChannel();
|
||||
}
|
||||
else if (this->ui_.twitch.mentions->isChecked())
|
||||
{
|
||||
return app->twitch->mentionsChannel;
|
||||
return getIApp()->getTwitch()->getMentionsChannel();
|
||||
}
|
||||
else if (this->ui_.twitch.whispers->isChecked())
|
||||
{
|
||||
return app->twitch->whispersChannel;
|
||||
return getIApp()->getTwitch()->getWhispersChannel();
|
||||
}
|
||||
else if (this->ui_.twitch.live->isChecked())
|
||||
{
|
||||
return app->twitch->liveChannel;
|
||||
return getIApp()->getTwitch()->getLiveChannel();
|
||||
}
|
||||
else if (this->ui_.twitch.automod->isChecked())
|
||||
{
|
||||
return app->twitch->automodChannel;
|
||||
return getIApp()->getTwitch()->getAutomodChannel();
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -298,21 +298,23 @@ UserInfoPopup::UserInfoPopup(bool closeAutomatically, Split *split)
|
||||
menu->addAction(
|
||||
"Open channel in a new popup window", this,
|
||||
[loginName] {
|
||||
auto *app = getApp();
|
||||
auto *app = getIApp();
|
||||
auto &window = app->getWindows()->createWindow(
|
||||
WindowType::Popup, true);
|
||||
auto *split = window.getNotebook()
|
||||
.getOrAddSelectedPage()
|
||||
->appendNewSplit(false);
|
||||
split->setChannel(app->twitch->getOrAddChannel(
|
||||
loginName.toLower()));
|
||||
split->setChannel(
|
||||
app->getTwitchAbstract()->getOrAddChannel(
|
||||
loginName.toLower()));
|
||||
});
|
||||
|
||||
menu->addAction(
|
||||
"Open channel in a new tab", this, [loginName] {
|
||||
ChannelPtr channel =
|
||||
getApp()->twitch->getOrAddChannel(
|
||||
loginName);
|
||||
getIApp()
|
||||
->getTwitchAbstract()
|
||||
->getOrAddChannel(loginName);
|
||||
auto &nb = getApp()
|
||||
->getWindows()
|
||||
->getMainWindow()
|
||||
|
||||
@@ -21,7 +21,8 @@ NewPopupItem::NewPopupItem(const QString &channelName)
|
||||
|
||||
void NewPopupItem::action()
|
||||
{
|
||||
auto channel = getApp()->twitch->getOrAddChannel(this->channelName_);
|
||||
auto channel =
|
||||
getIApp()->getTwitchAbstract()->getOrAddChannel(this->channelName_);
|
||||
getIApp()->getWindows()->openInPopup(channel);
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,8 @@ void NewTabItem::action()
|
||||
SplitContainer *container = nb.addPage(true);
|
||||
|
||||
Split *split = new Split(container);
|
||||
split->setChannel(getApp()->twitch->getOrAddChannel(this->channelName_));
|
||||
split->setChannel(
|
||||
getIApp()->getTwitchAbstract()->getOrAddChannel(this->channelName_));
|
||||
container->insertSplit(split);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user