mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
@room in user suggestions (#1880)
* for now I am using a local RTE solution, need to fix one test * fixed a test * new rte version * pr suggestions * @room added to the suggestions * removed empty space * revert * code improvement * project updated * package
This commit is contained in:
@@ -1749,6 +1749,27 @@ class RoomProxyMock: RoomProxyProtocol {
|
||||
return canUserRedactUserIDReturnValue
|
||||
}
|
||||
}
|
||||
//MARK: - canUserTriggerRoomNotification
|
||||
|
||||
var canUserTriggerRoomNotificationUserIDCallsCount = 0
|
||||
var canUserTriggerRoomNotificationUserIDCalled: Bool {
|
||||
return canUserTriggerRoomNotificationUserIDCallsCount > 0
|
||||
}
|
||||
var canUserTriggerRoomNotificationUserIDReceivedUserID: String?
|
||||
var canUserTriggerRoomNotificationUserIDReceivedInvocations: [String] = []
|
||||
var canUserTriggerRoomNotificationUserIDReturnValue: Result<Bool, RoomProxyError>!
|
||||
var canUserTriggerRoomNotificationUserIDClosure: ((String) async -> Result<Bool, RoomProxyError>)?
|
||||
|
||||
func canUserTriggerRoomNotification(userID: String) async -> Result<Bool, RoomProxyError> {
|
||||
canUserTriggerRoomNotificationUserIDCallsCount += 1
|
||||
canUserTriggerRoomNotificationUserIDReceivedUserID = userID
|
||||
canUserTriggerRoomNotificationUserIDReceivedInvocations.append(userID)
|
||||
if let canUserTriggerRoomNotificationUserIDClosure = canUserTriggerRoomNotificationUserIDClosure {
|
||||
return await canUserTriggerRoomNotificationUserIDClosure(userID)
|
||||
} else {
|
||||
return canUserTriggerRoomNotificationUserIDReturnValue
|
||||
}
|
||||
}
|
||||
//MARK: - createPoll
|
||||
|
||||
var createPollQuestionAnswersPollKindCallsCount = 0
|
||||
|
||||
@@ -35,6 +35,7 @@ struct RoomProxyMockConfiguration {
|
||||
var inviter: RoomMemberProxyMock?
|
||||
var memberForID: RoomMemberProxyMock = .mockMe
|
||||
var ownUserID = "@alice:somewhere.org"
|
||||
var canUserTriggerRoomNotification = false
|
||||
|
||||
var invitedMembersCount = 100
|
||||
var joinedMembersCount = 50
|
||||
@@ -81,5 +82,6 @@ extension RoomProxyMock {
|
||||
setTopicClosure = { _ in .success(()) }
|
||||
getMemberUserIDReturnValue = .success(configuration.memberForID)
|
||||
canUserRedactUserIDReturnValue = .success(false)
|
||||
canUserTriggerRoomNotificationUserIDReturnValue = .success(configuration.canUserTriggerRoomNotification)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user