From c79bef2f11b1b5aa61934fbaf9fb1e9bdfae7de2 Mon Sep 17 00:00:00 2001 From: Isaac <> Date: Sun, 2 Feb 2025 16:27:03 +0400 Subject: [PATCH] Fix reactions --- .../DebugSettingsUI/Sources/DebugController.swift | 2 +- .../TelegramCore/Sources/State/MessageReactions.swift | 10 +++++++++- .../SyncCore/SyncCore_ReactionsMessageAttribute.swift | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/submodules/DebugSettingsUI/Sources/DebugController.swift b/submodules/DebugSettingsUI/Sources/DebugController.swift index 40ffd2764c..9c945ab2be 100644 --- a/submodules/DebugSettingsUI/Sources/DebugController.swift +++ b/submodules/DebugSettingsUI/Sources/DebugController.swift @@ -1372,7 +1372,7 @@ private enum DebugControllerEntry: ItemListNodeEntry { }).start() }) case let .devRequests(value): - return ItemListSwitchItem(presentationData: presentationData, title: "PlayerV2", value: value, sectionId: self.section, style: .blocks, updated: { value in + return ItemListSwitchItem(presentationData: presentationData, title: "DevRequests", value: value, sectionId: self.section, style: .blocks, updated: { value in let _ = arguments.sharedContext.accountManager.transaction ({ transaction in transaction.updateSharedData(ApplicationSpecificSharedDataKeys.experimentalUISettings, { settings in var settings = settings?.get(ExperimentalUISettings.self) ?? ExperimentalUISettings.defaultSettings diff --git a/submodules/TelegramCore/Sources/State/MessageReactions.swift b/submodules/TelegramCore/Sources/State/MessageReactions.swift index b7c7e96849..b4102609d7 100644 --- a/submodules/TelegramCore/Sources/State/MessageReactions.swift +++ b/submodules/TelegramCore/Sources/State/MessageReactions.swift @@ -187,7 +187,15 @@ func _internal_sendStarsReactionsInteractively(account: Account, messageId: Mess for attribute in attributes { if let attribute = attribute as? ReactionsMessageAttribute { if let myReaction = attribute.topPeers.first(where: { $0.isMy }) { - resolvedPrivacy = myReaction.isAnonymous ? .anonymous : .default + if myReaction.isAnonymous { + resolvedPrivacy = .anonymous + } else if myReaction.peerId == account.peerId { + resolvedPrivacy = .default + } else if let peerId = myReaction.peerId { + resolvedPrivacy = .peer(peerId) + } else { + resolvedPrivacy = .anonymous + } } } } diff --git a/submodules/TelegramCore/Sources/SyncCore/SyncCore_ReactionsMessageAttribute.swift b/submodules/TelegramCore/Sources/SyncCore/SyncCore_ReactionsMessageAttribute.swift index a836eb71f1..db40bcab2b 100644 --- a/submodules/TelegramCore/Sources/SyncCore/SyncCore_ReactionsMessageAttribute.swift +++ b/submodules/TelegramCore/Sources/SyncCore/SyncCore_ReactionsMessageAttribute.swift @@ -599,6 +599,6 @@ public final class PendingStarsReactionsMessageAttribute: MessageAttribute { encoder.encodeNil(forKey: "ap") } encoder.encodeInt32(self.count, forKey: "cnt") - encoder.encodeCodable(self.privacy, forKey: "priv") + encoder.encode(self.privacy, forKey: "priv") } }