@@ -593,6 +593,12 @@ public protocol ClientProtocol : AnyObject {
593593
594594 func accountUrl(action: AccountManagementAction?) async throws -> String?
595595
596+ /**
597+ * Adds a recently used emoji to the list and uploads the updated
598+ * `io.element.recent_emoji` content to the global account data.
599+ */
600+ func addRecentEmoji(emoji: String) async throws
601+
596602 /**
597603 * Find all sliding sync versions that are available.
598604 *
@@ -747,6 +753,12 @@ public protocol ClientProtocol : AnyObject {
747753
748754 func getProfile(userId: String) async throws -> UserProfile
749755
756+ /**
757+ * Gets the list of recently used emojis from the `io.element.recent_emoji`
758+ * global account data.
759+ */
760+ func getRecentEmojis() async throws -> [RecentEmoji]
761+
750762 func getRecentlyVisitedRooms() async throws -> [String]
751763
752764 /**
@@ -1217,6 +1229,27 @@ open func accountUrl(action: AccountManagementAction?)async throws -> String? {
12171229 )
12181230}
12191231
1232+ /**
1233+ * Adds a recently used emoji to the list and uploads the updated
1234+ * `io.element.recent_emoji` content to the global account data.
1235+ */
1236+ open func addRecentEmoji(emoji: String)async throws {
1237+ return
1238+ try await uniffiRustCallAsync(
1239+ rustFutureFunc: {
1240+ uniffi_matrix_sdk_ffi_fn_method_client_add_recent_emoji(
1241+ self.uniffiClonePointer(),
1242+ FfiConverterString.lower(emoji)
1243+ )
1244+ },
1245+ pollFunc: ffi_matrix_sdk_ffi_rust_future_poll_void,
1246+ completeFunc: ffi_matrix_sdk_ffi_rust_future_complete_void,
1247+ freeFunc: ffi_matrix_sdk_ffi_rust_future_free_void,
1248+ liftFunc: { $0 },
1249+ errorHandler: FfiConverterTypeClientError.lift
1250+ )
1251+ }
1252+
12201253 /**
12211254 * Find all sliding sync versions that are available.
12221255 *
@@ -1700,6 +1733,27 @@ open func getProfile(userId: String)async throws -> UserProfile {
17001733 )
17011734}
17021735
1736+ /**
1737+ * Gets the list of recently used emojis from the `io.element.recent_emoji`
1738+ * global account data.
1739+ */
1740+ open func getRecentEmojis()async throws -> [RecentEmoji] {
1741+ return
1742+ try await uniffiRustCallAsync(
1743+ rustFutureFunc: {
1744+ uniffi_matrix_sdk_ffi_fn_method_client_get_recent_emojis(
1745+ self.uniffiClonePointer()
1746+
1747+ )
1748+ },
1749+ pollFunc: ffi_matrix_sdk_ffi_rust_future_poll_rust_buffer,
1750+ completeFunc: ffi_matrix_sdk_ffi_rust_future_complete_rust_buffer,
1751+ freeFunc: ffi_matrix_sdk_ffi_rust_future_free_rust_buffer,
1752+ liftFunc: FfiConverterSequenceTypeRecentEmoji.lift,
1753+ errorHandler: FfiConverterTypeClientError.lift
1754+ )
1755+ }
1756+
17031757open func getRecentlyVisitedRooms()async throws -> [String] {
17041758 return
17051759 try await uniffiRustCallAsync(
@@ -12356,8 +12410,10 @@ public protocol TimelineProtocol : AnyObject {
1235612410 *
1235712411 * Ensures that only one reaction is sent at a time to avoid race
1235812412 * conditions and spamming the homeserver with requests.
12413+ *
12414+ * Returns `true` if the reaction was added, `false` if it was removed.
1235912415 */
12360- func toggleReaction(itemId: EventOrTransactionId, key: String) async throws
12416+ func toggleReaction(itemId: EventOrTransactionId, key: String) async throws -> Bool
1236112417
1236212418 /**
1236312419 * Adds a new pinned event by sending an updated `m.room.pinned_events`
@@ -12896,8 +12952,10 @@ open func subscribeToBackPaginationStatus(listener: PaginationStatusListener)asy
1289612952 *
1289712953 * Ensures that only one reaction is sent at a time to avoid race
1289812954 * conditions and spamming the homeserver with requests.
12955+ *
12956+ * Returns `true` if the reaction was added, `false` if it was removed.
1289912957 */
12900- open func toggleReaction(itemId: EventOrTransactionId, key: String)async throws {
12958+ open func toggleReaction(itemId: EventOrTransactionId, key: String)async throws -> Bool {
1290112959 return
1290212960 try await uniffiRustCallAsync(
1290312961 rustFutureFunc: {
@@ -12906,10 +12964,10 @@ open func toggleReaction(itemId: EventOrTransactionId, key: String)async throws
1290612964 FfiConverterTypeEventOrTransactionId.lower(itemId),FfiConverterString.lower(key)
1290712965 )
1290812966 },
12909- pollFunc: ffi_matrix_sdk_ffi_rust_future_poll_void ,
12910- completeFunc: ffi_matrix_sdk_ffi_rust_future_complete_void ,
12911- freeFunc: ffi_matrix_sdk_ffi_rust_future_free_void ,
12912- liftFunc: { $0 } ,
12967+ pollFunc: ffi_matrix_sdk_ffi_rust_future_poll_i8 ,
12968+ completeFunc: ffi_matrix_sdk_ffi_rust_future_complete_i8 ,
12969+ freeFunc: ffi_matrix_sdk_ffi_rust_future_free_i8 ,
12970+ liftFunc: FfiConverterBool.lift ,
1291312971 errorHandler: FfiConverterTypeClientError.lift
1291412972 )
1291512973}
@@ -17679,6 +17737,78 @@ public func FfiConverterTypeReceipt_lower(_ value: Receipt) -> RustBuffer {
1767917737}
1768017738
1768117739
17740+ /**
17741+ * Represents an emoji recently used for reactions.
17742+ */
17743+ public struct RecentEmoji {
17744+ /**
17745+ * The actual emoji text representation.
17746+ */
17747+ public var emoji: String
17748+ /**
17749+ * The number of times this emoji has been used for reactions.
17750+ */
17751+ public var count: UInt64
17752+
17753+ // Default memberwise initializers are never public by default, so we
17754+ // declare one manually.
17755+ public init(
17756+ /**
17757+ * The actual emoji text representation.
17758+ */emoji: String,
17759+ /**
17760+ * The number of times this emoji has been used for reactions.
17761+ */count: UInt64) {
17762+ self.emoji = emoji
17763+ self.count = count
17764+ }
17765+ }
17766+
17767+
17768+
17769+ extension RecentEmoji: Equatable, Hashable {
17770+ public static func ==(lhs: RecentEmoji, rhs: RecentEmoji) -> Bool {
17771+ if lhs.emoji != rhs.emoji {
17772+ return false
17773+ }
17774+ if lhs.count != rhs.count {
17775+ return false
17776+ }
17777+ return true
17778+ }
17779+
17780+ public func hash(into hasher: inout Hasher) {
17781+ hasher.combine(emoji)
17782+ hasher.combine(count)
17783+ }
17784+ }
17785+
17786+
17787+ public struct FfiConverterTypeRecentEmoji: FfiConverterRustBuffer {
17788+ public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> RecentEmoji {
17789+ return
17790+ try RecentEmoji(
17791+ emoji: FfiConverterString.read(from: &buf),
17792+ count: FfiConverterUInt64.read(from: &buf)
17793+ )
17794+ }
17795+
17796+ public static func write(_ value: RecentEmoji, into buf: inout [UInt8]) {
17797+ FfiConverterString.write(value.emoji, into: &buf)
17798+ FfiConverterUInt64.write(value.count, into: &buf)
17799+ }
17800+ }
17801+
17802+
17803+ public func FfiConverterTypeRecentEmoji_lift(_ buf: RustBuffer) throws -> RecentEmoji {
17804+ return try FfiConverterTypeRecentEmoji.lift(buf)
17805+ }
17806+
17807+ public func FfiConverterTypeRecentEmoji_lower(_ value: RecentEmoji) -> RustBuffer {
17808+ return FfiConverterTypeRecentEmoji.lower(value)
17809+ }
17810+
17811+
1768217812/**
1768317813 * The config to use for HTTP requests by default in this client.
1768417814 */
@@ -37122,6 +37252,28 @@ fileprivate struct FfiConverterSequenceTypeReactionSenderData: FfiConverterRustB
3712237252 }
3712337253}
3712437254
37255+ fileprivate struct FfiConverterSequenceTypeRecentEmoji: FfiConverterRustBuffer {
37256+ typealias SwiftType = [RecentEmoji]
37257+
37258+ public static func write(_ value: [RecentEmoji], into buf: inout [UInt8]) {
37259+ let len = Int32(value.count)
37260+ writeInt(&buf, len)
37261+ for item in value {
37262+ FfiConverterTypeRecentEmoji.write(item, into: &buf)
37263+ }
37264+ }
37265+
37266+ public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> [RecentEmoji] {
37267+ let len: Int32 = try readInt(&buf)
37268+ var seq = [RecentEmoji]()
37269+ seq.reserveCapacity(Int(len))
37270+ for _ in 0 ..< len {
37271+ seq.append(try FfiConverterTypeRecentEmoji.read(from: &buf))
37272+ }
37273+ return seq
37274+ }
37275+ }
37276+
3712537277fileprivate struct FfiConverterSequenceTypeRoomDescription: FfiConverterRustBuffer {
3712637278 typealias SwiftType = [RoomDescription]
3712737279
@@ -38342,6 +38494,9 @@ private var initializationResult: InitializationResult = {
3834238494 if (uniffi_matrix_sdk_ffi_checksum_method_client_account_url() != 42373) {
3834338495 return InitializationResult.apiChecksumMismatch
3834438496 }
38497+ if (uniffi_matrix_sdk_ffi_checksum_method_client_add_recent_emoji() != 29688) {
38498+ return InitializationResult.apiChecksumMismatch
38499+ }
3834538500 if (uniffi_matrix_sdk_ffi_checksum_method_client_available_sliding_sync_versions() != 35296) {
3834638501 return InitializationResult.apiChecksumMismatch
3834738502 }
@@ -38417,6 +38572,9 @@ private var initializationResult: InitializationResult = {
3841738572 if (uniffi_matrix_sdk_ffi_checksum_method_client_get_profile() != 60062) {
3841838573 return InitializationResult.apiChecksumMismatch
3841938574 }
38575+ if (uniffi_matrix_sdk_ffi_checksum_method_client_get_recent_emojis() != 64362) {
38576+ return InitializationResult.apiChecksumMismatch
38577+ }
3842038578 if (uniffi_matrix_sdk_ffi_checksum_method_client_get_recently_visited_rooms() != 22399) {
3842138579 return InitializationResult.apiChecksumMismatch
3842238580 }
@@ -39515,7 +39673,7 @@ private var initializationResult: InitializationResult = {
3951539673 if (uniffi_matrix_sdk_ffi_checksum_method_timeline_subscribe_to_back_pagination_status() != 46161) {
3951639674 return InitializationResult.apiChecksumMismatch
3951739675 }
39518- if (uniffi_matrix_sdk_ffi_checksum_method_timeline_toggle_reaction() != 29303 ) {
39676+ if (uniffi_matrix_sdk_ffi_checksum_method_timeline_toggle_reaction() != 13555 ) {
3951939677 return InitializationResult.apiChecksumMismatch
3952039678 }
3952139679 if (uniffi_matrix_sdk_ffi_checksum_method_timeline_unpin_event() != 52414) {
0 commit comments