Various fixes

This commit is contained in:
Ilya Laktyushin
2022-04-23 07:57:53 +04:00
parent e167e794cc
commit 5229c1666c
7 changed files with 130 additions and 55 deletions

View File

@@ -320,6 +320,17 @@ func _internal_updatePeerPhotoInternal(postbox: Postbox, network: Network, state
updatePeers(transaction: transaction, peers: [groupOrChannel], update: { _, updated in
return updated
})
transaction.updatePeerCachedData(peerIds: Set([peer.id]), update: { _, current in
if let current = current as? CachedChannelData {
return current.withUpdatedPhoto(nil)
} else if let current = current as? CachedGroupData {
return current.withUpdatedPhoto(nil)
} else {
return current
}
})
return .complete(groupOrChannel.profileImageRepresentations)
}
|> mapError { _ -> UploadPeerPhotoError in }