Fix build

This commit is contained in:
Ali 2020-07-19 14:27:33 +04:00
parent 2f40f770b9
commit ae87ed7834

View File

@ -294,10 +294,12 @@ public func updatePeerPhotoInternal(postbox: Postbox, network: Network, stateMan
} }
} else { } else {
if let _ = peer as? TelegramUser { if let _ = peer as? TelegramUser {
return network.request(Api.functions.photos.updateProfilePhoto(id: Api.InputPhoto.inputPhotoEmpty)) let signal: Signal<Api.photos.Photo, UploadPeerPhotoError> = network.request(Api.functions.photos.updateProfilePhoto(id: Api.InputPhoto.inputPhotoEmpty))
|> `catch` { _ -> Signal<Api.UserProfilePhoto, UploadPeerPhotoError> in |> mapError { _ -> UploadPeerPhotoError in
return .fail(.generic) return .generic
} }
return signal
|> mapToSignal { _ -> Signal<UpdatePeerPhotoStatus, UploadPeerPhotoError> in |> mapToSignal { _ -> Signal<UpdatePeerPhotoStatus, UploadPeerPhotoError> in
return .single(.complete([])) return .single(.complete([]))
} }
@ -341,7 +343,7 @@ public func updatePeerPhotoExisting(network: Network, reference: TelegramMediaIm
switch reference { switch reference {
case let .cloud(imageId, accessHash, fileReference): case let .cloud(imageId, accessHash, fileReference):
return network.request(Api.functions.photos.updateProfilePhoto(id: .inputPhoto(id: imageId, accessHash: accessHash, fileReference: Buffer(data: fileReference)))) return network.request(Api.functions.photos.updateProfilePhoto(id: .inputPhoto(id: imageId, accessHash: accessHash, fileReference: Buffer(data: fileReference))))
|> `catch` { _ -> Signal<Api.UserProfilePhoto, NoError> in |> `catch` { _ -> Signal<Api.photos.Photo, NoError> in
return .complete() return .complete()
} }
|> mapToSignal { _ -> Signal<Void, NoError> in |> mapToSignal { _ -> Signal<Void, NoError> in