fix botapp

This commit is contained in:
Mike Renoir
2023-06-23 19:55:43 +02:00
parent 313fe3a509
commit 52bc89ab74

View File

@@ -709,14 +709,14 @@ func _internal_getBotApp(account: Account, reference: BotAppReference) -> Signal
}
|> mapToSignal { result -> Signal<BotApp, GetBotAppError> in
switch result {
case let .botApp(_, app):
case let .botApp(botAppFlags, app):
switch app {
case let .botApp(flags, id, accessHash, shortName, title, description, photo, document, hash):
var appFlags = BotApp.Flags()
if (flags & (1 << 0)) != 0 {
if (botAppFlags & (1 << 0)) != 0 {
appFlags.insert(.notActivated)
}
if (flags & (1 << 1)) != 0 {
if (botAppFlags & (1 << 1)) != 0 {
appFlags.insert(.requiresWriteAccess)
}
return .single(BotApp(id: id, accessHash: accessHash, shortName: shortName, title: title, description: description, photo: telegramMediaImageFromApiPhoto(photo), document: document.flatMap(telegramMediaFileFromApiDocument), hash: hash, flags: appFlags))