Skip to content

Commit

Permalink
See what it takes to adopt matrix-org/matrix-rust-sdk/pull/4100
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanceriu committed Oct 10, 2024
1 parent 429ce4f commit 2daa506
Show file tree
Hide file tree
Showing 42 changed files with 896 additions and 947 deletions.
31 changes: 18 additions & 13 deletions ElementX.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -2103,6 +2103,7 @@
CDE3F3911FF7CC639BDE5844 /* nl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = nl; path = nl.lproj/Localizable.strings; sourceTree = "<group>"; };
CEE20623EB4A9B88FB29F2BA /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/SAS.strings; sourceTree = "<group>"; };
CEE41494C837AA403A06A5D9 /* UnitTests.xctestplan */ = {isa = PBXFileReference; path = UnitTests.xctestplan; sourceTree = "<group>"; };
CF05437C99730E5B3357FC51 /* matrix-rust-sdk */ = {isa = PBXFileReference; lastKnownFileType = folder; name = "matrix-rust-sdk"; path = "../matrix-rust-sdk"; sourceTree = SOURCE_ROOT; };
D071F86CD47582B9196C9D16 /* UserDiscoverySection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserDiscoverySection.swift; sourceTree = "<group>"; };
D086854995173E897F993C26 /* AdvancedSettingsScreenViewModelProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdvancedSettingsScreenViewModelProtocol.swift; sourceTree = "<group>"; };
D09A267106B9585D3D0CFC0D /* ClientError.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ClientError.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -3181,6 +3182,7 @@
8A9C09B6A392465E03B8D1B1 /* IntegrationTests */,
823ED0EC3F1B6CF47D284011 /* Tools */,
B04B538A859CD012755DC19C /* NSE */,
9413F680ECDFB2B0DDB0DEF2 /* Packages */,
1803CD2B96BF06009334BB61 /* PreviewTests */,
681566846AF307E9BA4C72C6 /* Products */,
);
Expand Down Expand Up @@ -4389,6 +4391,14 @@
path = UserProfileScreen;
sourceTree = "<group>";
};
9413F680ECDFB2B0DDB0DEF2 /* Packages */ = {
isa = PBXGroup;
children = (
CF05437C99730E5B3357FC51 /* matrix-rust-sdk */,
);
name = Packages;
sourceTree = "<group>";
};
948DD12A5533BE1BC260E437 /* LocationSharing */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -5793,14 +5803,14 @@
CCD235515AFCEE6D2005B705 /* XCRemoteSwiftPackageReference "LRUCache" */,
4BDA7F6042968E8422470F3F /* XCRemoteSwiftPackageReference "LoremSwiftum" */,
0CBF57301AA172C21F76CE86 /* XCRemoteSwiftPackageReference "maplibre-gl-native-distribution" */,
6FC4820D8D4559CEECA064D7 /* XCRemoteSwiftPackageReference "matrix-rust-components-swift" */,
96495DD8554E2F39D3954354 /* XCRemoteSwiftPackageReference "posthog-ios" */,
A08925A9D5E3770DEB9D8509 /* XCRemoteSwiftPackageReference "sentry-cocoa" */,
E9C4F3A12AA1F65C13A8C8EB /* XCRemoteSwiftPackageReference "swift-snapshot-testing" */,
E2F3DA35D462724CCC61DE2C /* XCRemoteSwiftPackageReference "swift-ogg" */,
6582B5AF3F104B0F7E031E7D /* XCRemoteSwiftPackageReference "SwiftState" */,
EC6D0C817B1C21D9D096505A /* XCRemoteSwiftPackageReference "Version" */,
EE40B0E16A55BD23ECBFFD22 /* XCRemoteSwiftPackageReference "matrix-rich-text-editor-swift" */,
8FB6F8BBB0A235E3C8DCF8F7 /* XCLocalSwiftPackageReference "../matrix-rust-sdk" */,
);
projectDirPath = "";
projectRoot = "";
Expand Down Expand Up @@ -7789,14 +7799,6 @@
minimumVersion = 6.0.0;
};
};
6FC4820D8D4559CEECA064D7 /* XCRemoteSwiftPackageReference "matrix-rust-components-swift" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/element-hq/matrix-rust-components-swift";
requirement = {
kind = exactVersion;
version = 1.0.56;
};
};
701C7BEF8F70F7A83E852DCC /* XCRemoteSwiftPackageReference "GZIP" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/nicklockwood/GZIP";
Expand Down Expand Up @@ -7927,6 +7929,13 @@
};
/* End XCRemoteSwiftPackageReference section */

/* Begin XCLocalSwiftPackageReference section */
8FB6F8BBB0A235E3C8DCF8F7 /* XCLocalSwiftPackageReference "../matrix-rust-sdk" */ = {
isa = XCLocalSwiftPackageReference;
relativePath = "../matrix-rust-sdk";
};
/* End XCLocalSwiftPackageReference section */

/* Begin XCSwiftPackageProductDependency section */
020597E28A4BC8E1BE8EDF6E /* KeychainAccess */ = {
isa = XCSwiftPackageProductDependency;
Expand Down Expand Up @@ -8055,7 +8064,6 @@
};
6647C55D93508C7CE9D954A5 /* MatrixRustSDK */ = {
isa = XCSwiftPackageProductDependency;
package = 6FC4820D8D4559CEECA064D7 /* XCRemoteSwiftPackageReference "matrix-rust-components-swift" */;
productName = MatrixRustSDK;
};
67E7A6F388D3BF85767609D9 /* Sentry */ = {
Expand Down Expand Up @@ -8140,7 +8148,6 @@
};
A678E40E917620059695F067 /* MatrixRustSDK */ = {
isa = XCSwiftPackageProductDependency;
package = 6FC4820D8D4559CEECA064D7 /* XCRemoteSwiftPackageReference "matrix-rust-components-swift" */;
productName = MatrixRustSDK;
};
A7CA6F33C553805035C3B114 /* DeviceKit */ = {
Expand All @@ -8155,7 +8162,6 @@
};
B1E8B697DF78FE7F61FC6CA4 /* MatrixRustSDK */ = {
isa = XCSwiftPackageProductDependency;
package = 6FC4820D8D4559CEECA064D7 /* XCRemoteSwiftPackageReference "matrix-rust-components-swift" */;
productName = MatrixRustSDK;
};
BA93CD75CCE486660C9040BD /* Collections */ = {
Expand All @@ -8180,7 +8186,6 @@
};
C2C69B8BA5A9702E7A8BC08F /* MatrixRustSDK */ = {
isa = XCSwiftPackageProductDependency;
package = 6FC4820D8D4559CEECA064D7 /* XCRemoteSwiftPackageReference "matrix-rust-components-swift" */;
productName = MatrixRustSDK;
};
CA07D57389DACE18AEB6A5E2 /* WysiwygComposer */ = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"originHash" : "f9011692b20e61e6f0df94b6e0946a4c8f4d58429a88998f249712bb1fee47f1",
"pins" : [
{
"identity" : "compound-design-tokens",
Expand Down Expand Up @@ -144,15 +143,6 @@
"version" : "2.37.12"
}
},
{
"identity" : "matrix-rust-components-swift",
"kind" : "remoteSourceControl",
"location" : "https://github.com/element-hq/matrix-rust-components-swift",
"state" : {
"revision" : "1366154c2e601179514be93e2fca48969c4f2ed8",
"version" : "1.0.56"
}
},
{
"identity" : "ogg-swift",
"kind" : "remoteSourceControl",
Expand Down Expand Up @@ -289,5 +279,5 @@
}
}
],
"version" : 3
"version" : 2
}
62 changes: 31 additions & 31 deletions ElementX/Sources/FlowCoordinators/RoomFlowCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -831,37 +831,37 @@ class RoomFlowCoordinator: FlowCoordinatorProtocol {
}

private func presentReportContent(for itemID: TimelineItemIdentifier, from senderID: String) {
guard let eventID = itemID.eventID else {
fatalError()
}
let stackCoordinator = NavigationStackCoordinator()
let parameters = ReportContentScreenCoordinatorParameters(eventID: eventID,
senderID: senderID,
roomProxy: roomProxy,
clientProxy: userSession.clientProxy,
userIndicatorController: userIndicatorController)
let coordinator = ReportContentScreenCoordinator(parameters: parameters)
coordinator.actions
.sink { [weak self] action in
guard let self else { return }
navigationStackCoordinator.setSheetCoordinator(nil)
switch action {
case .cancel:
break
case .finish:
userIndicatorController.submitIndicator(UserIndicator(title: L10n.commonReportSubmitted, iconName: "checkmark"))
}
}
.store(in: &cancellables)
stackCoordinator.setRootCoordinator(coordinator)
navigationStackCoordinator.setSheetCoordinator(stackCoordinator) { [weak self] in
self?.stateMachine.tryEvent(.dismissReportContent)
}
// guard let eventID = itemID.eventID else {
// fatalError()
// }
//
// let stackCoordinator = NavigationStackCoordinator()
// let parameters = ReportContentScreenCoordinatorParameters(eventID: eventID,
// senderID: senderID,
// roomProxy: roomProxy,
// clientProxy: userSession.clientProxy,
// userIndicatorController: userIndicatorController)
// let coordinator = ReportContentScreenCoordinator(parameters: parameters)
//
// coordinator.actions
// .sink { [weak self] action in
// guard let self else { return }
//
// navigationStackCoordinator.setSheetCoordinator(nil)
//
// switch action {
// case .cancel:
// break
// case .finish:
// userIndicatorController.submitIndicator(UserIndicator(title: L10n.commonReportSubmitted, iconName: "checkmark"))
// }
// }
// .store(in: &cancellables)
//
// stackCoordinator.setRootCoordinator(coordinator)
// navigationStackCoordinator.setSheetCoordinator(stackCoordinator) { [weak self] in
// self?.stateMachine.tryEvent(.dismissReportContent)
// }
}

private func presentMediaUploadPickerWithSource(_ source: MediaPickerScreenSource) {
Expand Down
9 changes: 4 additions & 5 deletions ElementX/Sources/Mocks/EventTimelineItem.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,21 @@ struct EventTimelineItemSDKMockConfiguration {

extension EventTimelineItem {
init(configuration: EventTimelineItemSDKMockConfiguration) {
self.init(isLocal: false,
isRemote: true,
eventOrTransactionId: .eventId(eventId: configuration.eventID),
self.init(isRemote: true,
eventId: configuration.eventID,
transactionId: nil,
sender: configuration.sender,
senderProfile: .pending,
isOwn: configuration.isOwn,
isEditable: false,
content: configuration.content,
timestamp: 0,
reactions: [],
debugInfoProvider: EventTimelineItemDebugInfoProviderSDKMock(),
localSendState: nil,
readReceipts: [:],
origin: nil,
canBeRepliedTo: false,
shieldsProvider: EventShieldsProviderSDKMock())
lazyProvider: LazyTimelineItemProviderSDKMock())
}

static var mockMessage: EventTimelineItem {
Expand Down
Loading

0 comments on commit 2daa506

Please sign in to comment.