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

Federate reports #3188

Open
wants to merge 22 commits into
base: main
Choose a base branch
from
Open

Federate reports #3188

wants to merge 22 commits into from

Conversation

mouse-reeve
Copy link
Member

@mouse-reeve mouse-reeve commented Jan 3, 2024

Reports should be sent (if the user wants) to the home instance for remote users. I'm using mastodon's Flag activity as a template: https://docs.joinmastodon.org/spec/activitypub/#Flag

Fixes #962

Components:

  • Fix the report model so that user means the user doing the reporting, not the reported user
  • Make the report model activitypub-y
    • Produce the easy parts of the activitypub object
    • Get the "objects" part of the Flag activity in place
  • Allow users to opt out of federating reports
  • Broadcast reports
  • Receive broadcasted reports
  • Test between bookwyrm instances
  • Test between bookwyrm and mastodon instances

@mouse-reeve mouse-reeve marked this pull request as ready for review August 24, 2024 23:54
def object(self):
"""Generate a list of reported objects in a format Mastodon will like"""
items = [self.reported_user.remote_id]
if self.statuses:
Copy link
Contributor

Choose a reason for hiding this comment

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

When I test this self.statuses is always bookwyrm.Status.None here. So the status is never sent to Mastodon. However statuses obviously isn't empty because in the BookWyrm admin interface I can see it. So I have no idea what is going on but it's weird and means statuses aren't passed through to federated servers with the report.

blank=True,
activitypub_field="to",
)
statuses = models.ManyToManyField(
"Status",
null=True,
Copy link
Contributor

Choose a reason for hiding this comment

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

No need to set null on a ManyToManyField.

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.

Reports should create Flag activities
2 participants