mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Fix build
This commit is contained in:
parent
2f40f770b9
commit
ae87ed7834
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user