diff --git a/ElementX.xcodeproj/project.pbxproj b/ElementX.xcodeproj/project.pbxproj index 8df66362d..501391b34 100644 --- a/ElementX.xcodeproj/project.pbxproj +++ b/ElementX.xcodeproj/project.pbxproj @@ -536,7 +536,6 @@ 61A36B9BB2ADE36CEFF5E98C /* Array.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E93A1BE7D8A2EBCAD51EEB4 /* Array.swift */; }; 62684AECDFC5C7DC989CBD9E /* SnapshotTesting in Frameworks */ = {isa = PBXBuildFile; productRef = 7B6BC3219ADD8AA0311D2B86 /* SnapshotTesting */; }; 627139A3D79F032BA81E3A53 /* UserSessionFlowCoordinatorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4FA29BAE9B0F2D90E57B261C /* UserSessionFlowCoordinatorTests.swift */; }; - 62811275F1ED9EA55638838E /* RoomTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7728AA8046D460145EAC740 /* RoomTests.swift */; }; 6298AB0906DDD3525CD78C6B /* KZFileWatchers in Frameworks */ = {isa = PBXBuildFile; productRef = 81DB3AB6CE996AB3954F4F03 /* KZFileWatchers */; }; 62A7FC3A0191BC7181AA432B /* AudioRecorder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 907FA4DE17DEA1A3738EFB83 /* AudioRecorder.swift */; }; 62C5876C4254C58C2086F0DE /* HomeScreenContent.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3B4B58B79A6FA250B24A1EC /* HomeScreenContent.swift */; }; @@ -1102,7 +1101,6 @@ C7774720A4B2E34693E3227C /* RoomNotificationSettingsScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8896CDD20CA2D87EA3B848A1 /* RoomNotificationSettingsScreen.swift */; }; C797C0B4CF45C66CD1921252 /* SoftLogoutScreenViewModelTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC43313F21511C853D34544E /* SoftLogoutScreenViewModelTests.swift */; }; C7ABEBECDC513F7887DACF66 /* ProgressMaskModifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = 68010886142843705E342645 /* ProgressMaskModifier.swift */; }; - C7CEFC1FB0547CFC8F5C84EF /* Room.swift in Sources */ = {isa = PBXBuildFile; fileRef = D78C13EF5035879B6131030F /* Room.swift */; }; C7F20DBF873CC72FB482E326 /* test_rotated_image.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 723B055A57857BFF0F18D9CB /* test_rotated_image.jpg */; }; C80E06ED97CE52704A46C148 /* ClientBuilder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A1C33355FFB0F0953C35036 /* ClientBuilder.swift */; }; C85C7A201E4CFDA477ACEBEB /* AppLockSetupSettingsScreenViewModelProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8610C1D21565C950BCA6A454 /* AppLockSetupSettingsScreenViewModelProtocol.swift */; }; @@ -2440,7 +2438,6 @@ B6E89E530A8E92EC44301CA1 /* Bundle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Bundle.swift; sourceTree = ""; }; B73587C2E3CF5998361AE516 /* HomeScreenRoomTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeScreenRoomTests.swift; sourceTree = ""; }; B746EFA112532A7B701FB914 /* RoomNotificationSettingsCustomSectionView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomNotificationSettingsCustomSectionView.swift; sourceTree = ""; }; - B7728AA8046D460145EAC740 /* RoomTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomTests.swift; sourceTree = ""; }; B7884BD256C091EB511B2EDF /* AppLockSetupPINScreenViewModelProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppLockSetupPINScreenViewModelProtocol.swift; sourceTree = ""; }; B788615712FED326F73D3F83 /* GlobalSearchScreenViewModelProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GlobalSearchScreenViewModelProtocol.swift; sourceTree = ""; }; B7F0192CE2F891141A25B49F /* UITestsSignalling.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UITestsSignalling.swift; sourceTree = ""; }; @@ -2600,7 +2597,6 @@ D751AA05AD2182BFC4608DE6 /* ur */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = ur; path = ur.lproj/Localizable.stringsdict; sourceTree = ""; }; D7673F2B0B038FAB2A8D16AD /* ElementTextFieldStyle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ElementTextFieldStyle.swift; sourceTree = ""; }; D77F75B3E9F99864048A422A /* DeactivateAccountScreenViewModelTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DeactivateAccountScreenViewModelTests.swift; sourceTree = ""; }; - D78C13EF5035879B6131030F /* Room.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Room.swift; sourceTree = ""; }; D79BB714D28C9F588DD69353 /* SecureBackupScreenViewModelProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SecureBackupScreenViewModelProtocol.swift; sourceTree = ""; }; D7B18089ED50324583BB2FB7 /* EditRoomAddressScreenViewModelProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EditRoomAddressScreenViewModelProtocol.swift; sourceTree = ""; }; D7BB243B26D54EF1A0C422C0 /* NotificationContentBuilder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationContentBuilder.swift; sourceTree = ""; }; @@ -3846,7 +3842,6 @@ 858DA81F2ACF484B7CAD6AE4 /* KnockedRoomProxy.swift */, 8F062DD2CCD95DC33528A16F /* KnockRequestProxy.swift */, C07851F4EA81AA3339806A7B /* KnockRequestProxyProtocol.swift */, - D78C13EF5035879B6131030F /* Room.swift */, B6404166CBF5CC88673FF9E2 /* RoomDetails.swift */, 40A66E8BC8D9AE4A08EFB2DF /* RoomInfoProxy.swift */, 14517E5597594956FCE1950D /* RoomInfoProxyProtocol.swift */, @@ -4589,7 +4584,6 @@ AEEAFB646E583655652C3D04 /* RoomStateEventStringBuilderTests.swift */, F46E441BA50705E6CEC89FE0 /* RoomSummaryProviderTests.swift */, 046C0D3F53B0B5EF0A1F5BEA /* RoomSummaryTests.swift */, - B7728AA8046D460145EAC740 /* RoomTests.swift */, 2E88534A39781D76487D59DF /* SecureBackupKeyBackupScreenViewModelTests.swift */, 848F69921527D31CAACB93AF /* SecureBackupLogoutConfirmationScreenViewModelTests.swift */, C0FF08D0BD7D0B4B6877AB7D /* SecureBackupRecoveryKeyScreenViewModelTests.swift */, @@ -7329,7 +7323,6 @@ CC0D088F505F33A20DC5590F /* RoomStateEventStringBuilderTests.swift in Sources */, 6AB306367E56A6F6DFA0E2FF /* RoomSummaryProviderTests.swift in Sources */, 15913A5B07118C1268A840E4 /* RoomSummaryTests.swift in Sources */, - 62811275F1ED9EA55638838E /* RoomTests.swift in Sources */, 7691233E3572A9173FD96CB3 /* SecureBackupKeyBackupScreenViewModelTests.swift in Sources */, EB87DF90CF6F8D5D12404C6E /* SecureBackupLogoutConfirmationScreenViewModelTests.swift in Sources */, 06B31F84CE52A7A7C271267C /* SecureBackupRecoveryKeyScreenViewModelTests.swift in Sources */, @@ -7998,7 +7991,6 @@ ED3E91E6166E4923791ACA84 /* ResolveVerifiedUserSendFailureScreenViewModelProtocol.swift in Sources */, A494741843F087881299ACF0 /* RestorationToken.swift in Sources */, 194585F6CD77242B36D4ADF1 /* Result.swift in Sources */, - C7CEFC1FB0547CFC8F5C84EF /* Room.swift in Sources */, 6E391F7F628D984AF44385D9 /* RoomAttachmentPicker.swift in Sources */, 8587A53DE8EF94FD796DC375 /* RoomAvatarImage.swift in Sources */, F8C87130FD999F7F1076208C /* RoomChangePermissionsScreen.swift in Sources */, @@ -9322,7 +9314,7 @@ repositoryURL = "https://github.com/element-hq/matrix-rust-components-swift"; requirement = { kind = exactVersion; - version = 25.09.10; + version = 25.09.01; }; }; 701C7BEF8F70F7A83E852DCC /* XCRemoteSwiftPackageReference "GZIP" */ = { diff --git a/ElementX.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/ElementX.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 6f79ef209..ec6104655 100644 --- a/ElementX.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/ElementX.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -158,8 +158,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/element-hq/matrix-rust-components-swift", "state" : { - "revision" : "eeddc5f05f0980bcf29e78f212d64152be343124", - "version" : "25.9.10" + "revision" : "37730751af3a42569677b04d3458629a4b8dc347", + "version" : "25.9.1" } }, { diff --git a/ElementX/Sources/Mocks/InvitedRoomProxyMock.swift b/ElementX/Sources/Mocks/InvitedRoomProxyMock.swift index c4e7abb87..ea5b2dd00 100644 --- a/ElementX/Sources/Mocks/InvitedRoomProxyMock.swift +++ b/ElementX/Sources/Mocks/InvitedRoomProxyMock.swift @@ -80,6 +80,7 @@ private extension RoomMember { membership: proxy.membership, isNameAmbiguous: proxy.disambiguatedDisplayName != proxy.displayName, powerLevel: proxy.powerLevel.rustPowerLevel, + normalizedPowerLevel: proxy.powerLevel.rustPowerLevel, isIgnored: proxy.isIgnored, suggestedRoleForPowerLevel: proxy.role.rustRole, membershipChangeReason: proxy.membershipChangeReason) diff --git a/ElementX/Sources/Other/Logging/TraceLogPack.swift b/ElementX/Sources/Other/Logging/TraceLogPack.swift index 0d28d4ba5..19061dac9 100644 --- a/ElementX/Sources/Other/Logging/TraceLogPack.swift +++ b/ElementX/Sources/Other/Logging/TraceLogPack.swift @@ -9,7 +9,7 @@ import Foundation import MatrixRustSDK enum TraceLogPack: Codable, CaseIterable { - case eventCache, sendQueue, timeline, notificationClient, syncProfiling + case eventCache, sendQueue, timeline, notificationClient var title: String { switch self { @@ -17,7 +17,6 @@ enum TraceLogPack: Codable, CaseIterable { case .sendQueue: "Send queue" case .timeline: "Timeline" case .notificationClient: "Notification client" - case .syncProfiling: "Sync profiling" } } } @@ -30,7 +29,6 @@ extension TraceLogPack { case .sendQueue: self = .sendQueue case .timeline: self = .timeline case .notificationClient: self = .notificationClient - case .syncProfiling: self = .syncProfiling } } @@ -40,7 +38,6 @@ extension TraceLogPack { case .sendQueue: .sendQueue case .timeline: .timeline case .notificationClient: .notificationClient - case .syncProfiling: .syncProfiling } } } diff --git a/ElementX/Sources/Services/ElementCall/ElementCallWidgetDriver.swift b/ElementX/Sources/Services/ElementCall/ElementCallWidgetDriver.swift index e3ad02c98..fb7ccbf8f 100644 --- a/ElementX/Sources/Services/ElementCall/ElementCallWidgetDriver.swift +++ b/ElementX/Sources/Services/ElementCall/ElementCallWidgetDriver.swift @@ -76,32 +76,31 @@ class ElementCallWidgetDriver: WidgetCapabilitiesProvider, ElementCallWidgetDriv } async let useEncryption = (try? room.latestEncryptionState() == .encrypted) ?? false - async let intent = room.joinCallIntent - + async let isDirect = room.isDirect() let widgetSettings: WidgetSettings + do { widgetSettings = try await newVirtualElementCallWidget(props: .init(elementCallUrl: baseURL.absoluteString, widgetId: widgetID, parentUrl: nil, + header: .appBar, + hideHeader: true, + preload: nil, fontScale: nil, + appPrompt: false, + confineToRoom: true, font: nil, encryption: useEncryption ? .perParticipantKeys : .unencrypted, + intent: .startCall, + hideScreensharing: false, posthogUserId: nil, posthogApiHost: analyticsConfiguration?.posthogAPIHost, posthogApiKey: analyticsConfiguration?.posthogAPIKey, rageshakeSubmitUrl: rageshakeURL, sentryDsn: analyticsConfiguration?.sentryDSN, - sentryEnvironment: nil), - config: .init(intent: intent, - skipLobby: nil, - header: nil, - hideHeader: nil, - preload: nil, - appPrompt: nil, - confineToRoom: nil, - hideScreensharing: nil, - controlledAudioDevices: nil, - sendNotificationType: nil)) + sentryEnvironment: nil, + controlledMediaDevices: !ProcessInfo.processInfo.isiOSAppOnMac, + sendNotificationType: isDirect ? .ring : .notification)) } catch { MXLog.error("Failed to build widget settings: \(error)") return .failure(.failedBuildingWidgetSettings) diff --git a/ElementX/Sources/Services/Room/Room.swift b/ElementX/Sources/Services/Room/Room.swift deleted file mode 100644 index b2e7354d6..000000000 --- a/ElementX/Sources/Services/Room/Room.swift +++ /dev/null @@ -1,21 +0,0 @@ -// -// Copyright 2025 New Vector Ltd. -// -// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial -// Please see LICENSE files in the repository root for full details. -// - -import MatrixRustSDK - -extension RoomProtocol { - var joinCallIntent: Intent { - get async { - switch await (hasActiveRoomCall(), isDirect()) { - case (true, true): .joinExistingDm - case (true, false): .joinExisting - case (false, true): .startCallDm - case (false, false): .startCall - } - } - } -} diff --git a/UnitTests/Sources/RoomTests.swift b/UnitTests/Sources/RoomTests.swift deleted file mode 100644 index f544e4961..000000000 --- a/UnitTests/Sources/RoomTests.swift +++ /dev/null @@ -1,34 +0,0 @@ -// -// Copyright 2025 New Vector Ltd. -// -// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial -// Please see LICENSE files in the repository root for full details. -// - -import MatrixRustSDK -import XCTest - -@testable import ElementX - -class RoomTests: XCTestCase { - func testCallIntent() async throws { - let room = RoomSDKMock() - room.hasActiveRoomCallReturnValue = false - room.isDirectReturnValue = false - - var callIntent = await room.joinCallIntent - XCTAssertEqual(callIntent, .startCall) - - room.isDirectReturnValue = true - callIntent = await room.joinCallIntent - XCTAssertEqual(callIntent, .startCallDm) - - room.hasActiveRoomCallReturnValue = true - callIntent = await room.joinCallIntent - XCTAssertEqual(callIntent, .joinExistingDm) - - room.isDirectReturnValue = false - callIntent = await room.joinCallIntent - XCTAssertEqual(callIntent, .joinExisting) - } -} diff --git a/project.yml b/project.yml index bbf73acf9..79b903824 100644 --- a/project.yml +++ b/project.yml @@ -68,7 +68,7 @@ packages: # Element/Matrix dependencies MatrixRustSDK: url: https://github.com/element-hq/matrix-rust-components-swift - exactVersion: 25.09.10 + exactVersion: 25.09.01 # path: ../matrix-rust-sdk Compound: url: https://github.com/element-hq/compound-ios