Skip to content

Commit 0d9d8f9

Browse files
authored
Sdk v1.0.47 (#3265)
1 parent b85bd60 commit 0d9d8f9

File tree

9 files changed

+24
-140
lines changed

9 files changed

+24
-140
lines changed

ElementX.xcodeproj/project.pbxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7691,7 +7691,7 @@
76917691
repositoryURL = "https://github.com/element-hq/matrix-rust-components-swift";
76927692
requirement = {
76937693
kind = exactVersion;
7694-
version = 1.0.46;
7694+
version = 1.0.47;
76957695
};
76967696
};
76977697
701C7BEF8F70F7A83E852DCC /* XCRemoteSwiftPackageReference "GZIP" */ = {

ElementX.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ElementX/Sources/Mocks/Generated/SDKGeneratedMocks.swift

Lines changed: 4 additions & 126 deletions
Original file line numberDiff line numberDiff line change
@@ -9974,82 +9974,6 @@ open class NotificationSettingsSDKMock: MatrixRustSDK.NotificationSettings {
99749974
try await unmuteRoomRoomIdIsEncryptedIsOneToOneClosure?(roomId, isEncrypted, isOneToOne)
99759975
}
99769976
}
9977-
open class OidcAuthorizationDataSDKMock: MatrixRustSDK.OidcAuthorizationData {
9978-
init() {
9979-
super.init(noPointer: .init())
9980-
}
9981-
9982-
public required init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) {
9983-
fatalError("init(unsafeFromRawPointer:) has not been implemented")
9984-
}
9985-
9986-
fileprivate var pointer: UnsafeMutableRawPointer!
9987-
9988-
//MARK: - loginUrl
9989-
9990-
var loginUrlUnderlyingCallsCount = 0
9991-
open var loginUrlCallsCount: Int {
9992-
get {
9993-
if Thread.isMainThread {
9994-
return loginUrlUnderlyingCallsCount
9995-
} else {
9996-
var returnValue: Int? = nil
9997-
DispatchQueue.main.sync {
9998-
returnValue = loginUrlUnderlyingCallsCount
9999-
}
10000-
10001-
return returnValue!
10002-
}
10003-
}
10004-
set {
10005-
if Thread.isMainThread {
10006-
loginUrlUnderlyingCallsCount = newValue
10007-
} else {
10008-
DispatchQueue.main.sync {
10009-
loginUrlUnderlyingCallsCount = newValue
10010-
}
10011-
}
10012-
}
10013-
}
10014-
open var loginUrlCalled: Bool {
10015-
return loginUrlCallsCount > 0
10016-
}
10017-
10018-
var loginUrlUnderlyingReturnValue: String!
10019-
open var loginUrlReturnValue: String! {
10020-
get {
10021-
if Thread.isMainThread {
10022-
return loginUrlUnderlyingReturnValue
10023-
} else {
10024-
var returnValue: String? = nil
10025-
DispatchQueue.main.sync {
10026-
returnValue = loginUrlUnderlyingReturnValue
10027-
}
10028-
10029-
return returnValue!
10030-
}
10031-
}
10032-
set {
10033-
if Thread.isMainThread {
10034-
loginUrlUnderlyingReturnValue = newValue
10035-
} else {
10036-
DispatchQueue.main.sync {
10037-
loginUrlUnderlyingReturnValue = newValue
10038-
}
10039-
}
10040-
}
10041-
}
10042-
open var loginUrlClosure: (() -> String)?
10043-
10044-
open override func loginUrl() -> String {
10045-
loginUrlCallsCount += 1
10046-
if let loginUrlClosure = loginUrlClosure {
10047-
return loginUrlClosure()
10048-
} else {
10049-
return loginUrlReturnValue
10050-
}
10051-
}
10052-
}
100539977
open class QrCodeDataSDKMock: MatrixRustSDK.QrCodeData {
100549978
init() {
100559979
super.init(noPointer: .init())
@@ -18686,8 +18610,8 @@ open class TimelineSDKMock: MatrixRustSDK.Timeline {
1868618610
open var editItemNewContentCalled: Bool {
1868718611
return editItemNewContentCallsCount > 0
1868818612
}
18689-
open var editItemNewContentReceivedArguments: (item: EventTimelineItem, newContent: RoomMessageEventContentWithoutRelation)?
18690-
open var editItemNewContentReceivedInvocations: [(item: EventTimelineItem, newContent: RoomMessageEventContentWithoutRelation)] = []
18613+
open var editItemNewContentReceivedArguments: (item: EventTimelineItem, newContent: EditedContent)?
18614+
open var editItemNewContentReceivedInvocations: [(item: EventTimelineItem, newContent: EditedContent)] = []
1869118615

1869218616
var editItemNewContentUnderlyingReturnValue: Bool!
1869318617
open var editItemNewContentReturnValue: Bool! {
@@ -18713,9 +18637,9 @@ open class TimelineSDKMock: MatrixRustSDK.Timeline {
1871318637
}
1871418638
}
1871518639
}
18716-
open var editItemNewContentClosure: ((EventTimelineItem, RoomMessageEventContentWithoutRelation) async throws -> Bool)?
18640+
open var editItemNewContentClosure: ((EventTimelineItem, EditedContent) async throws -> Bool)?
1871718641

18718-
open override func edit(item: EventTimelineItem, newContent: RoomMessageEventContentWithoutRelation) async throws -> Bool {
18642+
open override func edit(item: EventTimelineItem, newContent: EditedContent) async throws -> Bool {
1871918643
if let error = editItemNewContentThrowableError {
1872018644
throw error
1872118645
}
@@ -18731,52 +18655,6 @@ open class TimelineSDKMock: MatrixRustSDK.Timeline {
1873118655
}
1873218656
}
1873318657

18734-
//MARK: - editPoll
18735-
18736-
open var editPollQuestionAnswersMaxSelectionsPollKindEditItemThrowableError: Error?
18737-
var editPollQuestionAnswersMaxSelectionsPollKindEditItemUnderlyingCallsCount = 0
18738-
open var editPollQuestionAnswersMaxSelectionsPollKindEditItemCallsCount: Int {
18739-
get {
18740-
if Thread.isMainThread {
18741-
return editPollQuestionAnswersMaxSelectionsPollKindEditItemUnderlyingCallsCount
18742-
} else {
18743-
var returnValue: Int? = nil
18744-
DispatchQueue.main.sync {
18745-
returnValue = editPollQuestionAnswersMaxSelectionsPollKindEditItemUnderlyingCallsCount
18746-
}
18747-
18748-
return returnValue!
18749-
}
18750-
}
18751-
set {
18752-
if Thread.isMainThread {
18753-
editPollQuestionAnswersMaxSelectionsPollKindEditItemUnderlyingCallsCount = newValue
18754-
} else {
18755-
DispatchQueue.main.sync {
18756-
editPollQuestionAnswersMaxSelectionsPollKindEditItemUnderlyingCallsCount = newValue
18757-
}
18758-
}
18759-
}
18760-
}
18761-
open var editPollQuestionAnswersMaxSelectionsPollKindEditItemCalled: Bool {
18762-
return editPollQuestionAnswersMaxSelectionsPollKindEditItemCallsCount > 0
18763-
}
18764-
open var editPollQuestionAnswersMaxSelectionsPollKindEditItemReceivedArguments: (question: String, answers: [String], maxSelections: UInt8, pollKind: PollKind, editItem: EventTimelineItem)?
18765-
open var editPollQuestionAnswersMaxSelectionsPollKindEditItemReceivedInvocations: [(question: String, answers: [String], maxSelections: UInt8, pollKind: PollKind, editItem: EventTimelineItem)] = []
18766-
open var editPollQuestionAnswersMaxSelectionsPollKindEditItemClosure: ((String, [String], UInt8, PollKind, EventTimelineItem) async throws -> Void)?
18767-
18768-
open override func editPoll(question: String, answers: [String], maxSelections: UInt8, pollKind: PollKind, editItem: EventTimelineItem) async throws {
18769-
if let error = editPollQuestionAnswersMaxSelectionsPollKindEditItemThrowableError {
18770-
throw error
18771-
}
18772-
editPollQuestionAnswersMaxSelectionsPollKindEditItemCallsCount += 1
18773-
editPollQuestionAnswersMaxSelectionsPollKindEditItemReceivedArguments = (question: question, answers: answers, maxSelections: maxSelections, pollKind: pollKind, editItem: editItem)
18774-
DispatchQueue.main.async {
18775-
self.editPollQuestionAnswersMaxSelectionsPollKindEditItemReceivedInvocations.append((question: question, answers: answers, maxSelections: maxSelections, pollKind: pollKind, editItem: editItem))
18776-
}
18777-
try await editPollQuestionAnswersMaxSelectionsPollKindEditItemClosure?(question, answers, maxSelections, pollKind, editItem)
18778-
}
18779-
1878018658
//MARK: - endPoll
1878118659

1878218660
open var endPollPollStartIdTextThrowableError: Error?

ElementX/Sources/Services/Timeline/TimelineProxy.swift

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ final class TimelineProxy: TimelineProxyProtocol {
156156

157157
func edit(_ timelineItem: EventTimelineItem, newContent: RoomMessageEventContentWithoutRelation) async -> Result<Void, TimelineProxyError> {
158158
do {
159-
guard try await timeline.edit(item: timelineItem, newContent: newContent) == true else {
159+
guard try await timeline.edit(item: timelineItem, newContent: .roomMessage(content: newContent)) == true else {
160160
return .failure(.failedEditing)
161161
}
162162

@@ -460,7 +460,13 @@ final class TimelineProxy: TimelineProxyProtocol {
460460
do {
461461
let originalEvent = try await timeline.getEventTimelineItemByEventId(eventId: eventID)
462462

463-
try await timeline.editPoll(question: question, answers: answers, maxSelections: 1, pollKind: .init(pollKind: pollKind), editItem: originalEvent)
463+
guard try await timeline.edit(item: originalEvent,
464+
newContent: .pollStart(pollData: .init(question: question,
465+
answers: answers,
466+
maxSelections: 1,
467+
pollKind: .init(pollKind: pollKind)))) else {
468+
return .failure(.failedEditing)
469+
}
464470

465471
MXLog.info("Finished editing poll with eventID: \(eventID)")
466472

Lines changed: 2 additions & 2 deletions
Loading
Lines changed: 2 additions & 2 deletions
Loading
Lines changed: 2 additions & 2 deletions
Loading
Lines changed: 2 additions & 2 deletions
Loading

project.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ packages:
6060
# Element/Matrix dependencies
6161
MatrixRustSDK:
6262
url: https://github.com/element-hq/matrix-rust-components-swift
63-
exactVersion: 1.0.46
63+
exactVersion: 1.0.47
6464
# path: ../matrix-rust-sdk
6565
Compound:
6666
url: https://github.com/element-hq/compound-ios

0 commit comments

Comments
 (0)