mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 12:07:55 +00:00
Use the space room name computed by the SDK. (#4589)
This commit is contained in:
@@ -16,7 +16,8 @@ class SpaceRoomProxy: SpaceRoomProxyProtocol {
|
||||
}
|
||||
|
||||
lazy var id = spaceRoom.roomId
|
||||
var name: String? { spaceRoom.displayName }
|
||||
var name: String { spaceRoom.displayName }
|
||||
var rawName: String? { spaceRoom.rawName }
|
||||
var avatarURL: URL? { spaceRoom.avatarUrl.flatMap(URL.init) }
|
||||
|
||||
var isSpace: Bool { spaceRoom.roomType == .space }
|
||||
|
||||
@@ -18,7 +18,8 @@ enum SpaceRoomProxyVisibility: Equatable {
|
||||
// sourcery: AutoMockable
|
||||
protocol SpaceRoomProxyProtocol {
|
||||
var id: String { get }
|
||||
var name: String? { get }
|
||||
var name: String { get }
|
||||
var rawName: String? { get }
|
||||
var avatarURL: URL? { get }
|
||||
|
||||
var isSpace: Bool { get }
|
||||
@@ -48,14 +49,6 @@ extension SpaceRoomProxyProtocol {
|
||||
}
|
||||
}
|
||||
|
||||
var computedName: String {
|
||||
if !isSpace, isDirect == true, name == nil, heroes.count == 1, let dmRecipient = heroes.first {
|
||||
dmRecipient.displayName ?? dmRecipient.id
|
||||
} else {
|
||||
name ?? canonicalAlias ?? id
|
||||
}
|
||||
}
|
||||
|
||||
var visibility: SpaceRoomProxyVisibility? {
|
||||
switch joinRule {
|
||||
case .public:
|
||||
|
||||
Reference in New Issue
Block a user