Skip to content

Commit 4e09242

Browse files
committed
Bump to version v1.0.68 (matrix-rust-sdk/main 4724648)
1 parent 5f23a9b commit 4e09242

File tree

2 files changed

+147
-11
lines changed

2 files changed

+147
-11
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 = "38b6403b22ff90a3e240677603fd0ac6db33a736258c367f03d5d0b63936452e"
5-
let version = "v1.0.67"
4+
let checksum = "152efd17d2d75a2cc942d9e64ae8bceb95b523714f508ca4b855610070339145"
5+
let version = "v1.0.68"
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_ffi.swift

Lines changed: 145 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7895,6 +7895,11 @@ public protocol RoomPreviewProtocol : AnyObject {
78957895
*/
78967896
func info() throws -> RoomPreviewInfo
78977897

7898+
/**
7899+
* Get the user who created the invite, if any.
7900+
*/
7901+
func inviter() async -> RoomMember?
7902+
78987903
/**
78997904
* Leave the room if the room preview state is either joined, invited or
79007905
* knocked.
@@ -7960,6 +7965,27 @@ open func info()throws -> RoomPreviewInfo {
79607965
})
79617966
}
79627967

7968+
/**
7969+
* Get the user who created the invite, if any.
7970+
*/
7971+
open func inviter()async -> RoomMember? {
7972+
return
7973+
try! await uniffiRustCallAsync(
7974+
rustFutureFunc: {
7975+
uniffi_matrix_sdk_ffi_fn_method_roompreview_inviter(
7976+
self.uniffiClonePointer()
7977+
7978+
)
7979+
},
7980+
pollFunc: ffi_matrix_sdk_ffi_rust_future_poll_rust_buffer,
7981+
completeFunc: ffi_matrix_sdk_ffi_rust_future_complete_rust_buffer,
7982+
freeFunc: ffi_matrix_sdk_ffi_rust_future_free_rust_buffer,
7983+
liftFunc: FfiConverterOptionTypeRoomMember.lift,
7984+
errorHandler: nil
7985+
7986+
)
7987+
}
7988+
79637989
/**
79647990
* Leave the room if the room preview state is either joined, invited or
79657991
* knocked.
@@ -9583,7 +9609,7 @@ public protocol TimelineProtocol : AnyObject {
95839609

95849610
func sendAudio(url: String, audioInfo: AudioInfo, caption: String?, formattedCaption: FormattedBody?, progressWatcher: ProgressWatcher?, useSendQueue: Bool) -> SendAttachmentJoinHandle
95859611

9586-
func sendFile(url: String, fileInfo: FileInfo, progressWatcher: ProgressWatcher?, useSendQueue: Bool) -> SendAttachmentJoinHandle
9612+
func sendFile(url: String, fileInfo: FileInfo, caption: String?, formattedCaption: FormattedBody?, progressWatcher: ProgressWatcher?, useSendQueue: Bool) -> SendAttachmentJoinHandle
95879613

95889614
func sendImage(url: String, thumbnailUrl: String?, imageInfo: ImageInfo, caption: String?, formattedCaption: FormattedBody?, progressWatcher: ProgressWatcher?, useSendQueue: Bool) -> SendAttachmentJoinHandle
95899615

@@ -9996,11 +10022,13 @@ open func sendAudio(url: String, audioInfo: AudioInfo, caption: String?, formatt
999610022
})
999710023
}
999810024

9999-
open func sendFile(url: String, fileInfo: FileInfo, progressWatcher: ProgressWatcher?, useSendQueue: Bool) -> SendAttachmentJoinHandle {
10025+
open func sendFile(url: String, fileInfo: FileInfo, caption: String?, formattedCaption: FormattedBody?, progressWatcher: ProgressWatcher?, useSendQueue: Bool) -> SendAttachmentJoinHandle {
1000010026
return try! FfiConverterTypeSendAttachmentJoinHandle.lift(try! rustCall() {
1000110027
uniffi_matrix_sdk_ffi_fn_method_timeline_send_file(self.uniffiClonePointer(),
1000210028
FfiConverterString.lower(url),
1000310029
FfiConverterTypeFileInfo.lower(fileInfo),
10030+
FfiConverterOptionString.lower(caption),
10031+
FfiConverterOptionTypeFormattedBody.lower(formattedCaption),
1000410032
FfiConverterOptionCallbackInterfaceProgressWatcher.lower(progressWatcher),
1000510033
FfiConverterBool.lower(useSendQueue),$0
1000610034
)
@@ -15119,10 +15147,14 @@ public struct RoomPreviewInfo {
1511915147
* The number of joined members.
1512015148
*/
1512115149
public var numJoinedMembers: UInt64
15150+
/**
15151+
* The number of active members, if known (joined + invited).
15152+
*/
15153+
public var numActiveMembers: UInt64?
1512215154
/**
1512315155
* The room type (space, custom) or nothing, if it's a regular room.
1512415156
*/
15125-
public var roomType: String?
15157+
public var roomType: RoomType
1512615158
/**
1512715159
* Is the history world-readable for this room?
1512815160
*/
@@ -15135,6 +15167,10 @@ public struct RoomPreviewInfo {
1513515167
* The join rule for this room (private, public, knock, etc.).
1513615168
*/
1513715169
public var joinRule: JoinRule
15170+
/**
15171+
* Whether the room is direct or not, if known.
15172+
*/
15173+
public var isDirect: Bool?
1513815174

1513915175
// Default memberwise initializers are never public by default, so we
1514015176
// declare one manually.
@@ -15157,9 +15193,12 @@ public struct RoomPreviewInfo {
1515715193
/**
1515815194
* The number of joined members.
1515915195
*/numJoinedMembers: UInt64,
15196+
/**
15197+
* The number of active members, if known (joined + invited).
15198+
*/numActiveMembers: UInt64?,
1516015199
/**
1516115200
* The room type (space, custom) or nothing, if it's a regular room.
15162-
*/roomType: String?,
15201+
*/roomType: RoomType,
1516315202
/**
1516415203
* Is the history world-readable for this room?
1516515204
*/isHistoryWorldReadable: Bool,
@@ -15168,17 +15207,22 @@ public struct RoomPreviewInfo {
1516815207
*/membership: Membership?,
1516915208
/**
1517015209
* The join rule for this room (private, public, knock, etc.).
15171-
*/joinRule: JoinRule) {
15210+
*/joinRule: JoinRule,
15211+
/**
15212+
* Whether the room is direct or not, if known.
15213+
*/isDirect: Bool?) {
1517215214
self.roomId = roomId
1517315215
self.canonicalAlias = canonicalAlias
1517415216
self.name = name
1517515217
self.topic = topic
1517615218
self.avatarUrl = avatarUrl
1517715219
self.numJoinedMembers = numJoinedMembers
15220+
self.numActiveMembers = numActiveMembers
1517815221
self.roomType = roomType
1517915222
self.isHistoryWorldReadable = isHistoryWorldReadable
1518015223
self.membership = membership
1518115224
self.joinRule = joinRule
15225+
self.isDirect = isDirect
1518215226
}
1518315227
}
1518415228

@@ -15204,6 +15248,9 @@ extension RoomPreviewInfo: Equatable, Hashable {
1520415248
if lhs.numJoinedMembers != rhs.numJoinedMembers {
1520515249
return false
1520615250
}
15251+
if lhs.numActiveMembers != rhs.numActiveMembers {
15252+
return false
15253+
}
1520715254
if lhs.roomType != rhs.roomType {
1520815255
return false
1520915256
}
@@ -15216,6 +15263,9 @@ extension RoomPreviewInfo: Equatable, Hashable {
1521615263
if lhs.joinRule != rhs.joinRule {
1521715264
return false
1521815265
}
15266+
if lhs.isDirect != rhs.isDirect {
15267+
return false
15268+
}
1521915269
return true
1522015270
}
1522115271

@@ -15226,10 +15276,12 @@ extension RoomPreviewInfo: Equatable, Hashable {
1522615276
hasher.combine(topic)
1522715277
hasher.combine(avatarUrl)
1522815278
hasher.combine(numJoinedMembers)
15279+
hasher.combine(numActiveMembers)
1522915280
hasher.combine(roomType)
1523015281
hasher.combine(isHistoryWorldReadable)
1523115282
hasher.combine(membership)
1523215283
hasher.combine(joinRule)
15284+
hasher.combine(isDirect)
1523315285
}
1523415286
}
1523515287

@@ -15244,10 +15296,12 @@ public struct FfiConverterTypeRoomPreviewInfo: FfiConverterRustBuffer {
1524415296
topic: FfiConverterOptionString.read(from: &buf),
1524515297
avatarUrl: FfiConverterOptionString.read(from: &buf),
1524615298
numJoinedMembers: FfiConverterUInt64.read(from: &buf),
15247-
roomType: FfiConverterOptionString.read(from: &buf),
15299+
numActiveMembers: FfiConverterOptionUInt64.read(from: &buf),
15300+
roomType: FfiConverterTypeRoomType.read(from: &buf),
1524815301
isHistoryWorldReadable: FfiConverterBool.read(from: &buf),
1524915302
membership: FfiConverterOptionTypeMembership.read(from: &buf),
15250-
joinRule: FfiConverterTypeJoinRule.read(from: &buf)
15303+
joinRule: FfiConverterTypeJoinRule.read(from: &buf),
15304+
isDirect: FfiConverterOptionBool.read(from: &buf)
1525115305
)
1525215306
}
1525315307

@@ -15258,10 +15312,12 @@ public struct FfiConverterTypeRoomPreviewInfo: FfiConverterRustBuffer {
1525815312
FfiConverterOptionString.write(value.topic, into: &buf)
1525915313
FfiConverterOptionString.write(value.avatarUrl, into: &buf)
1526015314
FfiConverterUInt64.write(value.numJoinedMembers, into: &buf)
15261-
FfiConverterOptionString.write(value.roomType, into: &buf)
15315+
FfiConverterOptionUInt64.write(value.numActiveMembers, into: &buf)
15316+
FfiConverterTypeRoomType.write(value.roomType, into: &buf)
1526215317
FfiConverterBool.write(value.isHistoryWorldReadable, into: &buf)
1526315318
FfiConverterOptionTypeMembership.write(value.membership, into: &buf)
1526415319
FfiConverterTypeJoinRule.write(value.joinRule, into: &buf)
15320+
FfiConverterOptionBool.write(value.isDirect, into: &buf)
1526515321
}
1526615322
}
1526715323

@@ -22475,6 +22531,83 @@ extension RoomPreset: Equatable, Hashable {}
2247522531

2247622532

2247722533

22534+
// Note that we don't yet support `indirect` for enums.
22535+
// See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion.
22536+
/**
22537+
* The type of room for a [`RoomPreviewInfo`].
22538+
*/
22539+
22540+
public enum RoomType {
22541+
22542+
/**
22543+
* It's a plain chat room.
22544+
*/
22545+
case room
22546+
/**
22547+
* It's a space that can group several rooms.
22548+
*/
22549+
case space
22550+
/**
22551+
* It's a custom implementation.
22552+
*/
22553+
case custom(value: String
22554+
)
22555+
}
22556+
22557+
22558+
public struct FfiConverterTypeRoomType: FfiConverterRustBuffer {
22559+
typealias SwiftType = RoomType
22560+
22561+
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> RoomType {
22562+
let variant: Int32 = try readInt(&buf)
22563+
switch variant {
22564+
22565+
case 1: return .room
22566+
22567+
case 2: return .space
22568+
22569+
case 3: return .custom(value: try FfiConverterString.read(from: &buf)
22570+
)
22571+
22572+
default: throw UniffiInternalError.unexpectedEnumCase
22573+
}
22574+
}
22575+
22576+
public static func write(_ value: RoomType, into buf: inout [UInt8]) {
22577+
switch value {
22578+
22579+
22580+
case .room:
22581+
writeInt(&buf, Int32(1))
22582+
22583+
22584+
case .space:
22585+
writeInt(&buf, Int32(2))
22586+
22587+
22588+
case let .custom(value):
22589+
writeInt(&buf, Int32(3))
22590+
FfiConverterString.write(value, into: &buf)
22591+
22592+
}
22593+
}
22594+
}
22595+
22596+
22597+
public func FfiConverterTypeRoomType_lift(_ buf: RustBuffer) throws -> RoomType {
22598+
return try FfiConverterTypeRoomType.lift(buf)
22599+
}
22600+
22601+
public func FfiConverterTypeRoomType_lower(_ value: RoomType) -> RustBuffer {
22602+
return FfiConverterTypeRoomType.lower(value)
22603+
}
22604+
22605+
22606+
22607+
extension RoomType: Equatable, Hashable {}
22608+
22609+
22610+
2247822611
// Note that we don't yet support `indirect` for enums.
2247922612
// See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion.
2248022613

@@ -29518,6 +29651,9 @@ private var initializationResult: InitializationResult = {
2951829651
if (uniffi_matrix_sdk_ffi_checksum_method_roompreview_info() != 9145) {
2951929652
return InitializationResult.apiChecksumMismatch
2952029653
}
29654+
if (uniffi_matrix_sdk_ffi_checksum_method_roompreview_inviter() != 1297) {
29655+
return InitializationResult.apiChecksumMismatch
29656+
}
2952129657
if (uniffi_matrix_sdk_ffi_checksum_method_roompreview_leave() != 5096) {
2952229658
return InitializationResult.apiChecksumMismatch
2952329659
}
@@ -29656,7 +29792,7 @@ private var initializationResult: InitializationResult = {
2965629792
if (uniffi_matrix_sdk_ffi_checksum_method_timeline_send_audio() != 43163) {
2965729793
return InitializationResult.apiChecksumMismatch
2965829794
}
29659-
if (uniffi_matrix_sdk_ffi_checksum_method_timeline_send_file() != 35408) {
29795+
if (uniffi_matrix_sdk_ffi_checksum_method_timeline_send_file() != 37925) {
2966029796
return InitializationResult.apiChecksumMismatch
2966129797
}
2966229798
if (uniffi_matrix_sdk_ffi_checksum_method_timeline_send_image() != 45681) {

0 commit comments

Comments
 (0)