Skip to content

Commit d0226f6

Browse files
committed
Bump to version v1.0.29 (matrix-rust-sdk/main 6fca1e8)
1 parent 1a1cbc9 commit d0226f6

File tree

2 files changed

+113
-13
lines changed

2 files changed

+113
-13
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 = "43cd5ce1f40e5afd15b7c4b3a497b807d7a633783bd17020004a21c986a32aeb"
5-
let version = "v1.0.28"
4+
let checksum = "0eb833a89192ce45751cc10df0a9e141592fb105a83563b26d6923de8c146418"
5+
let version = "v1.0.29"
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: 111 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4354,6 +4354,8 @@ public protocol RoomProtocol : AnyObject {
43544354

43554355
func canUserKick(userId: String) async throws -> Bool
43564356

4357+
func canUserPinUnpin(userId: String) async throws -> Bool
4358+
43574359
func canUserRedactOther(userId: String) async throws -> Bool
43584360

43594361
func canUserRedactOwn(userId: String) async throws -> Bool
@@ -4802,6 +4804,23 @@ open func canUserKick(userId: String)async throws -> Bool {
48024804
)
48034805
}
48044806

4807+
open func canUserPinUnpin(userId: String)async throws -> Bool {
4808+
return
4809+
try await uniffiRustCallAsync(
4810+
rustFutureFunc: {
4811+
uniffi_matrix_sdk_ffi_fn_method_room_can_user_pin_unpin(
4812+
self.uniffiClonePointer(),
4813+
FfiConverterString.lower(userId)
4814+
)
4815+
},
4816+
pollFunc: ffi_matrix_sdk_ffi_rust_future_poll_i8,
4817+
completeFunc: ffi_matrix_sdk_ffi_rust_future_complete_i8,
4818+
freeFunc: ffi_matrix_sdk_ffi_rust_future_free_i8,
4819+
liftFunc: FfiConverterBool.lift,
4820+
errorHandler: FfiConverterTypeClientError.lift
4821+
)
4822+
}
4823+
48054824
open func canUserRedactOther(userId: String)async throws -> Bool {
48064825
return
48074826
try await uniffiRustCallAsync(
@@ -8495,6 +8514,15 @@ public protocol TimelineProtocol : AnyObject {
84958514
*/
84968515
func paginateBackwards(numEvents: UInt16) async throws -> Bool
84978516

8517+
/**
8518+
* Adds a new pinned event by sending an updated `m.room.pinned_events`
8519+
* event containing the new event id.
8520+
*
8521+
* Returns `true` if we sent the request, `false` if the event was already
8522+
* pinned.
8523+
*/
8524+
func pinEvent(eventId: String) async throws -> Bool
8525+
84988526
/**
84998527
* Redacts an event from the timeline.
85008528
*
@@ -8542,6 +8570,15 @@ public protocol TimelineProtocol : AnyObject {
85428570

85438571
func toggleReaction(eventId: String, key: String) async throws
85448572

8573+
/**
8574+
* Adds a new pinned event by sending an updated `m.room.pinned_events`
8575+
* event without the event id we want to remove.
8576+
*
8577+
* Returns `true` if we sent the request, `false` if the event wasn't
8578+
* pinned
8579+
*/
8580+
func unpinEvent(eventId: String) async throws -> Bool
8581+
85458582
}
85468583

85478584
open class Timeline:
@@ -8852,6 +8889,30 @@ open func paginateBackwards(numEvents: UInt16)async throws -> Bool {
88528889
)
88538890
}
88548891

8892+
/**
8893+
* Adds a new pinned event by sending an updated `m.room.pinned_events`
8894+
* event containing the new event id.
8895+
*
8896+
* Returns `true` if we sent the request, `false` if the event was already
8897+
* pinned.
8898+
*/
8899+
open func pinEvent(eventId: String)async throws -> Bool {
8900+
return
8901+
try await uniffiRustCallAsync(
8902+
rustFutureFunc: {
8903+
uniffi_matrix_sdk_ffi_fn_method_timeline_pin_event(
8904+
self.uniffiClonePointer(),
8905+
FfiConverterString.lower(eventId)
8906+
)
8907+
},
8908+
pollFunc: ffi_matrix_sdk_ffi_rust_future_poll_i8,
8909+
completeFunc: ffi_matrix_sdk_ffi_rust_future_complete_i8,
8910+
freeFunc: ffi_matrix_sdk_ffi_rust_future_free_i8,
8911+
liftFunc: FfiConverterBool.lift,
8912+
errorHandler: FfiConverterTypeClientError.lift
8913+
)
8914+
}
8915+
88558916
/**
88568917
* Redacts an event from the timeline.
88578918
*
@@ -9076,6 +9137,30 @@ open func toggleReaction(eventId: String, key: String)async throws {
90769137
)
90779138
}
90789139

9140+
/**
9141+
* Adds a new pinned event by sending an updated `m.room.pinned_events`
9142+
* event without the event id we want to remove.
9143+
*
9144+
* Returns `true` if we sent the request, `false` if the event wasn't
9145+
* pinned
9146+
*/
9147+
open func unpinEvent(eventId: String)async throws -> Bool {
9148+
return
9149+
try await uniffiRustCallAsync(
9150+
rustFutureFunc: {
9151+
uniffi_matrix_sdk_ffi_fn_method_timeline_unpin_event(
9152+
self.uniffiClonePointer(),
9153+
FfiConverterString.lower(eventId)
9154+
)
9155+
},
9156+
pollFunc: ffi_matrix_sdk_ffi_rust_future_poll_i8,
9157+
completeFunc: ffi_matrix_sdk_ffi_rust_future_complete_i8,
9158+
freeFunc: ffi_matrix_sdk_ffi_rust_future_free_i8,
9159+
liftFunc: FfiConverterBool.lift,
9160+
errorHandler: FfiConverterTypeClientError.lift
9161+
)
9162+
}
9163+
90799164

90809165
}
90819166

@@ -12152,14 +12237,12 @@ public func FfiConverterTypePusherIdentifiers_lower(_ value: PusherIdentifiers)
1215212237

1215312238
public struct Reaction {
1215412239
public var key: String
12155-
public var count: UInt64
1215612240
public var senders: [ReactionSenderData]
1215712241

1215812242
// Default memberwise initializers are never public by default, so we
1215912243
// declare one manually.
12160-
public init(key: String, count: UInt64, senders: [ReactionSenderData]) {
12244+
public init(key: String, senders: [ReactionSenderData]) {
1216112245
self.key = key
12162-
self.count = count
1216312246
self.senders = senders
1216412247
}
1216512248
}
@@ -12171,9 +12254,6 @@ extension Reaction: Equatable, Hashable {
1217112254
if lhs.key != rhs.key {
1217212255
return false
1217312256
}
12174-
if lhs.count != rhs.count {
12175-
return false
12176-
}
1217712257
if lhs.senders != rhs.senders {
1217812258
return false
1217912259
}
@@ -12182,7 +12262,6 @@ extension Reaction: Equatable, Hashable {
1218212262

1218312263
public func hash(into hasher: inout Hasher) {
1218412264
hasher.combine(key)
12185-
hasher.combine(count)
1218612265
hasher.combine(senders)
1218712266
}
1218812267
}
@@ -12193,14 +12272,12 @@ public struct FfiConverterTypeReaction: FfiConverterRustBuffer {
1219312272
return
1219412273
try Reaction(
1219512274
key: FfiConverterString.read(from: &buf),
12196-
count: FfiConverterUInt64.read(from: &buf),
1219712275
senders: FfiConverterSequenceTypeReactionSenderData.read(from: &buf)
1219812276
)
1219912277
}
1220012278

1220112279
public static func write(_ value: Reaction, into buf: inout [UInt8]) {
1220212280
FfiConverterString.write(value.key, into: &buf)
12203-
FfiConverterUInt64.write(value.count, into: &buf)
1220412281
FfiConverterSequenceTypeReactionSenderData.write(value.senders, into: &buf)
1220512282
}
1220612283
}
@@ -12734,6 +12811,10 @@ public struct RoomInfo {
1273412811
* notification settings.
1273512812
*/
1273612813
public var numUnreadMentions: UInt64
12814+
/**
12815+
* The currently pinned event ids
12816+
*/
12817+
public var pinnedEventIds: [String]
1273712818

1273812819
// Default memberwise initializers are never public by default, so we
1273912820
// declare one manually.
@@ -12766,7 +12847,10 @@ public struct RoomInfo {
1276612847
/**
1276712848
* Events causing mentions/highlights for the user, according to their
1276812849
* notification settings.
12769-
*/numUnreadMentions: UInt64) {
12850+
*/numUnreadMentions: UInt64,
12851+
/**
12852+
* The currently pinned event ids
12853+
*/pinnedEventIds: [String]) {
1277012854
self.id = id
1277112855
self.displayName = displayName
1277212856
self.rawName = rawName
@@ -12795,6 +12879,7 @@ public struct RoomInfo {
1279512879
self.numUnreadMessages = numUnreadMessages
1279612880
self.numUnreadNotifications = numUnreadNotifications
1279712881
self.numUnreadMentions = numUnreadMentions
12882+
self.pinnedEventIds = pinnedEventIds
1279812883
}
1279912884
}
1280012885

@@ -12886,6 +12971,9 @@ extension RoomInfo: Equatable, Hashable {
1288612971
if lhs.numUnreadMentions != rhs.numUnreadMentions {
1288712972
return false
1288812973
}
12974+
if lhs.pinnedEventIds != rhs.pinnedEventIds {
12975+
return false
12976+
}
1288912977
return true
1289012978
}
1289112979

@@ -12918,6 +13006,7 @@ extension RoomInfo: Equatable, Hashable {
1291813006
hasher.combine(numUnreadMessages)
1291913007
hasher.combine(numUnreadNotifications)
1292013008
hasher.combine(numUnreadMentions)
13009+
hasher.combine(pinnedEventIds)
1292113010
}
1292213011
}
1292313012

@@ -12953,7 +13042,8 @@ public struct FfiConverterTypeRoomInfo: FfiConverterRustBuffer {
1295313042
isMarkedUnread: FfiConverterBool.read(from: &buf),
1295413043
numUnreadMessages: FfiConverterUInt64.read(from: &buf),
1295513044
numUnreadNotifications: FfiConverterUInt64.read(from: &buf),
12956-
numUnreadMentions: FfiConverterUInt64.read(from: &buf)
13045+
numUnreadMentions: FfiConverterUInt64.read(from: &buf),
13046+
pinnedEventIds: FfiConverterSequenceString.read(from: &buf)
1295713047
)
1295813048
}
1295913049

@@ -12986,6 +13076,7 @@ public struct FfiConverterTypeRoomInfo: FfiConverterRustBuffer {
1298613076
FfiConverterUInt64.write(value.numUnreadMessages, into: &buf)
1298713077
FfiConverterUInt64.write(value.numUnreadNotifications, into: &buf)
1298813078
FfiConverterUInt64.write(value.numUnreadMentions, into: &buf)
13079+
FfiConverterSequenceString.write(value.pinnedEventIds, into: &buf)
1298913080
}
1299013081
}
1299113082

@@ -26164,6 +26255,9 @@ private var initializationResult: InitializationResult = {
2616426255
if (uniffi_matrix_sdk_ffi_checksum_method_room_can_user_kick() != 12773) {
2616526256
return InitializationResult.apiChecksumMismatch
2616626257
}
26258+
if (uniffi_matrix_sdk_ffi_checksum_method_room_can_user_pin_unpin() != 8341) {
26259+
return InitializationResult.apiChecksumMismatch
26260+
}
2616726261
if (uniffi_matrix_sdk_ffi_checksum_method_room_can_user_redact_other() != 13274) {
2616826262
return InitializationResult.apiChecksumMismatch
2616926263
}
@@ -26569,6 +26663,9 @@ private var initializationResult: InitializationResult = {
2656926663
if (uniffi_matrix_sdk_ffi_checksum_method_timeline_paginate_backwards() != 65175) {
2657026664
return InitializationResult.apiChecksumMismatch
2657126665
}
26666+
if (uniffi_matrix_sdk_ffi_checksum_method_timeline_pin_event() != 41687) {
26667+
return InitializationResult.apiChecksumMismatch
26668+
}
2657226669
if (uniffi_matrix_sdk_ffi_checksum_method_timeline_redact_event() != 8574) {
2657326670
return InitializationResult.apiChecksumMismatch
2657426671
}
@@ -26611,6 +26708,9 @@ private var initializationResult: InitializationResult = {
2661126708
if (uniffi_matrix_sdk_ffi_checksum_method_timeline_toggle_reaction() != 10294) {
2661226709
return InitializationResult.apiChecksumMismatch
2661326710
}
26711+
if (uniffi_matrix_sdk_ffi_checksum_method_timeline_unpin_event() != 52414) {
26712+
return InitializationResult.apiChecksumMismatch
26713+
}
2661426714
if (uniffi_matrix_sdk_ffi_checksum_method_timelinediff_append() != 8453) {
2661526715
return InitializationResult.apiChecksumMismatch
2661626716
}

0 commit comments

Comments
 (0)