mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 01:20:12 +00:00
Display whether a call is ongoing in any particular room on the room list
This commit is contained in:
committed by
Stefan Ceriu
parent
2e1b4cb80b
commit
5c4e0bd76d
@@ -151,7 +151,7 @@ class RoomProxy: RoomProxyProtocol {
|
||||
room.isTombstoned()
|
||||
}
|
||||
|
||||
var isCallOngoing: Bool {
|
||||
var hasOngoingCall: Bool {
|
||||
room.hasActiveRoomCall()
|
||||
}
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ protocol RoomProxyProtocol {
|
||||
var isSpace: Bool { get }
|
||||
var isEncrypted: Bool { get }
|
||||
var isTombstoned: Bool { get }
|
||||
var isCallOngoing: Bool { get }
|
||||
var hasOngoingCall: Bool { get }
|
||||
var canonicalAlias: String? { get }
|
||||
var alternativeAliases: [String] { get }
|
||||
var hasUnreadNotifications: Bool { get }
|
||||
|
||||
@@ -85,7 +85,8 @@ extension Array where Element == RoomSummary {
|
||||
unreadNotificationCount: 4,
|
||||
notificationMode: .allMessages,
|
||||
canonicalAlias: nil,
|
||||
inviter: RoomMemberProxyMock.mockCharlie)),
|
||||
inviter: RoomMemberProxyMock.mockCharlie,
|
||||
hasOngoingCall: true)),
|
||||
.filled(details: RoomSummaryDetails(id: "2",
|
||||
name: "Second room",
|
||||
isDirect: true,
|
||||
@@ -95,7 +96,8 @@ extension Array where Element == RoomSummary {
|
||||
unreadNotificationCount: 1,
|
||||
notificationMode: .mentionsAndKeywordsOnly,
|
||||
canonicalAlias: nil,
|
||||
inviter: RoomMemberProxyMock.mockCharlie)),
|
||||
inviter: RoomMemberProxyMock.mockCharlie,
|
||||
hasOngoingCall: false)),
|
||||
.filled(details: RoomSummaryDetails(id: "3",
|
||||
name: "Third room",
|
||||
isDirect: true,
|
||||
@@ -105,7 +107,8 @@ extension Array where Element == RoomSummary {
|
||||
unreadNotificationCount: 0,
|
||||
notificationMode: .mute,
|
||||
canonicalAlias: nil,
|
||||
inviter: RoomMemberProxyMock.mockCharlie)),
|
||||
inviter: RoomMemberProxyMock.mockCharlie,
|
||||
hasOngoingCall: false)),
|
||||
.empty
|
||||
]
|
||||
|
||||
@@ -118,7 +121,8 @@ extension Array where Element == RoomSummary {
|
||||
unreadNotificationCount: 0,
|
||||
notificationMode: nil,
|
||||
canonicalAlias: "#footest:somewhere.org",
|
||||
inviter: RoomMemberProxyMock.mockCharlie)),
|
||||
inviter: RoomMemberProxyMock.mockCharlie,
|
||||
hasOngoingCall: false)),
|
||||
.filled(details: RoomSummaryDetails(id: "someAwesomeRoomId2",
|
||||
name: "Second room",
|
||||
isDirect: true,
|
||||
@@ -128,6 +132,7 @@ extension Array where Element == RoomSummary {
|
||||
unreadNotificationCount: 0,
|
||||
notificationMode: nil,
|
||||
canonicalAlias: nil,
|
||||
inviter: RoomMemberProxyMock.mockCharlie))
|
||||
inviter: RoomMemberProxyMock.mockCharlie,
|
||||
hasOngoingCall: false))
|
||||
]
|
||||
}
|
||||
|
||||
@@ -28,6 +28,7 @@ struct RoomSummaryDetails {
|
||||
let notificationMode: RoomNotificationModeProxy?
|
||||
let canonicalAlias: String?
|
||||
let inviter: RoomMemberProxyProtocol?
|
||||
let hasOngoingCall: Bool
|
||||
}
|
||||
|
||||
extension RoomSummaryDetails: CustomStringConvertible {
|
||||
|
||||
@@ -248,7 +248,8 @@ class RoomSummaryProvider: RoomSummaryProviderProtocol {
|
||||
unreadNotificationCount: UInt(roomInfo.notificationCount),
|
||||
notificationMode: notificationMode,
|
||||
canonicalAlias: roomInfo.canonicalAlias,
|
||||
inviter: inviterProxy)
|
||||
inviter: inviterProxy,
|
||||
hasOngoingCall: roomInfo.hasRoomCall)
|
||||
|
||||
return invalidated ? .invalidated(details: details) : .filled(details: details)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user