Redacting is now displayed for moderators in groups (#1324)

* basic implementation

* sdk update

* format

* changelog
This commit is contained in:
Mauro
2023-07-18 15:51:27 +02:00
committed by GitHub
parent 55892eb05b
commit 19ecf906e3
5 changed files with 62 additions and 3 deletions
@@ -718,6 +718,11 @@ class RoomProxyMock: RoomProxyProtocol {
set(value) { underlyingHasUnreadNotifications = value }
}
var underlyingHasUnreadNotifications: Bool!
var ownUserID: String {
get { return underlyingOwnUserID }
set(value) { underlyingOwnUserID = value }
}
var underlyingOwnUserID: String!
var name: String?
var displayName: String?
var topic: String?
@@ -1360,6 +1365,27 @@ class RoomProxyMock: RoomProxyProtocol {
return uploadAvatarMediaReturnValue
}
}
//MARK: - canUserRedact
var canUserRedactUserIDCallsCount = 0
var canUserRedactUserIDCalled: Bool {
return canUserRedactUserIDCallsCount > 0
}
var canUserRedactUserIDReceivedUserID: String?
var canUserRedactUserIDReceivedInvocations: [String] = []
var canUserRedactUserIDReturnValue: Result<Bool, RoomProxyError>!
var canUserRedactUserIDClosure: ((String) async -> Result<Bool, RoomProxyError>)?
func canUserRedact(userID: String) async -> Result<Bool, RoomProxyError> {
canUserRedactUserIDCallsCount += 1
canUserRedactUserIDReceivedUserID = userID
canUserRedactUserIDReceivedInvocations.append(userID)
if let canUserRedactUserIDClosure = canUserRedactUserIDClosure {
return await canUserRedactUserIDClosure(userID)
} else {
return canUserRedactUserIDReturnValue
}
}
}
class RoomTimelineProviderMock: RoomTimelineProviderProtocol {
var updatePublisher: AnyPublisher<TimelineProviderUpdate, Never> {