Skip to content

Commit b4705d9

Browse files
committed
Bump to version v1.0.78 (matrix-rust-sdk/main ee93c27)
1 parent 4e01a94 commit b4705d9

File tree

3 files changed

+223
-2
lines changed

3 files changed

+223
-2
lines changed

Package.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// swift-tools-version:5.9
22
// The swift-tools-version declares the minimum version of Swift required to build this package.
33
import PackageDescription
4-
let checksum = "8b2e9ca1ff9b3ec731f51f4bea549b46121c68368b949c88171390d6aad40928"
5-
let version = "v1.0.77"
4+
let checksum = "07d1f941378b9c65399028dea96a0b2673bc7bf281b7de7d7c7284a1142e4549"
5+
let version = "v1.0.78"
66
let url = "https://github.com/element-hq/matrix-rust-components-swift/releases/download/\(version)/MatrixSDKFFI.xcframework.zip"
77
let package = Package(
88
name: "MatrixRustSDK",

Sources/MatrixRustSDK/matrix_sdk_crypto.swift

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1111,6 +1111,21 @@ public enum UtdCause {
11111111
* [`UtdCause::SentBeforeWeJoined`] for that).
11121112
*/
11131113
case historicalMessage
1114+
/**
1115+
* The keys for this event are intentionally withheld.
1116+
*
1117+
* The sender has refused to share the key because our device does not meet
1118+
* the sender's security requirements.
1119+
*/
1120+
case withheldForUnverifiedOrInsecureDevice
1121+
/**
1122+
* The keys for this event are missing, likely because the sender was
1123+
* unable to share them (e.g., failure to establish an Olm 1:1
1124+
* channel). Alternatively, the sender may have deliberately excluded
1125+
* this device by cherry-picking and blocking it, in which case, no action
1126+
* can be taken on our side.
1127+
*/
1128+
case withheldBySender
11141129
}
11151130

11161131

@@ -1133,6 +1148,10 @@ public struct FfiConverterTypeUtdCause: FfiConverterRustBuffer {
11331148

11341149
case 6: return .historicalMessage
11351150

1151+
case 7: return .withheldForUnverifiedOrInsecureDevice
1152+
1153+
case 8: return .withheldBySender
1154+
11361155
default: throw UniffiInternalError.unexpectedEnumCase
11371156
}
11381157
}
@@ -1164,6 +1183,14 @@ public struct FfiConverterTypeUtdCause: FfiConverterRustBuffer {
11641183
case .historicalMessage:
11651184
writeInt(&buf, Int32(6))
11661185

1186+
1187+
case .withheldForUnverifiedOrInsecureDevice:
1188+
writeInt(&buf, Int32(7))
1189+
1190+
1191+
case .withheldBySender:
1192+
writeInt(&buf, Int32(8))
1193+
11671194
}
11681195
}
11691196
}

Sources/MatrixRustSDK/matrix_sdk_ffi.swift

Lines changed: 194 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5032,6 +5032,24 @@ public protocol RoomProtocol : AnyObject {
50325032

50335033
func membership() -> Membership
50345034

5035+
/**
5036+
* A timeline instance that can be configured to only include RoomMessage
5037+
* type events and filter those further based on their message type.
5038+
*
5039+
* Virtual timeline items will still be provided and the
5040+
* `default_event_filter` will be applied before everything else.
5041+
*
5042+
* # Arguments
5043+
*
5044+
* * `internal_id_prefix` - An optional String that will be prepended to
5045+
* all the timeline item's internal IDs, making it possible to
5046+
* distinguish different timeline instances from each other.
5047+
*
5048+
* * `allowed_message_types` - A list of `RoomMessageEventMessageType` that
5049+
* will be allowed to appear in the timeline
5050+
*/
5051+
func messageFilteredTimeline(internalIdPrefix: String?, allowedMessageTypes: [RoomMessageEventMessageType]) async throws -> Timeline
5052+
50355053
func ownUserId() -> String
50365054

50375055
func pinnedEventsTimeline(internalIdPrefix: String?, maxEventsToLoad: UInt16, maxConcurrentRequests: UInt16) async throws -> Timeline
@@ -5980,6 +5998,39 @@ open func membership() -> Membership {
59805998
})
59815999
}
59826000

6001+
/**
6002+
* A timeline instance that can be configured to only include RoomMessage
6003+
* type events and filter those further based on their message type.
6004+
*
6005+
* Virtual timeline items will still be provided and the
6006+
* `default_event_filter` will be applied before everything else.
6007+
*
6008+
* # Arguments
6009+
*
6010+
* * `internal_id_prefix` - An optional String that will be prepended to
6011+
* all the timeline item's internal IDs, making it possible to
6012+
* distinguish different timeline instances from each other.
6013+
*
6014+
* * `allowed_message_types` - A list of `RoomMessageEventMessageType` that
6015+
* will be allowed to appear in the timeline
6016+
*/
6017+
open func messageFilteredTimeline(internalIdPrefix: String?, allowedMessageTypes: [RoomMessageEventMessageType])async throws -> Timeline {
6018+
return
6019+
try await uniffiRustCallAsync(
6020+
rustFutureFunc: {
6021+
uniffi_matrix_sdk_ffi_fn_method_room_message_filtered_timeline(
6022+
self.uniffiClonePointer(),
6023+
FfiConverterOptionString.lower(internalIdPrefix),FfiConverterSequenceTypeRoomMessageEventMessageType.lower(allowedMessageTypes)
6024+
)
6025+
},
6026+
pollFunc: ffi_matrix_sdk_ffi_rust_future_poll_pointer,
6027+
completeFunc: ffi_matrix_sdk_ffi_rust_future_complete_pointer,
6028+
freeFunc: ffi_matrix_sdk_ffi_rust_future_free_pointer,
6029+
liftFunc: FfiConverterTypeTimeline.lift,
6030+
errorHandler: FfiConverterTypeClientError.lift
6031+
)
6032+
}
6033+
59836034
open func ownUserId() -> String {
59846035
return try! FfiConverterString.lift(try! rustCall() {
59856036
uniffi_matrix_sdk_ffi_fn_method_room_own_user_id(self.uniffiClonePointer(),$0
@@ -22444,6 +22495,124 @@ extension RoomListServiceSyncIndicator: Equatable, Hashable {}
2244422495

2244522496

2244622497

22498+
// Note that we don't yet support `indirect` for enums.
22499+
// See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion.
22500+
22501+
public enum RoomMessageEventMessageType {
22502+
22503+
case audio
22504+
case emote
22505+
case file
22506+
case image
22507+
case location
22508+
case notice
22509+
case serverNotice
22510+
case text
22511+
case video
22512+
case verificationRequest
22513+
case other
22514+
}
22515+
22516+
22517+
public struct FfiConverterTypeRoomMessageEventMessageType: FfiConverterRustBuffer {
22518+
typealias SwiftType = RoomMessageEventMessageType
22519+
22520+
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> RoomMessageEventMessageType {
22521+
let variant: Int32 = try readInt(&buf)
22522+
switch variant {
22523+
22524+
case 1: return .audio
22525+
22526+
case 2: return .emote
22527+
22528+
case 3: return .file
22529+
22530+
case 4: return .image
22531+
22532+
case 5: return .location
22533+
22534+
case 6: return .notice
22535+
22536+
case 7: return .serverNotice
22537+
22538+
case 8: return .text
22539+
22540+
case 9: return .video
22541+
22542+
case 10: return .verificationRequest
22543+
22544+
case 11: return .other
22545+
22546+
default: throw UniffiInternalError.unexpectedEnumCase
22547+
}
22548+
}
22549+
22550+
public static func write(_ value: RoomMessageEventMessageType, into buf: inout [UInt8]) {
22551+
switch value {
22552+
22553+
22554+
case .audio:
22555+
writeInt(&buf, Int32(1))
22556+
22557+
22558+
case .emote:
22559+
writeInt(&buf, Int32(2))
22560+
22561+
22562+
case .file:
22563+
writeInt(&buf, Int32(3))
22564+
22565+
22566+
case .image:
22567+
writeInt(&buf, Int32(4))
22568+
22569+
22570+
case .location:
22571+
writeInt(&buf, Int32(5))
22572+
22573+
22574+
case .notice:
22575+
writeInt(&buf, Int32(6))
22576+
22577+
22578+
case .serverNotice:
22579+
writeInt(&buf, Int32(7))
22580+
22581+
22582+
case .text:
22583+
writeInt(&buf, Int32(8))
22584+
22585+
22586+
case .video:
22587+
writeInt(&buf, Int32(9))
22588+
22589+
22590+
case .verificationRequest:
22591+
writeInt(&buf, Int32(10))
22592+
22593+
22594+
case .other:
22595+
writeInt(&buf, Int32(11))
22596+
22597+
}
22598+
}
22599+
}
22600+
22601+
22602+
public func FfiConverterTypeRoomMessageEventMessageType_lift(_ buf: RustBuffer) throws -> RoomMessageEventMessageType {
22603+
return try FfiConverterTypeRoomMessageEventMessageType.lift(buf)
22604+
}
22605+
22606+
public func FfiConverterTypeRoomMessageEventMessageType_lower(_ value: RoomMessageEventMessageType) -> RustBuffer {
22607+
return FfiConverterTypeRoomMessageEventMessageType.lower(value)
22608+
}
22609+
22610+
22611+
22612+
extension RoomMessageEventMessageType: Equatable, Hashable {}
22613+
22614+
22615+
2244722616
// Note that we don't yet support `indirect` for enums.
2244822617
// See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion.
2244922618
/**
@@ -28380,6 +28549,28 @@ fileprivate struct FfiConverterSequenceTypeRoomListEntriesUpdate: FfiConverterRu
2838028549
}
2838128550
}
2838228551

28552+
fileprivate struct FfiConverterSequenceTypeRoomMessageEventMessageType: FfiConverterRustBuffer {
28553+
typealias SwiftType = [RoomMessageEventMessageType]
28554+
28555+
public static func write(_ value: [RoomMessageEventMessageType], into buf: inout [UInt8]) {
28556+
let len = Int32(value.count)
28557+
writeInt(&buf, len)
28558+
for item in value {
28559+
FfiConverterTypeRoomMessageEventMessageType.write(item, into: &buf)
28560+
}
28561+
}
28562+
28563+
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> [RoomMessageEventMessageType] {
28564+
let len: Int32 = try readInt(&buf)
28565+
var seq = [RoomMessageEventMessageType]()
28566+
seq.reserveCapacity(Int(len))
28567+
for _ in 0 ..< len {
28568+
seq.append(try FfiConverterTypeRoomMessageEventMessageType.read(from: &buf))
28569+
}
28570+
return seq
28571+
}
28572+
}
28573+
2838328574
fileprivate struct FfiConverterSequenceTypeSlidingSyncVersion: FfiConverterRustBuffer {
2838428575
typealias SwiftType = [SlidingSyncVersion]
2838528576

@@ -29551,6 +29742,9 @@ private var initializationResult: InitializationResult = {
2955129742
if (uniffi_matrix_sdk_ffi_checksum_method_room_membership() != 26065) {
2955229743
return InitializationResult.apiChecksumMismatch
2955329744
}
29745+
if (uniffi_matrix_sdk_ffi_checksum_method_room_message_filtered_timeline() != 47862) {
29746+
return InitializationResult.apiChecksumMismatch
29747+
}
2955429748
if (uniffi_matrix_sdk_ffi_checksum_method_room_own_user_id() != 39510) {
2955529749
return InitializationResult.apiChecksumMismatch
2955629750
}

0 commit comments

Comments
 (0)