Various fixes

This commit is contained in:
Ilya Laktyushin 2023-11-17 03:15:03 +04:00
parent e8e2d419c5
commit b10556fdd0
2 changed files with 12 additions and 3 deletions

View File

@ -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
}

View File

@ -3344,7 +3344,7 @@ func replayFinalState(
var langPackDifferences: [String: [Api.LangPackDifference]] = [:]
var pollLangPacks = Set<String>()
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):