added missing flags for userFull

This commit is contained in:
Mike Renoir 2024-01-08 19:49:16 +04:00
parent 1428d1f051
commit 9e3524019a
2 changed files with 16 additions and 0 deletions

View File

@ -203,6 +203,7 @@ public struct CachedUserFlags: OptionSet {
public static let translationHidden = CachedUserFlags(rawValue: 1 << 0)
public static let isBlockedFromStories = CachedUserFlags(rawValue: 1 << 1)
public static let readDatesPrivate = CachedUserFlags(rawValue: 1 << 2)
}
public final class EditableBotInfo: PostboxCoding, Equatable {

View File

@ -235,6 +235,20 @@ func _internal_fetchAndUpdateCachedPeerData(accountPeerId: PeerId, peerId rawPee
let voiceCallsAvailable = (userFullFlags & (1 << 4)) != 0
let videoCallsAvailable = (userFullFlags & (1 << 13)) != 0
let voiceMessagesAvailable = (userFullFlags & (1 << 20)) == 0
let readDatesPrivate = (userFullFlags & (1 << 30)) != 0
let translationsDisabled = (userFullFlags & (1 << 23)) != 0
var flags: CachedUserFlags = previous.flags
if readDatesPrivate {
flags.insert(.readDatesPrivate)
} else {
flags.remove(.readDatesPrivate)
}
if translationsDisabled {
flags.insert(.translationHidden)
} else {
flags.remove(.translationHidden)
}
let callsPrivate = (userFullFlags & (1 << 5)) != 0
let canPinMessages = (userFullFlags & (1 << 7)) != 0
@ -286,6 +300,7 @@ func _internal_fetchAndUpdateCachedPeerData(accountPeerId: PeerId, peerId rawPee
.withUpdatedPremiumGiftOptions(premiumGiftOptions)
.withUpdatedVoiceMessagesAvailable(voiceMessagesAvailable)
.withUpdatedWallpaper(wallpaper)
.withUpdatedFlags(flags)
}
})
}