mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 22:55:00 +00:00
Merge branch 'master' of gitlab.com:peter-iakovlev/telegram-ios
This commit is contained in:
@@ -6368,6 +6368,11 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
|
||||
var presentationData = presentationData
|
||||
var useDarkAppearance = presentationData.theme.overallDarkAppearance
|
||||
|
||||
if let wallpaper = chatWallpaper, case let .emoticon(wallpaperEmoticon) = wallpaper, let theme = chatThemes.first(where: { $0.emoticon?.strippedEmoji == wallpaperEmoticon.strippedEmoji }) {
|
||||
if let themeWallpaper = theme.settings?.first?.wallpaper {
|
||||
chatWallpaper = themeWallpaper
|
||||
}
|
||||
}
|
||||
if let themeEmoticon = themeEmoticon, let theme = chatThemes.first(where: { $0.emoticon?.strippedEmoji == themeEmoticon.strippedEmoji }) {
|
||||
if let darkAppearancePreview = darkAppearancePreview {
|
||||
useDarkAppearance = darkAppearancePreview
|
||||
@@ -7400,17 +7405,8 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
|
||||
|
||||
if let peerId = self.chatLocation.peerId {
|
||||
self.chatThemeEmoticonPromise.set(self.context.engine.data.get(TelegramEngine.EngineData.Item.Peer.ThemeEmoticon(id: peerId)))
|
||||
let chatWallpaper = self.context.account.viewTracker.peerView(peerId)
|
||||
let chatWallpaper = self.context.engine.data.get(TelegramEngine.EngineData.Item.Peer.Wallpaper(id: peerId))
|
||||
|> take(1)
|
||||
|> map { view -> TelegramWallpaper? in
|
||||
if let cachedData = view.cachedData as? CachedUserData {
|
||||
return cachedData.wallpaper
|
||||
} else if let cachedData = view.cachedData as? CachedChannelData {
|
||||
return cachedData.wallpaper
|
||||
} else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
self.chatWallpaperPromise.set(chatWallpaper)
|
||||
} else {
|
||||
self.chatThemeEmoticonPromise.set(.single(nil))
|
||||
|
||||
Reference in New Issue
Block a user