diff --git a/submodules/TelegramCore/Sources/State/MessageReactions.swift b/submodules/TelegramCore/Sources/State/MessageReactions.swift index 85b5c2f41f..cfb61b1d65 100644 --- a/submodules/TelegramCore/Sources/State/MessageReactions.swift +++ b/submodules/TelegramCore/Sources/State/MessageReactions.swift @@ -19,6 +19,7 @@ public func updateMessageReactionsInteractively(account: Account, messageId: Mes break loop } } + attributes.append(PendingReactionsMessageAttribute(accountPeerId: account.peerId, value: reaction)) return .update(StoreMessage(id: currentMessage.id, globallyUniqueId: currentMessage.globallyUniqueId, groupingKey: currentMessage.groupingKey, threadId: currentMessage.threadId, timestamp: currentMessage.timestamp, flags: StoreMessageFlags(currentMessage.flags), tags: currentMessage.tags, globalTags: currentMessage.globalTags, localTags: currentMessage.localTags, forwardInfo: storeForwardInfo, authorId: currentMessage.author?.id, text: currentMessage.text, attributes: attributes, media: currentMessage.media)) }) @@ -319,6 +320,8 @@ public final class EngineMessageReactionListContext { if initialState.canLoadMore { self.loadMore() + } else { + self.statePromise.set(.single(self.state)) } } diff --git a/submodules/TelegramCore/Sources/Utils/MessageUtils.swift b/submodules/TelegramCore/Sources/Utils/MessageUtils.swift index 44bd3906ac..6a13ab787c 100644 --- a/submodules/TelegramCore/Sources/Utils/MessageUtils.swift +++ b/submodules/TelegramCore/Sources/Utils/MessageUtils.swift @@ -328,6 +328,11 @@ public extension Message { return !attribute.reactions.isEmpty } } + for attribute in self.attributes { + if let attribute = attribute as? PendingReactionsMessageAttribute { + return attribute.value != nil + } + } return false }