Open Turakar opened 4 years ago
As for now Synapse doesn't expose any method/property to obtain ProfileManager
[1] from account_handler
[2][3]. And we need ProfileManager
to change avatar.
Technicaly we can use account_handler._hs.get_profile_handler()
, but I don't think it will be acceptable PR...
It's also not clear for me now how to store avatar since ProfileManager
allows to set avatar URL only so image itself should be stored at HS somehow (so we need some more API calls).
Any Matrix devs here with some advice? Does usage of "private" account_handler._hs
is acceptable?
[1] https://github.com/matrix-org/synapse/blob/develop/synapse/handlers/profile.py#L38 [2] https://github.com/matrix-org/synapse/blob/develop/synapse/handlers/auth.py#L173 [3] https://github.com/matrix-org/synapse/blob/develop/synapse/module_api/__init__.py#L41
Any Matrix devs here with some advice? Does usage of "private"
account_handler._hs
is acceptable?
This would not be acceptable. I think we'd first need to do a PR to add the proper APIs to ModuleApi
.. If we were to do this, we should probably also support display name at the same time since most of the code will be identical?
This depends on https://github.com/matrix-org/synapse/issues/7734. While that issue mentions display names, it would presumably be trivial to also allow avatar updates too. In terms of uploading the media, we would need to consider how to work with external media repos as services like EMS do not use the Synapse media repo.
support for Avatars via the
jpegPhoto
attribute in LDAP
Definitely must have feature for such great project as Matrix!
LDAP support feels half complete, if users need to manually add their avatar.
When expect avatar support?
The upstream OIDC now has to support for avatars. While url based, it could be of inspiration? https://github.com/matrix-org/synapse/issues/9357
Project Zulip has this option and it's written in Python3. It fetches the jpegPhoto (or any explicitly determined LDAP variable) with a LDAP variable-value map (a.k.a: AUTH_LDAP_USER_ATTR_MAP), same like as the attributes block in homeserver.yaml. Please take a look. I hope it would be useful. :)
I would enjoy the support for Avatars via the
jpegPhoto
attribute in LDAP. As far as I can tell there is no discussion on this yet. The design decisions by Nextcloud might be a good starting point. What are your thoughts on this?