feat: add channel for messages caught by AutoMod (#4986)

Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
This commit is contained in:
iProdigy
2023-12-03 14:07:30 -08:00
committed by GitHub
parent 812186dc4c
commit 44abe6b487
17 changed files with 107 additions and 24 deletions
+8
View File
@@ -603,6 +603,10 @@ void WindowManager::encodeChannel(IndirectChannel channel, QJsonObject &obj)
obj.insert("name", channel.get()->getName());
}
break;
case Channel::Type::TwitchAutomod: {
obj.insert("type", "automod");
}
break;
case Channel::Type::TwitchMentions: {
obj.insert("type", "mentions");
}
@@ -676,6 +680,10 @@ IndirectChannel WindowManager::decodeChannel(const SplitDescriptor &descriptor)
{
return app->twitch->liveChannel;
}
else if (descriptor.type_ == "automod")
{
return app->twitch->automodChannel;
}
else if (descriptor.type_ == "irc")
{
return Irc::instance().getOrAddChannel(descriptor.server_,
+6 -1
View File
@@ -29,6 +29,10 @@ LoggingChannel::LoggingChannel(const QString &_channelName,
{
this->subDirectory = "Live";
}
else if (channelName.startsWith("/automod"))
{
this->subDirectory = "AutoMod";
}
else
{
this->subDirectory =
@@ -96,7 +100,8 @@ void LoggingChannel::addMessage(MessagePtr message)
}
QString str;
if (channelName.startsWith("/mentions"))
if (channelName.startsWith("/mentions") ||
channelName.startsWith("/automod"))
{
str.append("#" + message->channelName + " ");
}