From ae87ed7834386e6fb510c5dba3bdcda0ce2e015e Mon Sep 17 00:00:00 2001 From: Ali <> Date: Sun, 19 Jul 2020 14:27:33 +0400 Subject: [PATCH] Fix build --- submodules/TelegramCore/Sources/PeerPhotoUpdater.swift | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/submodules/TelegramCore/Sources/PeerPhotoUpdater.swift b/submodules/TelegramCore/Sources/PeerPhotoUpdater.swift index 9aac08971b..804707580f 100644 --- a/submodules/TelegramCore/Sources/PeerPhotoUpdater.swift +++ b/submodules/TelegramCore/Sources/PeerPhotoUpdater.swift @@ -294,10 +294,12 @@ public func updatePeerPhotoInternal(postbox: Postbox, network: Network, stateMan } } else { if let _ = peer as? TelegramUser { - return network.request(Api.functions.photos.updateProfilePhoto(id: Api.InputPhoto.inputPhotoEmpty)) - |> `catch` { _ -> Signal in - return .fail(.generic) + let signal: Signal = network.request(Api.functions.photos.updateProfilePhoto(id: Api.InputPhoto.inputPhotoEmpty)) + |> mapError { _ -> UploadPeerPhotoError in + return .generic } + + return signal |> mapToSignal { _ -> Signal in return .single(.complete([])) } @@ -341,7 +343,7 @@ public func updatePeerPhotoExisting(network: Network, reference: TelegramMediaIm switch reference { case let .cloud(imageId, accessHash, fileReference): return network.request(Api.functions.photos.updateProfilePhoto(id: .inputPhoto(id: imageId, accessHash: accessHash, fileReference: Buffer(data: fileReference)))) - |> `catch` { _ -> Signal in + |> `catch` { _ -> Signal in return .complete() } |> mapToSignal { _ -> Signal in