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
There is no spec-compliant way to remove remove/clear a user avatar #378
Comments
Looks like it doesn't say it, but a PUT with |
I can't seem to find the API call to set a room avatar, does it work the same way? Also, would a null value be an empty string for the property or an empty json call? Haven't worked with the API on the android client yet, just want to make sure I understand correctly. |
@dkanada not sure it will work on Android, as null serialization is not enabled by default on the Rest client |
Is there any chance to get this working then? Since only certain API calls allow a null value, it could just be enabled where necessary, like setting
|
The API endpoint would be https://matrix.org/docs/spec/client_server/r0.4.0.html#put-matrix-client-r0-profile-userid-avatar-url where the |
Actually, it looks like the spec allows one to post an empty object and achieve the same goal, it just doesn't say that. Changing this to a clarification and not an omission. |
@dkanada , |
I think the best solution for a full Rest server should be to use the DELETE method for this API: |
I didn't see too many delete calls in the client server API though, it seemed like you guys were trying to avoid them. Does the redact feature use delete for events? Regardless, would an empty object work for this purpose, or maybe just an empty string for the |
It's not that the spec tries to avoid DELETE, it's just that there's not a lot of use for it. Redacting doesn't use DELETE because redacting doesn't delete things, it redacts them which is an action. Events in matrix cannot be truly deleted. An empty object would work as per my last comment. An empty string probably wouldn't have the effect you're looking for. Groups aren't in the spec yet, but I imagine they'll have similar semantics. |
So it turns out that the avatar_url is required, and we've decided that |
In whichever case, both user and room avatar cases should be addressed; and since in case of rooms an avatar is defined by a state event, introducing a DELETE endpoint would probably lead us to the long standing question of ability to remove other state events as well. |
I just found out group names (which I think are state events) can be removed so I agree that something should definitely be added to the spec for avatars as well. |
@turt2live any update on this one? |
Element Web resets avatars by sending an empty string. |
Related: element-hq/element-android#4254 |
I think it would be useful to be able to set an avatar to null again with an event, but I don't see the option anywhere in the android client. Is it just not implemented yet on android or is it not in the spec yet?
The text was updated successfully, but these errors were encountered: