Automod info (#2744)
Co-authored-by: Sidd <iProdigy@users.noreply.github.com>
This commit is contained in:
@@ -133,4 +133,13 @@ struct AutomodUserAction : PubSubAction {
|
||||
QString message;
|
||||
};
|
||||
|
||||
struct AutomodInfoAction : PubSubAction {
|
||||
using PubSubAction::PubSubAction;
|
||||
enum {
|
||||
OnHold,
|
||||
Denied,
|
||||
Approved,
|
||||
} type;
|
||||
};
|
||||
|
||||
} // namespace chatterino
|
||||
|
||||
@@ -583,6 +583,27 @@ PubSub::PubSub()
|
||||
}
|
||||
};
|
||||
|
||||
this->moderationActionHandlers["automod_message_rejected"] =
|
||||
[this](const auto &data, const auto &roomID) {
|
||||
AutomodInfoAction action(data, roomID);
|
||||
action.type = AutomodInfoAction::OnHold;
|
||||
this->signals_.moderation.automodInfoMessage.invoke(action);
|
||||
};
|
||||
|
||||
this->moderationActionHandlers["automod_message_denied"] =
|
||||
[this](const auto &data, const auto &roomID) {
|
||||
AutomodInfoAction action(data, roomID);
|
||||
action.type = AutomodInfoAction::Denied;
|
||||
this->signals_.moderation.automodInfoMessage.invoke(action);
|
||||
};
|
||||
|
||||
this->moderationActionHandlers["automod_message_approved"] =
|
||||
[this](const auto &data, const auto &roomID) {
|
||||
AutomodInfoAction action(data, roomID);
|
||||
action.type = AutomodInfoAction::Approved;
|
||||
this->signals_.moderation.automodInfoMessage.invoke(action);
|
||||
};
|
||||
|
||||
this->channelTermsActionHandlers["add_permitted_term"] =
|
||||
[this](const auto &data, const auto &roomID) {
|
||||
// This term got a pass through automod
|
||||
|
||||
@@ -132,6 +132,7 @@ public:
|
||||
|
||||
Signal<AutomodAction> automodMessage;
|
||||
Signal<AutomodUserAction> automodUserMessage;
|
||||
Signal<AutomodInfoAction> automodInfoMessage;
|
||||
} moderation;
|
||||
|
||||
struct {
|
||||
|
||||
Reference in New Issue
Block a user