Web app improvements

This commit is contained in:
Ilya Laktyushin
2023-09-01 14:31:51 +04:00
parent eb3da67032
commit f432842f75
6 changed files with 41 additions and 17 deletions

View File

@@ -91,7 +91,7 @@ public enum TelegramMediaActionType: PostboxCoding, Equatable {
case paymentSent(currency: String, totalAmount: Int64, invoiceSlug: String?, isRecurringInit: Bool, isRecurringUsed: Bool)
case customText(text: String, entities: [MessageTextEntity])
case botDomainAccessGranted(domain: String)
case botAppAccessGranted(appName: String, type: BotSendMessageAccessGrantedType?)
case botAppAccessGranted(appName: String?, type: BotSendMessageAccessGrantedType?)
case botSentSecureValues(types: [SentSecureValueType])
case peerJoined
case phoneNumberRequest
@@ -202,7 +202,7 @@ public enum TelegramMediaActionType: PostboxCoding, Equatable {
self = .unknown
}
case 35:
self = .botAppAccessGranted(appName: decoder.decodeStringForKey("app", orElse: ""), type: decoder.decodeOptionalInt32ForKey("atp").flatMap { BotSendMessageAccessGrantedType(rawValue: $0) })
self = .botAppAccessGranted(appName: decoder.decodeOptionalStringForKey("app"), type: decoder.decodeOptionalInt32ForKey("atp").flatMap { BotSendMessageAccessGrantedType(rawValue: $0) })
default:
self = .unknown
}
@@ -372,7 +372,11 @@ public enum TelegramMediaActionType: PostboxCoding, Equatable {
encoder.encode(TelegramWallpaperNativeCodable(wallpaper), forKey: "wallpaper")
case let .botAppAccessGranted(appName, type):
encoder.encodeInt32(35, forKey: "_rawValue")
encoder.encodeString(appName, forKey: "app")
if let appName = appName {
encoder.encodeString(appName, forKey: "app")
} else {
encoder.encodeNil(forKey: "app")
}
if let type = type {
encoder.encodeInt32(type.rawValue, forKey: "atp")
} else {