@@ -4354,6 +4354,8 @@ public protocol RoomProtocol : AnyObject {
4354
4354
4355
4355
func canUserKick(userId: String) async throws -> Bool
4356
4356
4357
+ func canUserPinUnpin(userId: String) async throws -> Bool
4358
+
4357
4359
func canUserRedactOther(userId: String) async throws -> Bool
4358
4360
4359
4361
func canUserRedactOwn(userId: String) async throws -> Bool
@@ -4802,6 +4804,23 @@ open func canUserKick(userId: String)async throws -> Bool {
4802
4804
)
4803
4805
}
4804
4806
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
+
4805
4824
open func canUserRedactOther(userId: String)async throws -> Bool {
4806
4825
return
4807
4826
try await uniffiRustCallAsync(
@@ -8495,6 +8514,15 @@ public protocol TimelineProtocol : AnyObject {
8495
8514
*/
8496
8515
func paginateBackwards(numEvents: UInt16) async throws -> Bool
8497
8516
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
+
8498
8526
/**
8499
8527
* Redacts an event from the timeline.
8500
8528
*
@@ -8542,6 +8570,15 @@ public protocol TimelineProtocol : AnyObject {
8542
8570
8543
8571
func toggleReaction(eventId: String, key: String) async throws
8544
8572
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
+
8545
8582
}
8546
8583
8547
8584
open class Timeline:
@@ -8852,6 +8889,30 @@ open func paginateBackwards(numEvents: UInt16)async throws -> Bool {
8852
8889
)
8853
8890
}
8854
8891
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
+
8855
8916
/**
8856
8917
* Redacts an event from the timeline.
8857
8918
*
@@ -9076,6 +9137,30 @@ open func toggleReaction(eventId: String, key: String)async throws {
9076
9137
)
9077
9138
}
9078
9139
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
+
9079
9164
9080
9165
}
9081
9166
@@ -12152,14 +12237,12 @@ public func FfiConverterTypePusherIdentifiers_lower(_ value: PusherIdentifiers)
12152
12237
12153
12238
public struct Reaction {
12154
12239
public var key: String
12155
- public var count: UInt64
12156
12240
public var senders: [ReactionSenderData]
12157
12241
12158
12242
// Default memberwise initializers are never public by default, so we
12159
12243
// declare one manually.
12160
- public init(key: String, count: UInt64, senders: [ReactionSenderData]) {
12244
+ public init(key: String, senders: [ReactionSenderData]) {
12161
12245
self.key = key
12162
- self.count = count
12163
12246
self.senders = senders
12164
12247
}
12165
12248
}
@@ -12171,9 +12254,6 @@ extension Reaction: Equatable, Hashable {
12171
12254
if lhs.key != rhs.key {
12172
12255
return false
12173
12256
}
12174
- if lhs.count != rhs.count {
12175
- return false
12176
- }
12177
12257
if lhs.senders != rhs.senders {
12178
12258
return false
12179
12259
}
@@ -12182,7 +12262,6 @@ extension Reaction: Equatable, Hashable {
12182
12262
12183
12263
public func hash(into hasher: inout Hasher) {
12184
12264
hasher.combine(key)
12185
- hasher.combine(count)
12186
12265
hasher.combine(senders)
12187
12266
}
12188
12267
}
@@ -12193,14 +12272,12 @@ public struct FfiConverterTypeReaction: FfiConverterRustBuffer {
12193
12272
return
12194
12273
try Reaction(
12195
12274
key: FfiConverterString.read(from: &buf),
12196
- count: FfiConverterUInt64.read(from: &buf),
12197
12275
senders: FfiConverterSequenceTypeReactionSenderData.read(from: &buf)
12198
12276
)
12199
12277
}
12200
12278
12201
12279
public static func write(_ value: Reaction, into buf: inout [UInt8]) {
12202
12280
FfiConverterString.write(value.key, into: &buf)
12203
- FfiConverterUInt64.write(value.count, into: &buf)
12204
12281
FfiConverterSequenceTypeReactionSenderData.write(value.senders, into: &buf)
12205
12282
}
12206
12283
}
@@ -12734,6 +12811,10 @@ public struct RoomInfo {
12734
12811
* notification settings.
12735
12812
*/
12736
12813
public var numUnreadMentions: UInt64
12814
+ /**
12815
+ * The currently pinned event ids
12816
+ */
12817
+ public var pinnedEventIds: [String]
12737
12818
12738
12819
// Default memberwise initializers are never public by default, so we
12739
12820
// declare one manually.
@@ -12766,7 +12847,10 @@ public struct RoomInfo {
12766
12847
/**
12767
12848
* Events causing mentions/highlights for the user, according to their
12768
12849
* notification settings.
12769
- */numUnreadMentions: UInt64) {
12850
+ */numUnreadMentions: UInt64,
12851
+ /**
12852
+ * The currently pinned event ids
12853
+ */pinnedEventIds: [String]) {
12770
12854
self.id = id
12771
12855
self.displayName = displayName
12772
12856
self.rawName = rawName
@@ -12795,6 +12879,7 @@ public struct RoomInfo {
12795
12879
self.numUnreadMessages = numUnreadMessages
12796
12880
self.numUnreadNotifications = numUnreadNotifications
12797
12881
self.numUnreadMentions = numUnreadMentions
12882
+ self.pinnedEventIds = pinnedEventIds
12798
12883
}
12799
12884
}
12800
12885
@@ -12886,6 +12971,9 @@ extension RoomInfo: Equatable, Hashable {
12886
12971
if lhs.numUnreadMentions != rhs.numUnreadMentions {
12887
12972
return false
12888
12973
}
12974
+ if lhs.pinnedEventIds != rhs.pinnedEventIds {
12975
+ return false
12976
+ }
12889
12977
return true
12890
12978
}
12891
12979
@@ -12918,6 +13006,7 @@ extension RoomInfo: Equatable, Hashable {
12918
13006
hasher.combine(numUnreadMessages)
12919
13007
hasher.combine(numUnreadNotifications)
12920
13008
hasher.combine(numUnreadMentions)
13009
+ hasher.combine(pinnedEventIds)
12921
13010
}
12922
13011
}
12923
13012
@@ -12953,7 +13042,8 @@ public struct FfiConverterTypeRoomInfo: FfiConverterRustBuffer {
12953
13042
isMarkedUnread: FfiConverterBool.read(from: &buf),
12954
13043
numUnreadMessages: FfiConverterUInt64.read(from: &buf),
12955
13044
numUnreadNotifications: FfiConverterUInt64.read(from: &buf),
12956
- numUnreadMentions: FfiConverterUInt64.read(from: &buf)
13045
+ numUnreadMentions: FfiConverterUInt64.read(from: &buf),
13046
+ pinnedEventIds: FfiConverterSequenceString.read(from: &buf)
12957
13047
)
12958
13048
}
12959
13049
@@ -12986,6 +13076,7 @@ public struct FfiConverterTypeRoomInfo: FfiConverterRustBuffer {
12986
13076
FfiConverterUInt64.write(value.numUnreadMessages, into: &buf)
12987
13077
FfiConverterUInt64.write(value.numUnreadNotifications, into: &buf)
12988
13078
FfiConverterUInt64.write(value.numUnreadMentions, into: &buf)
13079
+ FfiConverterSequenceString.write(value.pinnedEventIds, into: &buf)
12989
13080
}
12990
13081
}
12991
13082
@@ -26164,6 +26255,9 @@ private var initializationResult: InitializationResult = {
26164
26255
if (uniffi_matrix_sdk_ffi_checksum_method_room_can_user_kick() != 12773) {
26165
26256
return InitializationResult.apiChecksumMismatch
26166
26257
}
26258
+ if (uniffi_matrix_sdk_ffi_checksum_method_room_can_user_pin_unpin() != 8341) {
26259
+ return InitializationResult.apiChecksumMismatch
26260
+ }
26167
26261
if (uniffi_matrix_sdk_ffi_checksum_method_room_can_user_redact_other() != 13274) {
26168
26262
return InitializationResult.apiChecksumMismatch
26169
26263
}
@@ -26569,6 +26663,9 @@ private var initializationResult: InitializationResult = {
26569
26663
if (uniffi_matrix_sdk_ffi_checksum_method_timeline_paginate_backwards() != 65175) {
26570
26664
return InitializationResult.apiChecksumMismatch
26571
26665
}
26666
+ if (uniffi_matrix_sdk_ffi_checksum_method_timeline_pin_event() != 41687) {
26667
+ return InitializationResult.apiChecksumMismatch
26668
+ }
26572
26669
if (uniffi_matrix_sdk_ffi_checksum_method_timeline_redact_event() != 8574) {
26573
26670
return InitializationResult.apiChecksumMismatch
26574
26671
}
@@ -26611,6 +26708,9 @@ private var initializationResult: InitializationResult = {
26611
26708
if (uniffi_matrix_sdk_ffi_checksum_method_timeline_toggle_reaction() != 10294) {
26612
26709
return InitializationResult.apiChecksumMismatch
26613
26710
}
26711
+ if (uniffi_matrix_sdk_ffi_checksum_method_timeline_unpin_event() != 52414) {
26712
+ return InitializationResult.apiChecksumMismatch
26713
+ }
26614
26714
if (uniffi_matrix_sdk_ffi_checksum_method_timelinediff_append() != 8453) {
26615
26715
return InitializationResult.apiChecksumMismatch
26616
26716
}
0 commit comments