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()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user