feat: notify mods when users are warned (#5441)
Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
This commit is contained in:
@@ -323,6 +323,31 @@ MessageBuilder::MessageBuilder(const UnbanAction &action)
|
||||
this->message().searchText = text;
|
||||
}
|
||||
|
||||
MessageBuilder::MessageBuilder(const WarnAction &action)
|
||||
: MessageBuilder()
|
||||
{
|
||||
this->emplace<TimestampElement>();
|
||||
this->message().flags.set(MessageFlag::System);
|
||||
|
||||
QString text;
|
||||
|
||||
// TODO: Use MentionElement here, once WarnAction includes username/displayname
|
||||
this->emplaceSystemTextAndUpdate("A moderator", text)
|
||||
->setLink({Link::UserInfo, "id:" + action.source.id});
|
||||
this->emplaceSystemTextAndUpdate("warned", text);
|
||||
this->emplaceSystemTextAndUpdate(
|
||||
action.target.login + (action.reasons.isEmpty() ? "." : ":"), text)
|
||||
->setLink({Link::UserInfo, action.target.login});
|
||||
|
||||
if (!action.reasons.isEmpty())
|
||||
{
|
||||
this->emplaceSystemTextAndUpdate(action.reasons.join(", "), text);
|
||||
}
|
||||
|
||||
this->message().messageText = text;
|
||||
this->message().searchText = text;
|
||||
}
|
||||
|
||||
MessageBuilder::MessageBuilder(const AutomodUserAction &action)
|
||||
: MessageBuilder()
|
||||
{
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
namespace chatterino {
|
||||
struct BanAction;
|
||||
struct UnbanAction;
|
||||
struct WarnAction;
|
||||
struct AutomodAction;
|
||||
struct AutomodUserAction;
|
||||
struct AutomodInfoAction;
|
||||
@@ -78,6 +79,7 @@ public:
|
||||
const QTime &time = QTime::currentTime());
|
||||
MessageBuilder(const BanAction &action, uint32_t count = 1);
|
||||
MessageBuilder(const UnbanAction &action);
|
||||
MessageBuilder(const WarnAction &action);
|
||||
MessageBuilder(const AutomodUserAction &action);
|
||||
|
||||
MessageBuilder(LiveUpdatesAddEmoteMessageTag, const QString &platform,
|
||||
|
||||
Reference in New Issue
Block a user