mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 12:07:55 +00:00
Run SwiftFormat.
This commit is contained in:
@@ -26,7 +26,7 @@ extension AggregatedReaction {
|
||||
private static var alice: String {
|
||||
RoomMemberProxyMock.mockAlice.userID
|
||||
}
|
||||
|
||||
|
||||
static var mockReactions: [AggregatedReaction] {
|
||||
[
|
||||
mockReaction(key: "😅", senderIDs: [alice]),
|
||||
|
||||
@@ -159,7 +159,7 @@ extension ClientProxyMock {
|
||||
|
||||
underlyingTimelineMediaVisibilityPublisher = CurrentValueSubject<TimelineMediaVisibility, Never>(configuration.timelineMediaVisibility).asCurrentValuePublisher()
|
||||
underlyingHideInviteAvatarsPublisher = CurrentValueSubject<Bool, Never>(configuration.hideInviteAvatars).asCurrentValuePublisher()
|
||||
|
||||
|
||||
liveLocationOwnInfoUpdatesPublisher = PassthroughSubject<LiveLocationOwnInfoUpdate, Never>().eraseToAnyPublisher()
|
||||
|
||||
underlyingMaxMediaUploadSize = .success(configuration.maxMediaUploadSize)
|
||||
|
||||
@@ -53,21 +53,21 @@ extension JoinedRoomProxyMock {
|
||||
@MainActor
|
||||
convenience init(_ configuration: JoinedRoomProxyMockConfiguration) {
|
||||
self.init()
|
||||
|
||||
|
||||
id = configuration.id
|
||||
|
||||
|
||||
timeline = TimelineProxyMock(.init(isAutoUpdating: configuration.shouldUseAutoUpdatingTimeline,
|
||||
timelineStartReached: configuration.timelineStartReached))
|
||||
|
||||
pinnedEventsTimelineReturnValue = .failure(.failedCreatingPinnedTimeline)
|
||||
|
||||
|
||||
ownUserID = configuration.ownUserID
|
||||
|
||||
membersPublisher = CurrentValueSubject(configuration.members).asCurrentValuePublisher()
|
||||
knockRequestsStatePublisher = CurrentValueSubject(configuration.knockRequestsState).asCurrentValuePublisher()
|
||||
typingMembersPublisher = CurrentValueSubject([]).asCurrentValuePublisher()
|
||||
identityStatusChangesPublisher = CurrentValueSubject([]).asCurrentValuePublisher()
|
||||
|
||||
|
||||
makeLiveLocationServiceReturnValue = RoomLiveLocationServiceMock(.init())
|
||||
|
||||
updateMembersClosure = { }
|
||||
@@ -82,7 +82,7 @@ extension JoinedRoomProxyMock {
|
||||
|
||||
ignoreDeviceTrustAndResendDevicesSendHandleReturnValue = .success(())
|
||||
withdrawVerificationAndResendUserIDsSendHandleReturnValue = .success(())
|
||||
|
||||
|
||||
flagAsUnreadReturnValue = .success(())
|
||||
markAsReadReceiptTypeReturnValue = .success(())
|
||||
flagAsFavouriteReturnValue = .success(())
|
||||
|
||||
@@ -51,7 +51,7 @@ extension NotificationSettingsProxyMock {
|
||||
self.callbacks.send(.settingsDidChange)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
restoreDefaultNotificationModeRoomIdClosure = { [weak self] _ in
|
||||
guard let self else { return }
|
||||
self.getNotificationSettingsRoomIdIsEncryptedIsOneToOneReturnValue = RoomNotificationSettingsProxyMock(with: .init(mode: configuration.defaultRoomMode, isDefault: true))
|
||||
|
||||
@@ -23,7 +23,7 @@ extension Poll {
|
||||
endDate: ended ? Date() : nil,
|
||||
createdByAccountOwner: createdByAccountOwner)
|
||||
}
|
||||
|
||||
|
||||
static func disclosed(createdByAccountOwner: Bool = false) -> Self {
|
||||
mock(question: "What country do you like most?",
|
||||
pollKind: .disclosed,
|
||||
@@ -32,7 +32,7 @@ extension Poll {
|
||||
.mock(text: "USA 🇺🇸", votes: 2, allVotes: 10)],
|
||||
createdByAccountOwner: createdByAccountOwner)
|
||||
}
|
||||
|
||||
|
||||
static func undisclosed(createdByAccountOwner: Bool = false) -> Self {
|
||||
mock(question: "What country do you like most?",
|
||||
pollKind: .undisclosed,
|
||||
@@ -41,7 +41,7 @@ extension Poll {
|
||||
.mock(text: "USA 🇺🇸", votes: 2, allVotes: 10)],
|
||||
createdByAccountOwner: createdByAccountOwner)
|
||||
}
|
||||
|
||||
|
||||
static var endedDisclosed: Self {
|
||||
mock(question: "What country do you like most?",
|
||||
pollKind: .disclosed,
|
||||
@@ -50,7 +50,7 @@ extension Poll {
|
||||
.mock(text: "USA 🇺🇸", votes: 2, allVotes: 10)],
|
||||
ended: true)
|
||||
}
|
||||
|
||||
|
||||
static var endedUndisclosed: Self {
|
||||
mock(question: "What country do you like most?",
|
||||
pollKind: .undisclosed,
|
||||
|
||||
@@ -37,7 +37,7 @@ extension RoomMemberProxyMock {
|
||||
|
||||
powerLevel = configuration.powerLevel
|
||||
}
|
||||
|
||||
|
||||
/// Mocks
|
||||
static var mockMe: RoomMemberProxyMock {
|
||||
RoomMemberProxyMock(with: .init(userID: "@me:matrix.org",
|
||||
@@ -73,19 +73,19 @@ extension RoomMemberProxyMock {
|
||||
displayName: "Alice",
|
||||
membership: .invite))
|
||||
}
|
||||
|
||||
|
||||
static var mockBob: RoomMemberProxyMock {
|
||||
RoomMemberProxyMock(with: .init(userID: "@bob:matrix.org",
|
||||
displayName: "Bob",
|
||||
membership: .join))
|
||||
}
|
||||
|
||||
|
||||
static var mockCharlie: RoomMemberProxyMock {
|
||||
RoomMemberProxyMock(with: .init(userID: "@charlie:matrix.org",
|
||||
displayName: "Charlie",
|
||||
membership: .join))
|
||||
}
|
||||
|
||||
|
||||
static var mockDan: RoomMemberProxyMock {
|
||||
RoomMemberProxyMock(with: .init(userID: "@dan:matrix.org",
|
||||
displayName: "Dan",
|
||||
@@ -110,7 +110,7 @@ extension RoomMemberProxyMock {
|
||||
membership: .invite,
|
||||
isIgnored: true))
|
||||
}
|
||||
|
||||
|
||||
static var mockIgnored: RoomMemberProxyMock {
|
||||
RoomMemberProxyMock(with: .init(userID: "@ignored:matrix.org",
|
||||
displayName: "Ignored",
|
||||
|
||||
@@ -17,7 +17,7 @@ struct RoomNotificationSettingsProxyMockConfiguration {
|
||||
extension RoomNotificationSettingsProxyMock {
|
||||
convenience init(with configuration: RoomNotificationSettingsProxyMockConfiguration) {
|
||||
self.init()
|
||||
|
||||
|
||||
isDefault = configuration.isDefault
|
||||
mode = configuration.mode
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ extension RoomPowerLevelsProxyMock {
|
||||
self.init()
|
||||
|
||||
underlyingValues = RoomPowerLevelsValues.mock
|
||||
|
||||
|
||||
canOwnUserSendMessageReturnValue = configuration.canUserSendMessage
|
||||
canOwnUserSendStateEventReturnValue = configuration.canUserSendState
|
||||
canOwnUserInviteReturnValue = configuration.canUserInvite
|
||||
|
||||
@@ -289,7 +289,7 @@ extension Array where Element == RoomSummary {
|
||||
|
||||
static let mockRoomsWithNotificationsState: [Element] = {
|
||||
var result: [Element] = []
|
||||
|
||||
|
||||
// Iterate over settings modes
|
||||
for mode in RoomNotificationModeProxy.allCases {
|
||||
// Iterate over unread messages states
|
||||
|
||||
@@ -16,7 +16,7 @@ extension SessionVerificationControllerProxyMock {
|
||||
SessionVerificationEmoji(symbol: "🎂", description: "Cake"),
|
||||
SessionVerificationEmoji(symbol: "🏁", description: "Flag"),
|
||||
SessionVerificationEmoji(symbol: "🌏", description: "Globe")]
|
||||
|
||||
|
||||
static func configureMock(actions: PassthroughSubject<SessionVerificationControllerProxyAction, Never> = .init(),
|
||||
isVerified: Bool = false,
|
||||
otherDeviceStartsSasVerification: Bool = false,
|
||||
@@ -25,7 +25,7 @@ extension SessionVerificationControllerProxyMock {
|
||||
mock.underlyingActions = actions
|
||||
|
||||
mock.acknowledgeVerificationRequestDetailsReturnValue = .success(())
|
||||
|
||||
|
||||
mock.requestDeviceVerificationClosure = { [weak mock] in
|
||||
Task.detached {
|
||||
guard let mock else { return }
|
||||
@@ -41,26 +41,26 @@ extension SessionVerificationControllerProxyMock {
|
||||
mock.actions.send(.receivedVerificationData(emojis))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return .success(())
|
||||
}
|
||||
|
||||
|
||||
mock.startSasVerificationClosure = { [weak mock] in
|
||||
Task.detached {
|
||||
guard let mock else { return }
|
||||
|
||||
try await Task.sleep(for: requestDelay)
|
||||
mock.actions.send(.startedSasVerification)
|
||||
|
||||
|
||||
Task.detached {
|
||||
try await Task.sleep(for: requestDelay)
|
||||
mock.actions.send(.receivedVerificationData(emojis))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return .success(())
|
||||
}
|
||||
|
||||
|
||||
mock.approveVerificationClosure = { [weak mock] in
|
||||
Task.detached {
|
||||
guard let mock else { return }
|
||||
@@ -68,10 +68,10 @@ extension SessionVerificationControllerProxyMock {
|
||||
try await Task.sleep(for: requestDelay)
|
||||
mock.actions.send(.finished)
|
||||
}
|
||||
|
||||
|
||||
return .success(())
|
||||
}
|
||||
|
||||
|
||||
mock.declineVerificationClosure = { [weak mock] in
|
||||
Task.detached {
|
||||
guard let mock else { return }
|
||||
@@ -79,7 +79,7 @@ extension SessionVerificationControllerProxyMock {
|
||||
try await Task.sleep(for: requestDelay)
|
||||
mock.actions.send(.cancelled)
|
||||
}
|
||||
|
||||
|
||||
return .success(())
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ extension SessionVerificationControllerProxyMock {
|
||||
try await Task.sleep(for: requestDelay)
|
||||
mock.actions.send(.cancelled)
|
||||
}
|
||||
|
||||
|
||||
return .success(())
|
||||
}
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ extension SpaceServiceProxyMock.Configuration {
|
||||
partialResult.append(SpaceServiceFilter(room: spaceRoom, level: 0, descendants: .init()))
|
||||
partialResult.append(SpaceServiceFilter(room: spaceRoom, level: 1, descendants: .init()))
|
||||
}
|
||||
|
||||
|
||||
let spaceRoomLists = [SpaceServiceRoom].mockJoinedSpaces.map {
|
||||
($0.id, SpaceRoomListProxyMock(.init(spaceServiceRoom: $0, initialSpaceRooms: .mockSpaceList)))
|
||||
}
|
||||
|
||||
@@ -13,15 +13,15 @@ extension UserProfileProxy {
|
||||
static var mockAlice: UserProfileProxy {
|
||||
.init(userID: "@alice:matrix.org", displayName: "Alice", avatarURL: "mxc://matrix.org/UcCimidcvpFvWkPzvjXMQPHA")
|
||||
}
|
||||
|
||||
|
||||
static var mockBob: UserProfileProxy {
|
||||
.init(userID: "@bob:matrix.org", displayName: "Bob", avatarURL: nil)
|
||||
}
|
||||
|
||||
|
||||
static var mockBobby: UserProfileProxy {
|
||||
.init(userID: "@bobby:matrix.org", displayName: "Bobby", avatarURL: nil)
|
||||
}
|
||||
|
||||
|
||||
static var mockCharlie: UserProfileProxy {
|
||||
.init(userID: "@charlie:matrix.org", displayName: "Charlie", avatarURL: nil)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user