Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: notify mods when users are warned #5441

Merged
merged 5 commits into from
Jun 6, 2024

Conversation

iProdigy
Copy link
Contributor

@iProdigy iProdigy commented Jun 6, 2024

Currently the pubsub topic only contains the moderator user id but not name, so we say A moderator did the action (which is still clickable to open their usercard based on id)

image

Related to #5439

Copy link
Member

@pajlada pajlada left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!
I made two commits

  1. Added some TODO's regarding resolving the moderators user ID to a user in the future
  2. I get the list of reasons instead of only the custom reason
    When a warning comes in over pubsub, the args list is a list where the first param is the user that was warned, second param is the free-text reason, and any param after that is one of the rules that the user broke
    User broke only one rule:
    QJsonObject({"args":["bbaper","","Pepega"],"created_at":"2024-06-06T09:37:10.457114704Z","created_by":"","created_by_user_id":"11148817","id":"WARNING__11148817__165495734__1717666630457","moderation_action":"warn","target_user_id":"165495734","target_user_login":"bbaper","type":"chat_login_moderation"})
    User broke 2 rules + a custom reason:
    QJsonObject({"args":["bbaper","custom reason xd","Pepega","Rule 2"],"created_at":"2024-06-06T09:37:05.977014158Z","created_by":"","created_by_user_id":"11148817","id":"WARNING__11148817__165495734__1717666625977","moderation_action":"warn","target_user_id":"165495734","target_user_login":"bbaper","type":"chat_login_moderation"})
    User warned only for custom reason: QJsonObject({"args":["bbaper","custom reason only"],"created_at":"2024-06-06T09:39:58.680292231Z","created_by":"","created_by_user_id":"11148817","id":"WARNING__11148817__165495734__1717666798680","moderation_action":"warn","target_user_id":"165495734","target_user_login":"bbaper","type":"chat_login_moderation"})

@pajlada pajlada enabled auto-merge (squash) June 6, 2024 09:41
@pajlada pajlada merged commit d2316af into Chatterino:master Jun 6, 2024
17 checks passed
@iProdigy iProdigy deleted the feature/mod-pubsub-warn branch June 6, 2024 16:27
@iProdigy
Copy link
Contributor Author

regarding the TODO, can subscribe to twitchdev/issues#963 to track if it's fixed on twitch's end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants