mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Avatar fixes
This commit is contained in:
parent
bb6f19cac3
commit
43c8c3efdd
@ -169,7 +169,6 @@ final class PenTool: DrawingElement {
|
||||
currentRenderLayer.draw(line: self.renderLine, color: self.color.toUIColor(), rect: rect)
|
||||
}
|
||||
|
||||
|
||||
if state == .ended {
|
||||
if self.arrow {
|
||||
let points = self.path?.points ?? []
|
||||
|
@ -32,15 +32,20 @@ public func peerInfoProfilePhotos(context: AccountContext, peerId: EnginePeer.Id
|
||||
|> distinctUntilChanged
|
||||
|> mapToSignal { entries -> Signal<(Bool, [AvatarGalleryEntry])?, NoError> in
|
||||
if let entries = entries {
|
||||
if let firstEntry = entries.first {
|
||||
if var firstEntry = entries.first {
|
||||
return context.account.postbox.peerView(id: peerId)
|
||||
|> mapToSignal { peerView -> Signal<(Bool, [AvatarGalleryEntry])?, NoError>in
|
||||
if let peer = peerViewMainPeer(peerView) {
|
||||
var secondEntry: TelegramMediaImage?
|
||||
var lastEntry: TelegramMediaImage?
|
||||
if let cachedData = peerView.cachedData as? CachedUserData {
|
||||
if firstEntry.representations.first?.representation.isPersonal == true, case let .known(photo) = cachedData.photo {
|
||||
secondEntry = photo
|
||||
if let firstRepresentation = firstEntry.representations.first, firstRepresentation.representation.isPersonal {
|
||||
if firstRepresentation.representation.hasVideo, case let .known(photo) = cachedData.personalPhoto, let peerReference = PeerReference(peer) {
|
||||
firstEntry = .topImage(firstEntry.representations, photo?.videoRepresentations.map { VideoRepresentationWithReference(representation: $0, reference: MediaResourceReference.avatar(peer: peerReference, resource: $0.resource)) } ?? [], firstEntry.peer, firstEntry.indexData, firstEntry.immediateThumbnailData, nil)
|
||||
}
|
||||
if case let .known(photo) = cachedData.photo {
|
||||
secondEntry = photo
|
||||
}
|
||||
}
|
||||
if case let .known(photo) = cachedData.fallbackPhoto {
|
||||
lastEntry = photo
|
||||
|
Loading…
x
Reference in New Issue
Block a user