Skip to content

Commit

Permalink
Bump to version v1.0.68 (matrix-rust-sdk/main 47246483fa43d52ac79b8a6…
Browse files Browse the repository at this point in the history
…190b27577da5fd906)
  • Loading branch information
pixlwave committed Nov 18, 2024
1 parent 5f23a9b commit 4e09242
Show file tree
Hide file tree
Showing 2 changed files with 147 additions and 11 deletions.
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// swift-tools-version:5.9
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let checksum = "38b6403b22ff90a3e240677603fd0ac6db33a736258c367f03d5d0b63936452e"
let version = "v1.0.67"
let checksum = "152efd17d2d75a2cc942d9e64ae8bceb95b523714f508ca4b855610070339145"
let version = "v1.0.68"
let url = "https://github.com/element-hq/matrix-rust-components-swift/releases/download/\(version)/MatrixSDKFFI.xcframework.zip"
let package = Package(
name: "MatrixRustSDK",
Expand Down
154 changes: 145 additions & 9 deletions Sources/MatrixRustSDK/matrix_sdk_ffi.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7895,6 +7895,11 @@ public protocol RoomPreviewProtocol : AnyObject {
*/
func info() throws -> RoomPreviewInfo

/**
* Get the user who created the invite, if any.
*/
func inviter() async -> RoomMember?

/**
* Leave the room if the room preview state is either joined, invited or
* knocked.
Expand Down Expand Up @@ -7960,6 +7965,27 @@ open func info()throws -> RoomPreviewInfo {
})
}

/**
* Get the user who created the invite, if any.
*/
open func inviter()async -> RoomMember? {
return
try! await uniffiRustCallAsync(
rustFutureFunc: {
uniffi_matrix_sdk_ffi_fn_method_roompreview_inviter(
self.uniffiClonePointer()

)
},
pollFunc: ffi_matrix_sdk_ffi_rust_future_poll_rust_buffer,
completeFunc: ffi_matrix_sdk_ffi_rust_future_complete_rust_buffer,
freeFunc: ffi_matrix_sdk_ffi_rust_future_free_rust_buffer,
liftFunc: FfiConverterOptionTypeRoomMember.lift,
errorHandler: nil

)
}

/**
* Leave the room if the room preview state is either joined, invited or
* knocked.
Expand Down Expand Up @@ -9583,7 +9609,7 @@ public protocol TimelineProtocol : AnyObject {

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

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

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

Expand Down Expand Up @@ -9996,11 +10022,13 @@ open func sendAudio(url: String, audioInfo: AudioInfo, caption: String?, formatt
})
}

open func sendFile(url: String, fileInfo: FileInfo, progressWatcher: ProgressWatcher?, useSendQueue: Bool) -> SendAttachmentJoinHandle {
open func sendFile(url: String, fileInfo: FileInfo, caption: String?, formattedCaption: FormattedBody?, progressWatcher: ProgressWatcher?, useSendQueue: Bool) -> SendAttachmentJoinHandle {
return try! FfiConverterTypeSendAttachmentJoinHandle.lift(try! rustCall() {
uniffi_matrix_sdk_ffi_fn_method_timeline_send_file(self.uniffiClonePointer(),
FfiConverterString.lower(url),
FfiConverterTypeFileInfo.lower(fileInfo),
FfiConverterOptionString.lower(caption),
FfiConverterOptionTypeFormattedBody.lower(formattedCaption),
FfiConverterOptionCallbackInterfaceProgressWatcher.lower(progressWatcher),
FfiConverterBool.lower(useSendQueue),$0
)
Expand Down Expand Up @@ -15119,10 +15147,14 @@ public struct RoomPreviewInfo {
* The number of joined members.
*/
public var numJoinedMembers: UInt64
/**
* The number of active members, if known (joined + invited).
*/
public var numActiveMembers: UInt64?
/**
* The room type (space, custom) or nothing, if it's a regular room.
*/
public var roomType: String?
public var roomType: RoomType
/**
* Is the history world-readable for this room?
*/
Expand All @@ -15135,6 +15167,10 @@ public struct RoomPreviewInfo {
* The join rule for this room (private, public, knock, etc.).
*/
public var joinRule: JoinRule
/**
* Whether the room is direct or not, if known.
*/
public var isDirect: Bool?

// Default memberwise initializers are never public by default, so we
// declare one manually.
Expand All @@ -15157,9 +15193,12 @@ public struct RoomPreviewInfo {
/**
* The number of joined members.
*/numJoinedMembers: UInt64,
/**
* The number of active members, if known (joined + invited).
*/numActiveMembers: UInt64?,
/**
* The room type (space, custom) or nothing, if it's a regular room.
*/roomType: String?,
*/roomType: RoomType,
/**
* Is the history world-readable for this room?
*/isHistoryWorldReadable: Bool,
Expand All @@ -15168,17 +15207,22 @@ public struct RoomPreviewInfo {
*/membership: Membership?,
/**
* The join rule for this room (private, public, knock, etc.).
*/joinRule: JoinRule) {
*/joinRule: JoinRule,
/**
* Whether the room is direct or not, if known.
*/isDirect: Bool?) {
self.roomId = roomId
self.canonicalAlias = canonicalAlias
self.name = name
self.topic = topic
self.avatarUrl = avatarUrl
self.numJoinedMembers = numJoinedMembers
self.numActiveMembers = numActiveMembers
self.roomType = roomType
self.isHistoryWorldReadable = isHistoryWorldReadable
self.membership = membership
self.joinRule = joinRule
self.isDirect = isDirect
}
}

Expand All @@ -15204,6 +15248,9 @@ extension RoomPreviewInfo: Equatable, Hashable {
if lhs.numJoinedMembers != rhs.numJoinedMembers {
return false
}
if lhs.numActiveMembers != rhs.numActiveMembers {
return false
}
if lhs.roomType != rhs.roomType {
return false
}
Expand All @@ -15216,6 +15263,9 @@ extension RoomPreviewInfo: Equatable, Hashable {
if lhs.joinRule != rhs.joinRule {
return false
}
if lhs.isDirect != rhs.isDirect {
return false
}
return true
}

Expand All @@ -15226,10 +15276,12 @@ extension RoomPreviewInfo: Equatable, Hashable {
hasher.combine(topic)
hasher.combine(avatarUrl)
hasher.combine(numJoinedMembers)
hasher.combine(numActiveMembers)
hasher.combine(roomType)
hasher.combine(isHistoryWorldReadable)
hasher.combine(membership)
hasher.combine(joinRule)
hasher.combine(isDirect)
}
}

Expand All @@ -15244,10 +15296,12 @@ public struct FfiConverterTypeRoomPreviewInfo: FfiConverterRustBuffer {
topic: FfiConverterOptionString.read(from: &buf),
avatarUrl: FfiConverterOptionString.read(from: &buf),
numJoinedMembers: FfiConverterUInt64.read(from: &buf),
roomType: FfiConverterOptionString.read(from: &buf),
numActiveMembers: FfiConverterOptionUInt64.read(from: &buf),
roomType: FfiConverterTypeRoomType.read(from: &buf),
isHistoryWorldReadable: FfiConverterBool.read(from: &buf),
membership: FfiConverterOptionTypeMembership.read(from: &buf),
joinRule: FfiConverterTypeJoinRule.read(from: &buf)
joinRule: FfiConverterTypeJoinRule.read(from: &buf),
isDirect: FfiConverterOptionBool.read(from: &buf)
)
}

Expand All @@ -15258,10 +15312,12 @@ public struct FfiConverterTypeRoomPreviewInfo: FfiConverterRustBuffer {
FfiConverterOptionString.write(value.topic, into: &buf)
FfiConverterOptionString.write(value.avatarUrl, into: &buf)
FfiConverterUInt64.write(value.numJoinedMembers, into: &buf)
FfiConverterOptionString.write(value.roomType, into: &buf)
FfiConverterOptionUInt64.write(value.numActiveMembers, into: &buf)
FfiConverterTypeRoomType.write(value.roomType, into: &buf)
FfiConverterBool.write(value.isHistoryWorldReadable, into: &buf)
FfiConverterOptionTypeMembership.write(value.membership, into: &buf)
FfiConverterTypeJoinRule.write(value.joinRule, into: &buf)
FfiConverterOptionBool.write(value.isDirect, into: &buf)
}
}

Expand Down Expand Up @@ -22475,6 +22531,83 @@ extension RoomPreset: Equatable, Hashable {}



// Note that we don't yet support `indirect` for enums.
// See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion.
/**
* The type of room for a [`RoomPreviewInfo`].
*/

public enum RoomType {

/**
* It's a plain chat room.
*/
case room
/**
* It's a space that can group several rooms.
*/
case space
/**
* It's a custom implementation.
*/
case custom(value: String
)
}


public struct FfiConverterTypeRoomType: FfiConverterRustBuffer {
typealias SwiftType = RoomType

public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> RoomType {
let variant: Int32 = try readInt(&buf)
switch variant {

case 1: return .room

case 2: return .space

case 3: return .custom(value: try FfiConverterString.read(from: &buf)
)

default: throw UniffiInternalError.unexpectedEnumCase
}
}

public static func write(_ value: RoomType, into buf: inout [UInt8]) {
switch value {


case .room:
writeInt(&buf, Int32(1))


case .space:
writeInt(&buf, Int32(2))


case let .custom(value):
writeInt(&buf, Int32(3))
FfiConverterString.write(value, into: &buf)

}
}
}


public func FfiConverterTypeRoomType_lift(_ buf: RustBuffer) throws -> RoomType {
return try FfiConverterTypeRoomType.lift(buf)
}

public func FfiConverterTypeRoomType_lower(_ value: RoomType) -> RustBuffer {
return FfiConverterTypeRoomType.lower(value)
}



extension RoomType: Equatable, Hashable {}



// Note that we don't yet support `indirect` for enums.
// See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion.

Expand Down Expand Up @@ -29518,6 +29651,9 @@ private var initializationResult: InitializationResult = {
if (uniffi_matrix_sdk_ffi_checksum_method_roompreview_info() != 9145) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_matrix_sdk_ffi_checksum_method_roompreview_inviter() != 1297) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_matrix_sdk_ffi_checksum_method_roompreview_leave() != 5096) {
return InitializationResult.apiChecksumMismatch
}
Expand Down Expand Up @@ -29656,7 +29792,7 @@ private var initializationResult: InitializationResult = {
if (uniffi_matrix_sdk_ffi_checksum_method_timeline_send_audio() != 43163) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_matrix_sdk_ffi_checksum_method_timeline_send_file() != 35408) {
if (uniffi_matrix_sdk_ffi_checksum_method_timeline_send_file() != 37925) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_matrix_sdk_ffi_checksum_method_timeline_send_image() != 45681) {
Expand Down

0 comments on commit 4e09242

Please sign in to comment.