This commit is contained in:
overtake 2021-12-23 11:13:45 +04:00
parent c202037099
commit 09a538bf1c
2 changed files with 8 additions and 0 deletions

View File

@ -19,6 +19,7 @@ public func updateMessageReactionsInteractively(account: Account, messageId: Mes
break loop break loop
} }
} }
attributes.append(PendingReactionsMessageAttribute(accountPeerId: account.peerId, value: reaction)) 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)) 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 { if initialState.canLoadMore {
self.loadMore() self.loadMore()
} else {
self.statePromise.set(.single(self.state))
} }
} }

View File

@ -328,6 +328,11 @@ public extension Message {
return !attribute.reactions.isEmpty return !attribute.reactions.isEmpty
} }
} }
for attribute in self.attributes {
if let attribute = attribute as? PendingReactionsMessageAttribute {
return attribute.value != nil
}
}
return false return false
} }