-
-
Notifications
You must be signed in to change notification settings - Fork 953
Federate private message reports (fixes #4436) #6557
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
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,6 +7,7 @@ pub mod person; | |
| pub mod post; | ||
| pub mod private_message; | ||
|
|
||
| use crate::objects::private_message::ApubPrivateMessage; | ||
| use comment::ApubComment; | ||
| use community::ApubCommunity; | ||
| use either::Either; | ||
|
|
@@ -21,7 +22,7 @@ pub type PostOrComment = Either<ApubPost, ApubComment>; | |
|
|
||
| pub type SearchableObjects = Either<Either<PostOrComment, UserOrCommunity>, ApubMultiCommunity>; | ||
|
|
||
| pub type ReportableObjects = Either<PostOrComment, ApubCommunity>; | ||
| pub type ReportableObjects = Either<PostOrComment, Either<ApubCommunity, ApubPrivateMessage>>; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thats not possible,
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not just make sure your apub types impl that |
||
|
|
||
| pub type UserOrCommunity = Either<ApubPerson, ApubCommunity>; | ||
|
|
||
|
|
||
There was a problem hiding this comment.
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
.dataThere was a problem hiding this comment.
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
.datahere.There was a problem hiding this comment.
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.