chore: refactor TwitchIrcServer (#5421)

This commit is contained in:
pajlada
2024-06-01 14:56:40 +02:00
committed by GitHub
parent 2a46ee708e
commit b6dc5d9e03
28 changed files with 373 additions and 163 deletions
+6 -8
View File
@@ -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;