mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
Various fixes
This commit is contained in:
@@ -247,6 +247,14 @@ func _internal_updatePeerPhotoInternal(postbox: Postbox, network: Network, state
|
||||
return nil
|
||||
}
|
||||
}
|
||||
} else if let customPeerPhotoMode, case .custom = customPeerPhotoMode {
|
||||
transaction.updatePeerCachedData(peerIds: Set([peer.id])) { peerId, cachedPeerData in
|
||||
if let cachedPeerData = cachedPeerData as? CachedUserData {
|
||||
return cachedPeerData.withUpdatedPersonalPhoto(.known(image))
|
||||
} else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return (.complete(representations), photoResult.resource, videoResult?.resource)
|
||||
@@ -376,6 +384,14 @@ func _internal_updatePeerPhotoInternal(postbox: Postbox, network: Network, state
|
||||
return nil
|
||||
}
|
||||
}
|
||||
} else if let customPeerPhotoMode, case .custom = customPeerPhotoMode {
|
||||
transaction.updatePeerCachedData(peerIds: Set([peer.id])) { peerId, cachedPeerData in
|
||||
if let cachedPeerData = cachedPeerData as? CachedUserData {
|
||||
return cachedPeerData.withUpdatedPersonalPhoto(.known(nil))
|
||||
} else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
return .complete([])
|
||||
} |> mapError { _ -> UploadPeerPhotoError in }
|
||||
|
||||
Reference in New Issue
Block a user