-
Notifications
You must be signed in to change notification settings - Fork 742
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
[Subscribing] Blank display name #5603
Conversation
val user = tryOrNull { session.getProfile(userId) } | ||
userStore.createOrUpdate( | ||
userId = userId, | ||
displayName = user?.get(ProfileService.DISPLAY_NAME_KEY) as? String, |
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.
Maybe take the opportunity to create some helper to avoid doing that everywhere?
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.
are there other places we're using this logic, could be a function in the class for now until we have another usage?
or do you mean helpers for fun User.getDisplayName() : String?
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.
@ganfra if we add the small part in a private method in SyncTask class is enough for you ?
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 noticed a similar code in that file
We can probably have a function returning a User object from the given userId and the related profile dictionary?
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.
Yes, @Claire1817 add it to the interface ProfileService please.
Something like:
suspend fun getProfileAsUser(userId: String): User {
return getProfile(userId).let { dict ->
User(
userId = userId,
displayName = dict[DISPLAY_NAME_KEY] as? String,
avatarUrl = dict[AVATAR_URL_KEY] as? String
)
}
}
nice catch! 💯 something that was brought it up in the FTUE channel (and we might fix in the future) was to align the drawer with iOS by centering the user id when there's no display name |
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.
LGTM! will handover to @ganfra to confirm the small refactor comment
vector/src/main/java/im/vector/app/features/userdirectory/UserListViewModel.kt
Show resolved
Hide resolved
vector/src/main/java/im/vector/app/features/userdirectory/UserListViewModel.kt
Outdated
Show resolved
Hide resolved
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.
LGTM, I let someone from the core team approve your changes
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.
LGTM, thanks for the updates! 💯
Type of change
Content
Add a call to getProfile in the defaultSyncTask and store the result in the DB.
Motivation and context
#5497
Screenshots / GIFs
Tests
Tested devices
Checklist