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
+42 -2
View File
@@ -263,7 +263,7 @@ std::shared_ptr<Channel> TwitchIrcServer::createChannel(
void TwitchIrcServer::privateMessageReceived(
Communi::IrcPrivateMessage *message)
{
IrcMessageHandler::instance().handlePrivMessage(message, *this);
IrcMessageHandler::instance().handlePrivMessage(message, *this, *this);
}
void TwitchIrcServer::readConnectionMessageReceived(
@@ -310,7 +310,7 @@ void TwitchIrcServer::readConnectionMessageReceived(
}
else if (command == "USERNOTICE")
{
handler.handleUserNoticeMessage(message, *this);
handler.handleUserNoticeMessage(message, *this, *this);
}
else if (command == "NOTICE")
{
@@ -645,16 +645,56 @@ void TwitchIrcServer::onReplySendRequested(
sent = true;
}
std::unique_ptr<BttvLiveUpdates> &TwitchIrcServer::getBTTVLiveUpdates()
{
return this->bttvLiveUpdates;
}
std::unique_ptr<SeventvEventAPI> &TwitchIrcServer::getSeventvEventAPI()
{
return this->seventvEventAPI;
}
const IndirectChannel &TwitchIrcServer::getWatchingChannel() const
{
return this->watchingChannel;
}
void TwitchIrcServer::setWatchingChannel(ChannelPtr newWatchingChannel)
{
this->watchingChannel.reset(newWatchingChannel);
}
ChannelPtr TwitchIrcServer::getWhispersChannel() const
{
return this->whispersChannel;
}
ChannelPtr TwitchIrcServer::getMentionsChannel() const
{
return this->mentionsChannel;
}
ChannelPtr TwitchIrcServer::getLiveChannel() const
{
return this->liveChannel;
}
ChannelPtr TwitchIrcServer::getAutomodChannel() const
{
return this->automodChannel;
}
QString TwitchIrcServer::getLastUserThatWhisperedMe() const
{
return this->lastUserThatWhisperedMe.get();
}
void TwitchIrcServer::setLastUserThatWhisperedMe(const QString &user)
{
this->lastUserThatWhisperedMe.set(user);
}
void TwitchIrcServer::reloadBTTVGlobalEmotes()
{
getIApp()->getBttvEmotes()->loadEmotes();