-
Notifications
You must be signed in to change notification settings - Fork 186
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
Implement MSC4133 to support custom profile fields. #17488
base: develop
Are you sure you want to change the base?
Conversation
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 few comments, but this is definitely on the right track. Thanks for implementing this!
synapse/handlers/profile.py
Outdated
"displayname": profileinfo.display_name, | ||
"avatar_url": profileinfo.avatar_url, | ||
} | ||
# TODO Should this strip out empty values? |
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.
I would think not - that could result in users having fields stay around forever in the DB, yet never visible to users.
@@ -813,7 +813,7 @@ def is_allowed_mime_type(content_type: str) -> bool: | |||
|
|||
# bail if user already has the same avatar | |||
profile = await self._profile_handler.get_profile(user_id) | |||
if profile["avatar_url"] is not None: | |||
if "avatar_url" in profile: |
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.
Do we still need to check whether profile["avatar_url"]
is None
before attempting to .split
on it?
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.
I suspect I need to split this to a separate PR to make it clear what the change is.
synapse/storage/schema/main/delta/86/01_custom_profile_fields.sql
Outdated
Show resolved
Hide resolved
Co-authored-by: Andrew Morgan <[email protected]>
Co-authored-by: Andrew Morgan <[email protected]>
Co-authored-by: Andrew Morgan <[email protected]>
I pushed some changes to update / flesh out the rest of the MSC, but I haven't yet gone through @anoadragon453's comments so not worth another review yet. (If folks want to test it that would be reasonable...I'm sure it'll break.) |
I think this is close to ready for another review. There's a few open questions on the MSC that will affect this still. |
Implementation of MSC4133 to support custom profile fields. It is behind an experimental flag and includes tests.
Pull Request Checklist
EventStore
toEventWorkerStore
.".code blocks
.(run the linters)