feat: notify mods when users are warned (#5441)

Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
This commit is contained in:
iProdigy
2024-06-06 05:13:13 -05:00
committed by GitHub
parent 248cd46eb7
commit d2316af70f
7 changed files with 90 additions and 2 deletions
+18
View File
@@ -650,6 +650,24 @@ void Application::initPubSub()
chan->addOrReplaceTimeout(msg.release());
});
});
std::ignore = this->twitchPubSub->moderation.userWarned.connect(
[&](const auto &action) {
auto chan = this->twitch->getChannelOrEmptyByID(action.roomID);
if (chan->isEmpty())
{
return;
}
// TODO: Resolve the moderator's user ID into a full user here, so message can look better
postToThread([chan, action] {
MessageBuilder msg(action);
msg->flags.set(MessageFlag::PubSub);
chan->addMessage(msg.release());
});
});
std::ignore = this->twitchPubSub->moderation.messageDeleted.connect(
[&](const auto &action) {
auto chan = this->twitch->getChannelOrEmptyByID(action.roomID);