Chat wallpaper improvements

This commit is contained in:
Ilya Laktyushin
2023-04-06 20:10:57 +04:00
parent 34062b0a06
commit 4fa1d5462d
11 changed files with 112 additions and 139 deletions

View File

@@ -846,7 +846,7 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
strongSelf.chatDisplayNode.dismissInput()
let wallpaperPreviewController = WallpaperGalleryController(context: strongSelf.context, source: .wallpaper(wallpaper, nil, [], nil, nil, nil), mode: .peer(EnginePeer(peer), true))
wallpaperPreviewController.apply = { wallpaper, options, _ in
let _ = (strongSelf.context.engine.themes.setExistingChatWallpaper(messageId: message.id)
let _ = (strongSelf.context.engine.themes.setExistingChatWallpaper(messageId: message.id, wallpaper: nil)
|> deliverOnMainQueue).start(completed: { [weak wallpaperPreviewController] in
wallpaperPreviewController?.dismiss()
})
@@ -18537,7 +18537,7 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
controller.navigationPresentation = .modal
controller.apply = { [weak self] wallpaper, options, cropRect in
if let strongSelf = self {
uploadCustomPeerWallpaper(context: strongSelf.context, wallpaper: wallpaper, mode: options, cropRect: cropRect, peerId: peerId, completion: {
uploadCustomPeerWallpaper(context: strongSelf.context, wallpaper: wallpaper, mode: options, cropRect: cropRect, brightnessMultiplier: nil, peerId: peerId, completion: {
dismissControllers()
})
}