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

Add in-app notifications for moderation actions/warnings #30065

Merged
merged 3 commits into from Apr 25, 2024

Conversation

ClearlyClaire
Copy link
Contributor

@ClearlyClaire ClearlyClaire commented Apr 25, 2024

Corresponding notifications were already sent by mail but users sometimes overlook emails and miss moderation warnings.

image
image
image
image
image

API

This adds a moderation_warning notification type with a moderation_warning attribute.

These notifications have the recipient as from_account (like for lost relationships) and are never filtered.

The moderation_warning attribute is a new entity AccountWarning with the following attributes:

  • id: String
  • action: String, one of none (warning only), disable (account has been disabled), mark_statuses_as_sensitive (specific statuses have been marked as sensitive), delete_statuses (specific statuses have been removed), sensitive (the account as a whole has been marked as sensitive content), silence (the account has been limited), suspend (the account has been suspended)
  • target_account: the Account who received the warning (always the current user in this context)
  • appeal: Appeal entity, optional
  • status_ids: Array of String, the identifier of the (possibly deleted) statuses

The new Appeal entity has the following attributes:

  • text: String, the text from the current user appealing the moderation action
  • state: String, one of approved, rejected or pending

TODO

  • improve tests
  • add documentation

Fixes MAS-218

@ClearlyClaire ClearlyClaire added api REST API, Streaming API, Web Push API ui Front-end, design labels Apr 25, 2024
@ClearlyClaire ClearlyClaire force-pushed the features/moderation-notifications branch from 06d4d3a to e731ddf Compare April 25, 2024 15:48
@ClearlyClaire ClearlyClaire force-pushed the features/moderation-notifications branch from e731ddf to b9ebb01 Compare April 25, 2024 16:01
@ClearlyClaire ClearlyClaire marked this pull request as ready for review April 25, 2024 16:12
@ClearlyClaire ClearlyClaire requested a review from a team April 25, 2024 16:12
@Gargron Gargron added this pull request to the merge queue Apr 25, 2024
Merged via the queue into main with commit 4ef0b48 Apr 25, 2024
56 checks passed
@Gargron Gargron deleted the features/moderation-notifications branch April 25, 2024 17:31
@renchap
Copy link
Sponsor Member

renchap commented Apr 25, 2024

This will need a docs update I think

@kmycode
Copy link
Contributor

kmycode commented Apr 26, 2024

The from_account property in REST::NotificationSerializer notifies the target user of the account of the moderator who made the warning, is this the intended specification?

@ClearlyClaire
Copy link
Contributor Author

The from_account property in REST::NotificationSerializer notifies the target user of the account of the moderator who made the warning, is this the intended specification?

No, it's supposed to be set to the recipient's account, as described in the post:

These notifications have the recipient as from_account (like for lost relationships) and are never filtered.

But double-checking the code, you are right and it is not what actually happens. Going to address that.

zeitschlag added a commit to mastodon/mastodon-ios that referenced this pull request May 7, 2024
Details see mastodon/mastodon#30065 for now, as there's no documentation (yet)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api REST API, Streaming API, Web Push API ui Front-end, design
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants