Added user display names and switched to using an avatar url directly in the homeScreen viewModel for the current user.

This commit is contained in:
Stefan Ceriu
2022-03-21 19:35:24 +02:00
parent a9c0a8f334
commit d201ca1ad8
23 changed files with 152 additions and 71 deletions
@@ -67,7 +67,16 @@ class UserSession: ClientDelegate {
do {
return try client.displayName()
} catch {
MXLog.error("Failed retrieving room info with error: \(error)")
MXLog.error("Failed retrieving the user's display name with error: \(error)")
return nil
}
}
var userAvatarURL: String? {
do {
return try client.avatarUrl()
} catch {
MXLog.error("Failed retrieving the user's avatar URL with error: \(error)")
return nil
}
}
@@ -93,7 +102,7 @@ class UserSession: ClientDelegate {
func fetchRoomList(_ completion: @escaping ([RoomProxy]) -> Void) {
DispatchQueue.global(qos: .background).async {
let rooms = self.client.conversations().map {
let rooms = self.client.rooms().map {
return RoomProxy(room: $0, messageFactory: RoomMessageFactory())
}