mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-24 07:05:35 +00:00
Reaction improvements
This commit is contained in:
@@ -43,26 +43,25 @@ func _internal_messageReadStats(account: Account, id: MessageId) -> Signal<Messa
|
||||
|
||||
return combineLatest(readPeers, reactionCount)
|
||||
|> mapToSignal { result, reactionCount -> Signal<MessageReadStats?, NoError> in
|
||||
guard let result = result else {
|
||||
return .single(nil)
|
||||
}
|
||||
return account.postbox.transaction { transaction -> (peerIds: [PeerId], missingPeerIds: [PeerId]) in
|
||||
var peerIds: [PeerId] = []
|
||||
var missingPeerIds: [PeerId] = []
|
||||
|
||||
let authorId = transaction.getMessage(id)?.author?.id
|
||||
|
||||
for id in result {
|
||||
let peerId = PeerId(namespace: Namespaces.Peer.CloudUser, id: PeerId.Id._internalFromInt64Value(id))
|
||||
if peerId == account.peerId {
|
||||
continue
|
||||
}
|
||||
if peerId == authorId {
|
||||
continue
|
||||
}
|
||||
peerIds.append(peerId)
|
||||
if transaction.getPeer(peerId) == nil {
|
||||
missingPeerIds.append(peerId)
|
||||
if let result = result {
|
||||
for id in result {
|
||||
let peerId = PeerId(namespace: Namespaces.Peer.CloudUser, id: PeerId.Id._internalFromInt64Value(id))
|
||||
if peerId == account.peerId {
|
||||
continue
|
||||
}
|
||||
if peerId == authorId {
|
||||
continue
|
||||
}
|
||||
peerIds.append(peerId)
|
||||
if transaction.getPeer(peerId) == nil {
|
||||
missingPeerIds.append(peerId)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user