mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 22:55:00 +00:00
Stars reaction test [skip ci]
This commit is contained in:
@@ -94,7 +94,26 @@ public func mergedMessageReactionsAndPeers(accountPeerId: EnginePeer.Id, account
|
||||
}
|
||||
}
|
||||
|
||||
return (attribute.reactions, recentPeers)
|
||||
#if DEBUG
|
||||
var reactions = attribute.reactions
|
||||
if "".isEmpty {
|
||||
if let index = reactions.firstIndex(where: {
|
||||
if case .custom(MessageReaction.starsReactionId) = $0.value {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
}) {
|
||||
let value = reactions[index]
|
||||
reactions.remove(at: index)
|
||||
reactions.insert(value, at: 0)
|
||||
} else {
|
||||
reactions.insert(MessageReaction(value: .custom(MessageReaction.starsReactionId), count: 1000000, chosenOrder: nil), at: 0)
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
return (reactions, recentPeers)
|
||||
}
|
||||
|
||||
private func mergeReactions(reactions: [MessageReaction], recentPeers: [ReactionsMessageAttribute.RecentPeer], pending: [PendingReactionsMessageAttribute.PendingReaction], accountPeerId: PeerId) -> ([MessageReaction], [ReactionsMessageAttribute.RecentPeer]) {
|
||||
|
||||
Reference in New Issue
Block a user