diff --git a/submodules/AvatarNode/Sources/AvatarBadgeView.swift b/submodules/AvatarNode/Sources/AvatarBadgeView.swift index 7bc5ac487f..d226f743be 100644 --- a/submodules/AvatarNode/Sources/AvatarBadgeView.swift +++ b/submodules/AvatarNode/Sources/AvatarBadgeView.swift @@ -244,7 +244,16 @@ public final class AvatarBadgeView: UIImageView { var brightness: CGFloat = 0 var alpha: CGFloat = 0 backgroundColor.getHue(&hue, saturation: &saturation, brightness: &brightness, alpha: &alpha) - return UIColor(hue: hue, saturation: saturation, brightness: brightness * 0.9, alpha: alpha) + + if brightness > 0.5 { + brightness = max(brightness - 0.2, 0) + saturation = min(saturation + 0.2, 1) + } else { + brightness = min(brightness + 0.3, 1) + saturation = max(saturation - 0.2, 0) + } + + return UIColor(hue: hue, saturation: saturation, brightness: brightness, alpha: alpha) } else { return backgroundColor } diff --git a/submodules/TelegramCore/Sources/State/AccountStateManagementUtils.swift b/submodules/TelegramCore/Sources/State/AccountStateManagementUtils.swift index 16c2564b91..7334d848d9 100644 --- a/submodules/TelegramCore/Sources/State/AccountStateManagementUtils.swift +++ b/submodules/TelegramCore/Sources/State/AccountStateManagementUtils.swift @@ -3344,7 +3344,7 @@ func replayFinalState( var langPackDifferences: [String: [Api.LangPackDifference]] = [:] var pollLangPacks = Set() var updatedThemes: [Int64: TelegramTheme] = [:] - var updatedWallpapers: [PeerId: TelegramWallpaper] = [:] + var updatedWallpapers: [PeerId: TelegramWallpaper?] = [:] var delayNotificatonsUntil: Int32? var peerActivityTimestamps: [PeerId: Int32] = [:] var syncChatListFilters = false @@ -4382,7 +4382,7 @@ func replayFinalState( case let .UpdateTheme(theme): updatedThemes[theme.id] = theme case let .UpdateWallpaper(peerId, wallpaper): - updatedWallpapers[peerId] = wallpaper + updatedWallpapers.updateValue(wallpaper, forKey: peerId) case .SyncChatListFilters: syncChatListFilters = true case let .UpdateChatListFilterOrder(order):