Skip to content

msglist: Use avatar URL from message object if sender is unknown to UsersStore #1556

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

Open
chrisbobbe opened this issue Jun 7, 2025 · 0 comments
Labels
a-msglist The message-list screen, except what's label:a-content
Milestone

Comments

@chrisbobbe
Copy link
Collaborator

chrisbobbe commented Jun 7, 2025

This is a sub-issue of #716. Quoting from there, for background:

For the most part the users we actually encounter will be users we do have data on: for example, a guest user still has permission to know about users that are subscribed to any of the same streams they are, which means that most of the messages they see there will be sent by users they know about. But there could be older messages by users who've since unsubscribed, and other scenarios. So we will sometimes encounter a user ID that doesn't exist in store.users.

The get-messages response contains an avatar_url field for the sender. If store.getUser gives null, that field can be used as a fallback, so we don't have to show just a blank square.

Implementation

Our AvatarUrl class has a factory AvatarUrl.fromUserData method. If that doesn't give the right behavior, perhaps it should grow a factory AvatarUrl.fromMessageData for this.

We should see about handling client_gravatar and user_avatar_url_field_optional (does the get-messages endpoint not have a param for the latter?); see:

@chrisbobbe chrisbobbe added this to the M7: Future milestone Jun 7, 2025
@chrisbobbe chrisbobbe added the a-msglist The message-list screen, except what's label:a-content label Jun 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a-msglist The message-list screen, except what's label:a-content
Projects
Status: No status
Development

No branches or pull requests

1 participant