-
Notifications
You must be signed in to change notification settings - Fork 4
MSC3911 AP4: Update methods for profile updates to support attaching media #94
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
Conversation
…er illustrate that it could be responding to a request directly
…e it for 'get_local_media_info_for_request()' Now we can pull this data out without having to access the MediaRepositoryStore directly.
…or checking and setting restrictions
…e media information
…tachments as query parameters
…pass it throughout for persisting per event instead of after the batch
13d8b8b to
2dc1aa2
Compare
cd18754 to
a80fe44
Compare
|
You probably want to change the target branch later, but for now this makes the review easier. :) |
synapse/rest/client/profile.py
Outdated
| SynapseError: If any of the media is inappropriate or if the requester was not | ||
| allowed to attach the media | ||
| """ | ||
| if not avatar_url or avatar_url == "": |
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.
A user is allowed to remove their avatar by setting the avatar url to "" or null.
synapse/rest/client/profile.py
Outdated
| ) | ||
|
|
||
| # Update the media restrictions to include the profile user ID | ||
| await self.hs.get_datastores().main.set_media_restrictions( |
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.
maybe this should be done in the profile_handler?
70c3520 to
59e78cd
Compare
6d8d0e8 to
5529009
Compare
|
@itsoyou , can you update this PR to resolve the merge conflicts and change the target branch? :) |
|
I am closing this since I created #97 with cherry-pick. too much work for rebase |
Linked Media MSC3911 AP4: Update methods for profile updates to support attaching media #3354
For linking media we not only have events, but also profiles, that can be queried over federation independently of events. These should also allow attaching media.
Acceptance criteria
https://spec.matrix.org/v1.4/client-server-api/#put_matrixclientv3profileuseridavatar_url should take a parameter oforg.matrix.msc3911.attach_mediato allow attaching media to a profileavatar_url, check if it's restricted and attach proper restrictionsOpen Questions
(from the ticket) We need to ensure synapse returns the right avatar over federation, otherwise this restriction is impossible to apply. That might require some digging?