Carry over isCloseFriend from non-min user

This commit is contained in:
Ali 2023-07-15 20:03:01 +04:00
parent 60c6d058e6
commit f8a7d0e2e6

View File

@ -104,7 +104,7 @@ extension TelegramUser {
static func merge(_ lhs: TelegramUser?, rhs: Api.User) -> TelegramUser? {
switch rhs {
case let .user(flags, flags2, _, rhsAccessHash, _, _, _, _, photo, _, _, restrictionReason, botInlinePlaceholder, _, emojiStatus, _, _):
case let .user(flags, _, _, rhsAccessHash, _, _, _, _, photo, _, _, restrictionReason, botInlinePlaceholder, _, emojiStatus, _, _):
let isMin = (flags & (1 << 20)) != 0
if !isMin {
return TelegramUser(user: rhs)
@ -137,7 +137,8 @@ extension TelegramUser {
if (flags & (1 << 28)) != 0 {
userFlags.insert(.isPremium)
}
if (flags2 & (1 << 2)) != 0 {
if lhs.flags.contains(.isCloseFriend) {
userFlags.insert(.isCloseFriend)
}