Skip to content

Federate private message reports (fixes #4436)#6557

Merged
dessalines merged 4 commits into
mainfrom
federate-pm-reports
Jun 2, 2026
Merged

Federate private message reports (fixes #4436)#6557
dessalines merged 4 commits into
mainfrom
federate-pm-reports

Conversation

@Nutomic
Copy link
Copy Markdown
Member

@Nutomic Nutomic commented Jun 1, 2026

I remember trying this in the past and being unable to make it work, but now it seems really straightforward.

@Nutomic Nutomic force-pushed the federate-pm-reports branch from 383a367 to c626756 Compare June 1, 2026 14:18
@Nutomic Nutomic force-pushed the federate-pm-reports branch from f148b84 to cc37cd9 Compare June 1, 2026 14:27
@TheHrdlicka
Copy link
Copy Markdown

Hello, would it be please possible to bump this issue? The instance I'm using is currently considering to implement an active monitoring and moderation of (some) user DMs to solve the problem, because they have ran into problems caused by reports not being propagated and someone using our instance to actively harrass and send death threats to users on other instances, which was missed because of reports not getting to them.

While I understand that ActivityPub DMs are basically public, and I don't really mind moderation, the phrase "This instance is reading your DMs" will be a PR disaster, plus in general combating spam and harrasment is important - being able to ban users at their source instance before they can harrass more people is IMO serious issue to solve, especially since the PR seems to be ready for review.

Thank you for all the work you're doing!

Comment thread api_tests/src/private_message.spec.ts Outdated
() => listReports(alpha),
r => r.items.length === 1,
);
const r = list_reports.items[0] as PrivateMessageReportView;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This as casting looks dangerous. Its not even being done on .data

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

What do you mean by dangerous? Worst case the test will fail. And there is no .data here.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ah I forgot items is the data for paged_responses.

pub type SearchableObjects = Either<Either<PostOrComment, UserOrCommunity>, ApubMultiCommunity>;

pub type ReportableObjects = Either<PostOrComment, ApubCommunity>;
pub type ReportableObjects = Either<PostOrComment, Either<ApubCommunity, ApubPrivateMessage>>;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I know this is outside the scope of this PR, but there has to be a better way than doing these either chains.

Why can't an enum for the different possible types work?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Thats not possible, Either only works because the Activitypub library implements Object for Either. To make it work with arbitrary enums would require a derive macro for Object.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why not just make sure your apub types impl that Object trait directly. And define enums that extend that trait.

@Nutomic Nutomic force-pushed the federate-pm-reports branch from b0eabb8 to d1b72ec Compare June 2, 2026 09:48
@dessalines dessalines merged commit 59a6164 into main Jun 2, 2026
2 checks passed
@dessalines dessalines deleted the federate-pm-reports branch June 2, 2026 14:30
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.

3 participants