mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
DM Details View (#744)
* Basic implementation completed but it requires some bug fixing and polishing (+4 squashed commits) Squashed commits: [43f0064e] now the content of the room details reflects the expected dm details content when the conditions are met [fe6f2b5e] replaced existing headers with a composable and reusable HeaderView [3c00120a] now the members are fetched every time the room is opened [421d539b] refactored the members fetching to be immediate in case the room could be a direct chat * polished the code and fixed some bugs that prevented the updated state of the members to be displayed in the room details view (+1 squashed commit) Squashed commits: [6bf98473] fix for the button not being destructive in room details screen * removed copy button and updated copy * moved a file and renamed header view * addressed all PR comments * sdk bump * UI tests * unit tests * changelog * updated mocks * removed a duplicated signature in a mock
This commit is contained in:
@@ -166,6 +166,11 @@ class RoomProxyMock: RoomProxyProtocol {
|
||||
var displayName: String?
|
||||
var topic: String?
|
||||
var avatarURL: URL?
|
||||
var membersPublisher: AnyPublisher<[RoomMemberProxyProtocol], Never> {
|
||||
get { return underlyingMembersPublisher }
|
||||
set(value) { underlyingMembersPublisher = value }
|
||||
}
|
||||
var underlyingMembersPublisher: AnyPublisher<[RoomMemberProxyProtocol], Never>!
|
||||
|
||||
//MARK: - loadAvatarURLForUserId
|
||||
|
||||
@@ -410,23 +415,6 @@ class RoomProxyMock: RoomProxyProtocol {
|
||||
return reportContentReasonReturnValue
|
||||
}
|
||||
}
|
||||
//MARK: - members
|
||||
|
||||
var membersCallsCount = 0
|
||||
var membersCalled: Bool {
|
||||
return membersCallsCount > 0
|
||||
}
|
||||
var membersReturnValue: Result<[RoomMemberProxyProtocol], RoomProxyError>!
|
||||
var membersClosure: (() async -> Result<[RoomMemberProxyProtocol], RoomProxyError>)?
|
||||
|
||||
func members() async -> Result<[RoomMemberProxyProtocol], RoomProxyError> {
|
||||
membersCallsCount += 1
|
||||
if let membersClosure = membersClosure {
|
||||
return await membersClosure()
|
||||
} else {
|
||||
return membersReturnValue
|
||||
}
|
||||
}
|
||||
//MARK: - ignoreUser
|
||||
|
||||
var ignoreUserCallsCount = 0
|
||||
@@ -481,6 +469,18 @@ class RoomProxyMock: RoomProxyProtocol {
|
||||
return leaveRoomReturnValue
|
||||
}
|
||||
}
|
||||
//MARK: - updateMembers
|
||||
|
||||
var updateMembersCallsCount = 0
|
||||
var updateMembersCalled: Bool {
|
||||
return updateMembersCallsCount > 0
|
||||
}
|
||||
var updateMembersClosure: (() async -> Void)?
|
||||
|
||||
func updateMembers() async {
|
||||
updateMembersCallsCount += 1
|
||||
await updateMembersClosure?()
|
||||
}
|
||||
}
|
||||
class SessionVerificationControllerProxyMock: SessionVerificationControllerProxyProtocol {
|
||||
var callbacks: PassthroughSubject<SessionVerificationControllerProxyCallback, Never> {
|
||||
|
||||
Reference in New Issue
Block a user