Sdk v1.0.47 (#3265)

This commit is contained in:
Mauro
2024-09-11 15:55:15 +02:00
committed by GitHub
parent 6973e8b571
commit 82befbc8f0
9 changed files with 24 additions and 140 deletions

View File

@@ -7691,7 +7691,7 @@
repositoryURL = "https://github.com/element-hq/matrix-rust-components-swift";
requirement = {
kind = exactVersion;
version = 1.0.46;
version = 1.0.47;
};
};
701C7BEF8F70F7A83E852DCC /* XCRemoteSwiftPackageReference "GZIP" */ = {

View File

@@ -149,8 +149,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/element-hq/matrix-rust-components-swift",
"state" : {
"revision" : "50f8730000a1cc9ebe75ecf879c2b85b36adfd34",
"version" : "1.0.46"
"revision" : "5de28d48e35bcb19ba94bf1cbc7baec41281a54a",
"version" : "1.0.47"
}
},
{

View File

@@ -9974,82 +9974,6 @@ open class NotificationSettingsSDKMock: MatrixRustSDK.NotificationSettings {
try await unmuteRoomRoomIdIsEncryptedIsOneToOneClosure?(roomId, isEncrypted, isOneToOne)
}
}
open class OidcAuthorizationDataSDKMock: MatrixRustSDK.OidcAuthorizationData {
init() {
super.init(noPointer: .init())
}
public required init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) {
fatalError("init(unsafeFromRawPointer:) has not been implemented")
}
fileprivate var pointer: UnsafeMutableRawPointer!
//MARK: - loginUrl
var loginUrlUnderlyingCallsCount = 0
open var loginUrlCallsCount: Int {
get {
if Thread.isMainThread {
return loginUrlUnderlyingCallsCount
} else {
var returnValue: Int? = nil
DispatchQueue.main.sync {
returnValue = loginUrlUnderlyingCallsCount
}
return returnValue!
}
}
set {
if Thread.isMainThread {
loginUrlUnderlyingCallsCount = newValue
} else {
DispatchQueue.main.sync {
loginUrlUnderlyingCallsCount = newValue
}
}
}
}
open var loginUrlCalled: Bool {
return loginUrlCallsCount > 0
}
var loginUrlUnderlyingReturnValue: String!
open var loginUrlReturnValue: String! {
get {
if Thread.isMainThread {
return loginUrlUnderlyingReturnValue
} else {
var returnValue: String? = nil
DispatchQueue.main.sync {
returnValue = loginUrlUnderlyingReturnValue
}
return returnValue!
}
}
set {
if Thread.isMainThread {
loginUrlUnderlyingReturnValue = newValue
} else {
DispatchQueue.main.sync {
loginUrlUnderlyingReturnValue = newValue
}
}
}
}
open var loginUrlClosure: (() -> String)?
open override func loginUrl() -> String {
loginUrlCallsCount += 1
if let loginUrlClosure = loginUrlClosure {
return loginUrlClosure()
} else {
return loginUrlReturnValue
}
}
}
open class QrCodeDataSDKMock: MatrixRustSDK.QrCodeData {
init() {
super.init(noPointer: .init())
@@ -18686,8 +18610,8 @@ open class TimelineSDKMock: MatrixRustSDK.Timeline {
open var editItemNewContentCalled: Bool {
return editItemNewContentCallsCount > 0
}
open var editItemNewContentReceivedArguments: (item: EventTimelineItem, newContent: RoomMessageEventContentWithoutRelation)?
open var editItemNewContentReceivedInvocations: [(item: EventTimelineItem, newContent: RoomMessageEventContentWithoutRelation)] = []
open var editItemNewContentReceivedArguments: (item: EventTimelineItem, newContent: EditedContent)?
open var editItemNewContentReceivedInvocations: [(item: EventTimelineItem, newContent: EditedContent)] = []
var editItemNewContentUnderlyingReturnValue: Bool!
open var editItemNewContentReturnValue: Bool! {
@@ -18713,9 +18637,9 @@ open class TimelineSDKMock: MatrixRustSDK.Timeline {
}
}
}
open var editItemNewContentClosure: ((EventTimelineItem, RoomMessageEventContentWithoutRelation) async throws -> Bool)?
open var editItemNewContentClosure: ((EventTimelineItem, EditedContent) async throws -> Bool)?
open override func edit(item: EventTimelineItem, newContent: RoomMessageEventContentWithoutRelation) async throws -> Bool {
open override func edit(item: EventTimelineItem, newContent: EditedContent) async throws -> Bool {
if let error = editItemNewContentThrowableError {
throw error
}
@@ -18731,52 +18655,6 @@ open class TimelineSDKMock: MatrixRustSDK.Timeline {
}
}
//MARK: - editPoll
open var editPollQuestionAnswersMaxSelectionsPollKindEditItemThrowableError: Error?
var editPollQuestionAnswersMaxSelectionsPollKindEditItemUnderlyingCallsCount = 0
open var editPollQuestionAnswersMaxSelectionsPollKindEditItemCallsCount: Int {
get {
if Thread.isMainThread {
return editPollQuestionAnswersMaxSelectionsPollKindEditItemUnderlyingCallsCount
} else {
var returnValue: Int? = nil
DispatchQueue.main.sync {
returnValue = editPollQuestionAnswersMaxSelectionsPollKindEditItemUnderlyingCallsCount
}
return returnValue!
}
}
set {
if Thread.isMainThread {
editPollQuestionAnswersMaxSelectionsPollKindEditItemUnderlyingCallsCount = newValue
} else {
DispatchQueue.main.sync {
editPollQuestionAnswersMaxSelectionsPollKindEditItemUnderlyingCallsCount = newValue
}
}
}
}
open var editPollQuestionAnswersMaxSelectionsPollKindEditItemCalled: Bool {
return editPollQuestionAnswersMaxSelectionsPollKindEditItemCallsCount > 0
}
open var editPollQuestionAnswersMaxSelectionsPollKindEditItemReceivedArguments: (question: String, answers: [String], maxSelections: UInt8, pollKind: PollKind, editItem: EventTimelineItem)?
open var editPollQuestionAnswersMaxSelectionsPollKindEditItemReceivedInvocations: [(question: String, answers: [String], maxSelections: UInt8, pollKind: PollKind, editItem: EventTimelineItem)] = []
open var editPollQuestionAnswersMaxSelectionsPollKindEditItemClosure: ((String, [String], UInt8, PollKind, EventTimelineItem) async throws -> Void)?
open override func editPoll(question: String, answers: [String], maxSelections: UInt8, pollKind: PollKind, editItem: EventTimelineItem) async throws {
if let error = editPollQuestionAnswersMaxSelectionsPollKindEditItemThrowableError {
throw error
}
editPollQuestionAnswersMaxSelectionsPollKindEditItemCallsCount += 1
editPollQuestionAnswersMaxSelectionsPollKindEditItemReceivedArguments = (question: question, answers: answers, maxSelections: maxSelections, pollKind: pollKind, editItem: editItem)
DispatchQueue.main.async {
self.editPollQuestionAnswersMaxSelectionsPollKindEditItemReceivedInvocations.append((question: question, answers: answers, maxSelections: maxSelections, pollKind: pollKind, editItem: editItem))
}
try await editPollQuestionAnswersMaxSelectionsPollKindEditItemClosure?(question, answers, maxSelections, pollKind, editItem)
}
//MARK: - endPoll
open var endPollPollStartIdTextThrowableError: Error?

View File

@@ -156,7 +156,7 @@ final class TimelineProxy: TimelineProxyProtocol {
func edit(_ timelineItem: EventTimelineItem, newContent: RoomMessageEventContentWithoutRelation) async -> Result<Void, TimelineProxyError> {
do {
guard try await timeline.edit(item: timelineItem, newContent: newContent) == true else {
guard try await timeline.edit(item: timelineItem, newContent: .roomMessage(content: newContent)) == true else {
return .failure(.failedEditing)
}
@@ -460,7 +460,13 @@ final class TimelineProxy: TimelineProxyProtocol {
do {
let originalEvent = try await timeline.getEventTimelineItemByEventId(eventId: eventID)
try await timeline.editPoll(question: question, answers: answers, maxSelections: 1, pollKind: .init(pollKind: pollKind), editItem: originalEvent)
guard try await timeline.edit(item: originalEvent,
newContent: .pollStart(pollData: .init(question: question,
answers: answers,
maxSelections: 1,
pollKind: .init(pollKind: pollKind)))) else {
return .failure(.failedEditing)
}
MXLog.info("Finished editing poll with eventID: \(eventID)")

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:844ecf4b4fec3222a52ffb7f9ff9d72d811b48c2db6d42818ef8eb49f7d58fe4
size 736907
oid sha256:16cb69efcc65a15245bd2efeefb19c64de4ce1ea4480c3f863ae9d54eefdc5a0
size 783607

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:844ecf4b4fec3222a52ffb7f9ff9d72d811b48c2db6d42818ef8eb49f7d58fe4
size 736907
oid sha256:16cb69efcc65a15245bd2efeefb19c64de4ce1ea4480c3f863ae9d54eefdc5a0
size 783607

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ce287441bbdd630d0d7de7ec5b101002216e7528d77c81959526edf6a69e5718
size 493180
oid sha256:d8729c75cbd2a0d266c6bcd1e70464dd313ab527436d4b21c8f29b85b7321627
size 486978

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ce287441bbdd630d0d7de7ec5b101002216e7528d77c81959526edf6a69e5718
size 493180
oid sha256:d8729c75cbd2a0d266c6bcd1e70464dd313ab527436d4b21c8f29b85b7321627
size 486978

View File

@@ -60,7 +60,7 @@ packages:
# Element/Matrix dependencies
MatrixRustSDK:
url: https://github.com/element-hq/matrix-rust-components-swift
exactVersion: 1.0.46
exactVersion: 1.0.47
# path: ../matrix-rust-sdk
Compound:
url: https://github.com/element-hq/compound-ios