Fix reactions

This commit is contained in:
Isaac 2025-02-02 16:27:03 +04:00
parent cd98c0b7cc
commit c79bef2f11
3 changed files with 11 additions and 3 deletions

View File

@ -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

View File

@ -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
}
}
}
}

View File

@ -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")
}
}