Skip to content

Commit 52ff54b

Browse files
committed
Bump to version v1.0.16 (matrix-rust-sdk/HEAD 0b9daa2)
1 parent 279994e commit 52ff54b

File tree

2 files changed

+137
-3
lines changed

2 files changed

+137
-3
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 = "ef71ab7556bcf15bff0d741b5a2151141800ad643dcb7aefbbf93310a29e9d05"
5-
let version = "v1.0.15"
4+
let checksum = "55f5ff3d77321b11e4e02f5e8febdb65d0b3b69c08745108fd45113fd87b8d52"
5+
let version = "v1.0.16"
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: 135 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4637,6 +4637,11 @@ public protocol RoomProtocol : AnyObject {
46374637
*/
46384638
func hasActiveRoomCall() -> Bool
46394639

4640+
/**
4641+
* Returns the room heroes for this room.
4642+
*/
4643+
func heroes() -> [RoomHero]
4644+
46404645
func id() -> String
46414646

46424647
/**
@@ -5209,6 +5214,16 @@ open func hasActiveRoomCall() -> Bool {
52095214
uniffi_matrix_sdk_ffi_fn_method_room_has_active_room_call(self.uniffiClonePointer(),$0
52105215
)
52115216
})
5217+
}
5218+
5219+
/**
5220+
* Returns the room heroes for this room.
5221+
*/
5222+
open func heroes() -> [RoomHero] {
5223+
return try! FfiConverterSequenceTypeRoomHero.lift(try! rustCall() {
5224+
uniffi_matrix_sdk_ffi_fn_method_room_heroes(self.uniffiClonePointer(),$0
5225+
)
5226+
})
52125227
}
52135228

52145229
open func id() -> String {
@@ -12174,6 +12189,92 @@ public func FfiConverterTypeRoomDirectorySearchEntriesResult_lower(_ value: Room
1217412189
}
1217512190

1217612191

12192+
/**
12193+
* Information about a member considered to be a room hero.
12194+
*/
12195+
public struct RoomHero {
12196+
/**
12197+
* The user ID of the hero.
12198+
*/
12199+
public var userId: String
12200+
/**
12201+
* The display name of the hero.
12202+
*/
12203+
public var displayName: String?
12204+
/**
12205+
* The avatar URL of the hero.
12206+
*/
12207+
public var avatarUrl: String?
12208+
12209+
// Default memberwise initializers are never public by default, so we
12210+
// declare one manually.
12211+
public init(
12212+
/**
12213+
* The user ID of the hero.
12214+
*/userId: String,
12215+
/**
12216+
* The display name of the hero.
12217+
*/displayName: String?,
12218+
/**
12219+
* The avatar URL of the hero.
12220+
*/avatarUrl: String?) {
12221+
self.userId = userId
12222+
self.displayName = displayName
12223+
self.avatarUrl = avatarUrl
12224+
}
12225+
}
12226+
12227+
12228+
12229+
extension RoomHero: Equatable, Hashable {
12230+
public static func ==(lhs: RoomHero, rhs: RoomHero) -> Bool {
12231+
if lhs.userId != rhs.userId {
12232+
return false
12233+
}
12234+
if lhs.displayName != rhs.displayName {
12235+
return false
12236+
}
12237+
if lhs.avatarUrl != rhs.avatarUrl {
12238+
return false
12239+
}
12240+
return true
12241+
}
12242+
12243+
public func hash(into hasher: inout Hasher) {
12244+
hasher.combine(userId)
12245+
hasher.combine(displayName)
12246+
hasher.combine(avatarUrl)
12247+
}
12248+
}
12249+
12250+
12251+
public struct FfiConverterTypeRoomHero: FfiConverterRustBuffer {
12252+
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> RoomHero {
12253+
return
12254+
try RoomHero(
12255+
userId: FfiConverterString.read(from: &buf),
12256+
displayName: FfiConverterOptionString.read(from: &buf),
12257+
avatarUrl: FfiConverterOptionString.read(from: &buf)
12258+
)
12259+
}
12260+
12261+
public static func write(_ value: RoomHero, into buf: inout [UInt8]) {
12262+
FfiConverterString.write(value.userId, into: &buf)
12263+
FfiConverterOptionString.write(value.displayName, into: &buf)
12264+
FfiConverterOptionString.write(value.avatarUrl, into: &buf)
12265+
}
12266+
}
12267+
12268+
12269+
public func FfiConverterTypeRoomHero_lift(_ buf: RustBuffer) throws -> RoomHero {
12270+
return try FfiConverterTypeRoomHero.lift(buf)
12271+
}
12272+
12273+
public func FfiConverterTypeRoomHero_lower(_ value: RoomHero) -> RustBuffer {
12274+
return FfiConverterTypeRoomHero.lower(value)
12275+
}
12276+
12277+
1217712278
public struct RoomInfo {
1217812279
public var id: String
1217912280
/**
@@ -12203,6 +12304,7 @@ public struct RoomInfo {
1220312304
* store.
1220412305
*/
1220512306
public var inviter: RoomMember?
12307+
public var heroes: [RoomHero]
1220612308
public var activeMembersCount: UInt64
1220712309
public var invitedMembersCount: UInt64
1220812310
public var joinedMembersCount: UInt64
@@ -12248,7 +12350,7 @@ public struct RoomInfo {
1224812350
*
1224912351
* Can be missing if the room membership invite event is missing from the
1225012352
* store.
12251-
*/inviter: RoomMember?, activeMembersCount: UInt64, invitedMembersCount: UInt64, joinedMembersCount: UInt64, userPowerLevels: [String: Int64], highlightCount: UInt64, notificationCount: UInt64, userDefinedNotificationMode: RoomNotificationMode?, hasRoomCall: Bool, activeRoomCallParticipants: [String],
12353+
*/inviter: RoomMember?, heroes: [RoomHero], activeMembersCount: UInt64, invitedMembersCount: UInt64, joinedMembersCount: UInt64, userPowerLevels: [String: Int64], highlightCount: UInt64, notificationCount: UInt64, userDefinedNotificationMode: RoomNotificationMode?, hasRoomCall: Bool, activeRoomCallParticipants: [String],
1225212354
/**
1225312355
* Whether this room has been explicitly marked as unread
1225412356
*/isMarkedUnread: Bool,
@@ -12278,6 +12380,7 @@ public struct RoomInfo {
1227812380
self.alternativeAliases = alternativeAliases
1227912381
self.membership = membership
1228012382
self.inviter = inviter
12383+
self.heroes = heroes
1228112384
self.activeMembersCount = activeMembersCount
1228212385
self.invitedMembersCount = invitedMembersCount
1228312386
self.joinedMembersCount = joinedMembersCount
@@ -12340,6 +12443,9 @@ extension RoomInfo: Equatable, Hashable {
1234012443
if lhs.inviter != rhs.inviter {
1234112444
return false
1234212445
}
12446+
if lhs.heroes != rhs.heroes {
12447+
return false
12448+
}
1234312449
if lhs.activeMembersCount != rhs.activeMembersCount {
1234412450
return false
1234512451
}
@@ -12397,6 +12503,7 @@ extension RoomInfo: Equatable, Hashable {
1239712503
hasher.combine(alternativeAliases)
1239812504
hasher.combine(membership)
1239912505
hasher.combine(inviter)
12506+
hasher.combine(heroes)
1240012507
hasher.combine(activeMembersCount)
1240112508
hasher.combine(invitedMembersCount)
1240212509
hasher.combine(joinedMembersCount)
@@ -12432,6 +12539,7 @@ public struct FfiConverterTypeRoomInfo: FfiConverterRustBuffer {
1243212539
alternativeAliases: FfiConverterSequenceString.read(from: &buf),
1243312540
membership: FfiConverterTypeMembership.read(from: &buf),
1243412541
inviter: FfiConverterOptionTypeRoomMember.read(from: &buf),
12542+
heroes: FfiConverterSequenceTypeRoomHero.read(from: &buf),
1243512543
activeMembersCount: FfiConverterUInt64.read(from: &buf),
1243612544
invitedMembersCount: FfiConverterUInt64.read(from: &buf),
1243712545
joinedMembersCount: FfiConverterUInt64.read(from: &buf),
@@ -12463,6 +12571,7 @@ public struct FfiConverterTypeRoomInfo: FfiConverterRustBuffer {
1246312571
FfiConverterSequenceString.write(value.alternativeAliases, into: &buf)
1246412572
FfiConverterTypeMembership.write(value.membership, into: &buf)
1246512573
FfiConverterOptionTypeRoomMember.write(value.inviter, into: &buf)
12574+
FfiConverterSequenceTypeRoomHero.write(value.heroes, into: &buf)
1246612575
FfiConverterUInt64.write(value.activeMembersCount, into: &buf)
1246712576
FfiConverterUInt64.write(value.invitedMembersCount, into: &buf)
1246812577
FfiConverterUInt64.write(value.joinedMembersCount, into: &buf)
@@ -24491,6 +24600,28 @@ fileprivate struct FfiConverterSequenceTypeRoomDescription: FfiConverterRustBuff
2449124600
}
2449224601
}
2449324602

24603+
fileprivate struct FfiConverterSequenceTypeRoomHero: FfiConverterRustBuffer {
24604+
typealias SwiftType = [RoomHero]
24605+
24606+
public static func write(_ value: [RoomHero], into buf: inout [UInt8]) {
24607+
let len = Int32(value.count)
24608+
writeInt(&buf, len)
24609+
for item in value {
24610+
FfiConverterTypeRoomHero.write(item, into: &buf)
24611+
}
24612+
}
24613+
24614+
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> [RoomHero] {
24615+
let len: Int32 = try readInt(&buf)
24616+
var seq = [RoomHero]()
24617+
seq.reserveCapacity(Int(len))
24618+
for _ in 0 ..< len {
24619+
seq.append(try FfiConverterTypeRoomHero.read(from: &buf))
24620+
}
24621+
return seq
24622+
}
24623+
}
24624+
2449424625
fileprivate struct FfiConverterSequenceTypeRoomListRange: FfiConverterRustBuffer {
2449524626
typealias SwiftType = [RoomListRange]
2449624627

@@ -25656,6 +25787,9 @@ private var initializationResult: InitializationResult {
2565625787
if (uniffi_matrix_sdk_ffi_checksum_method_room_has_active_room_call() != 33588) {
2565725788
return InitializationResult.apiChecksumMismatch
2565825789
}
25790+
if (uniffi_matrix_sdk_ffi_checksum_method_room_heroes() != 22313) {
25791+
return InitializationResult.apiChecksumMismatch
25792+
}
2565925793
if (uniffi_matrix_sdk_ffi_checksum_method_room_id() != 61990) {
2566025794
return InitializationResult.apiChecksumMismatch
2566125795
}

0 commit comments

Comments
 (0)