Skip to content
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

Avoid setting avatar_url to "" #171

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

frebib
Copy link
Contributor

@frebib frebib commented Apr 30, 2024

Fixes an edge-case bug where calling set_avatar_url("") when the user doesn't have an avatar(get_avatar_url() returns None) caused a redundant PUT request to be made to nullify the already-empty avatar_url field in the user profile. This also fixes the errant $user made no change state events appearing in every room they are in when set_avatar_url("") is called.


Tested by restarting maubot with a bot configured with no avatar_url. Prior to this fix, Element would show noop state events on every restart.

Fixes an edge-case bug where calling `set_avatar_url("")` when the user
doesn't have an avatar(`get_avatar_url()` returns `None`) caused a
redundant PUT request to be made to nullify the already-empty avatar_url
field in the user profile. This also fixes the errant `$user made no
change` state events appearing in every room they are in when
`set_avatar_url("")` is called.

Signed-off-by: Joe Groocock <me@frebib.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants