mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-11-07 17:30:12 +00:00
Fix build
This commit is contained in:
parent
2b9f5ed541
commit
067c35f545
@ -93,7 +93,7 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
|
|||||||
dict[1071145937] = { return Api.BotCommandScope.parse_botCommandScopePeerAdmins($0) }
|
dict[1071145937] = { return Api.BotCommandScope.parse_botCommandScopePeerAdmins($0) }
|
||||||
dict[169026035] = { return Api.BotCommandScope.parse_botCommandScopePeerUser($0) }
|
dict[169026035] = { return Api.BotCommandScope.parse_botCommandScopePeerUser($0) }
|
||||||
dict[1011811544] = { return Api.BotCommandScope.parse_botCommandScopeUsers($0) }
|
dict[1011811544] = { return Api.BotCommandScope.parse_botCommandScopeUsers($0) }
|
||||||
dict[912290611] = { return Api.BotInfo.parse_botInfo($0) }
|
dict[1300890265] = { return Api.BotInfo.parse_botInfo($0) }
|
||||||
dict[1984755728] = { return Api.BotInlineMessage.parse_botInlineMessageMediaAuto($0) }
|
dict[1984755728] = { return Api.BotInlineMessage.parse_botInlineMessageMediaAuto($0) }
|
||||||
dict[416402882] = { return Api.BotInlineMessage.parse_botInlineMessageMediaContact($0) }
|
dict[416402882] = { return Api.BotInlineMessage.parse_botInlineMessageMediaContact($0) }
|
||||||
dict[85477117] = { return Api.BotInlineMessage.parse_botInlineMessageMediaGeo($0) }
|
dict[85477117] = { return Api.BotInlineMessage.parse_botInlineMessageMediaGeo($0) }
|
||||||
@ -107,6 +107,8 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
|
|||||||
dict[1113113093] = { return Api.BotMenuButton.parse_botMenuButtonCommands($0) }
|
dict[1113113093] = { return Api.BotMenuButton.parse_botMenuButtonCommands($0) }
|
||||||
dict[1966318984] = { return Api.BotMenuButton.parse_botMenuButtonDefault($0) }
|
dict[1966318984] = { return Api.BotMenuButton.parse_botMenuButtonDefault($0) }
|
||||||
dict[602479523] = { return Api.BotPreviewMedia.parse_botPreviewMedia($0) }
|
dict[602479523] = { return Api.BotPreviewMedia.parse_botPreviewMedia($0) }
|
||||||
|
dict[1243376956] = { return Api.BotVerification.parse_botVerification($0) }
|
||||||
|
dict[-1328716265] = { return Api.BotVerifierSettings.parse_botVerifierSettings($0) }
|
||||||
dict[-1006669337] = { return Api.BroadcastRevenueBalances.parse_broadcastRevenueBalances($0) }
|
dict[-1006669337] = { return Api.BroadcastRevenueBalances.parse_broadcastRevenueBalances($0) }
|
||||||
dict[1434332356] = { return Api.BroadcastRevenueTransaction.parse_broadcastRevenueTransactionProceeds($0) }
|
dict[1434332356] = { return Api.BroadcastRevenueTransaction.parse_broadcastRevenueTransactionProceeds($0) }
|
||||||
dict[1121127726] = { return Api.BroadcastRevenueTransaction.parse_broadcastRevenueTransactionRefund($0) }
|
dict[1121127726] = { return Api.BroadcastRevenueTransaction.parse_broadcastRevenueTransactionRefund($0) }
|
||||||
@ -195,7 +197,7 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
|
|||||||
dict[-531931925] = { return Api.ChannelParticipantsFilter.parse_channelParticipantsMentions($0) }
|
dict[-531931925] = { return Api.ChannelParticipantsFilter.parse_channelParticipantsMentions($0) }
|
||||||
dict[-566281095] = { return Api.ChannelParticipantsFilter.parse_channelParticipantsRecent($0) }
|
dict[-566281095] = { return Api.ChannelParticipantsFilter.parse_channelParticipantsRecent($0) }
|
||||||
dict[106343499] = { return Api.ChannelParticipantsFilter.parse_channelParticipantsSearch($0) }
|
dict[106343499] = { return Api.ChannelParticipantsFilter.parse_channelParticipantsSearch($0) }
|
||||||
dict[-29067075] = { return Api.Chat.parse_channel($0) }
|
dict[1185852422] = { return Api.Chat.parse_channel($0) }
|
||||||
dict[399807445] = { return Api.Chat.parse_channelForbidden($0) }
|
dict[399807445] = { return Api.Chat.parse_channelForbidden($0) }
|
||||||
dict[1103884886] = { return Api.Chat.parse_chat($0) }
|
dict[1103884886] = { return Api.Chat.parse_chat($0) }
|
||||||
dict[693512293] = { return Api.Chat.parse_chatEmpty($0) }
|
dict[693512293] = { return Api.Chat.parse_chatEmpty($0) }
|
||||||
@ -205,7 +207,7 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
|
|||||||
dict[-1626209256] = { return Api.ChatBannedRights.parse_chatBannedRights($0) }
|
dict[-1626209256] = { return Api.ChatBannedRights.parse_chatBannedRights($0) }
|
||||||
dict[-1146407795] = { return Api.ChatFull.parse_channelFull($0) }
|
dict[-1146407795] = { return Api.ChatFull.parse_channelFull($0) }
|
||||||
dict[640893467] = { return Api.ChatFull.parse_chatFull($0) }
|
dict[640893467] = { return Api.ChatFull.parse_chatFull($0) }
|
||||||
dict[-26920803] = { return Api.ChatInvite.parse_chatInvite($0) }
|
dict[1553807106] = { return Api.ChatInvite.parse_chatInvite($0) }
|
||||||
dict[1516793212] = { return Api.ChatInvite.parse_chatInviteAlready($0) }
|
dict[1516793212] = { return Api.ChatInvite.parse_chatInviteAlready($0) }
|
||||||
dict[1634294960] = { return Api.ChatInvite.parse_chatInvitePeek($0) }
|
dict[1634294960] = { return Api.ChatInvite.parse_chatInvitePeek($0) }
|
||||||
dict[-1940201511] = { return Api.ChatInviteImporter.parse_chatInviteImporter($0) }
|
dict[-1940201511] = { return Api.ChatInviteImporter.parse_chatInviteImporter($0) }
|
||||||
@ -1117,7 +1119,7 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
|
|||||||
dict[-1886646706] = { return Api.UrlAuthResult.parse_urlAuthResultAccepted($0) }
|
dict[-1886646706] = { return Api.UrlAuthResult.parse_urlAuthResultAccepted($0) }
|
||||||
dict[-1445536993] = { return Api.UrlAuthResult.parse_urlAuthResultDefault($0) }
|
dict[-1445536993] = { return Api.UrlAuthResult.parse_urlAuthResultDefault($0) }
|
||||||
dict[-1831650802] = { return Api.UrlAuthResult.parse_urlAuthResultRequest($0) }
|
dict[-1831650802] = { return Api.UrlAuthResult.parse_urlAuthResultRequest($0) }
|
||||||
dict[-2093920310] = { return Api.User.parse_user($0) }
|
dict[1497852246] = { return Api.User.parse_user($0) }
|
||||||
dict[-742634630] = { return Api.User.parse_userEmpty($0) }
|
dict[-742634630] = { return Api.User.parse_userEmpty($0) }
|
||||||
dict[-1751309450] = { return Api.UserFull.parse_userFull($0) }
|
dict[-1751309450] = { return Api.UserFull.parse_userFull($0) }
|
||||||
dict[-2100168954] = { return Api.UserProfilePhoto.parse_userProfilePhoto($0) }
|
dict[-2100168954] = { return Api.UserProfilePhoto.parse_userProfilePhoto($0) }
|
||||||
@ -1545,6 +1547,10 @@ public extension Api {
|
|||||||
_1.serialize(buffer, boxed)
|
_1.serialize(buffer, boxed)
|
||||||
case let _1 as Api.BotPreviewMedia:
|
case let _1 as Api.BotPreviewMedia:
|
||||||
_1.serialize(buffer, boxed)
|
_1.serialize(buffer, boxed)
|
||||||
|
case let _1 as Api.BotVerification:
|
||||||
|
_1.serialize(buffer, boxed)
|
||||||
|
case let _1 as Api.BotVerifierSettings:
|
||||||
|
_1.serialize(buffer, boxed)
|
||||||
case let _1 as Api.BroadcastRevenueBalances:
|
case let _1 as Api.BroadcastRevenueBalances:
|
||||||
_1.serialize(buffer, boxed)
|
_1.serialize(buffer, boxed)
|
||||||
case let _1 as Api.BroadcastRevenueTransaction:
|
case let _1 as Api.BroadcastRevenueTransaction:
|
||||||
|
|||||||
@ -176,13 +176,13 @@ public extension Api {
|
|||||||
}
|
}
|
||||||
public extension Api {
|
public extension Api {
|
||||||
enum BotInfo: TypeConstructorDescription {
|
enum BotInfo: TypeConstructorDescription {
|
||||||
case botInfo(flags: Int32, userId: Int64?, description: String?, descriptionPhoto: Api.Photo?, descriptionDocument: Api.Document?, commands: [Api.BotCommand]?, menuButton: Api.BotMenuButton?, privacyPolicyUrl: String?, appSettings: Api.BotAppSettings?)
|
case botInfo(flags: Int32, userId: Int64?, description: String?, descriptionPhoto: Api.Photo?, descriptionDocument: Api.Document?, commands: [Api.BotCommand]?, menuButton: Api.BotMenuButton?, privacyPolicyUrl: String?, appSettings: Api.BotAppSettings?, verifierSettings: Api.BotVerifierSettings?)
|
||||||
|
|
||||||
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
||||||
switch self {
|
switch self {
|
||||||
case .botInfo(let flags, let userId, let description, let descriptionPhoto, let descriptionDocument, let commands, let menuButton, let privacyPolicyUrl, let appSettings):
|
case .botInfo(let flags, let userId, let description, let descriptionPhoto, let descriptionDocument, let commands, let menuButton, let privacyPolicyUrl, let appSettings, let verifierSettings):
|
||||||
if boxed {
|
if boxed {
|
||||||
buffer.appendInt32(912290611)
|
buffer.appendInt32(1300890265)
|
||||||
}
|
}
|
||||||
serializeInt32(flags, buffer: buffer, boxed: false)
|
serializeInt32(flags, buffer: buffer, boxed: false)
|
||||||
if Int(flags) & Int(1 << 0) != 0 {serializeInt64(userId!, buffer: buffer, boxed: false)}
|
if Int(flags) & Int(1 << 0) != 0 {serializeInt64(userId!, buffer: buffer, boxed: false)}
|
||||||
@ -197,14 +197,15 @@ public extension Api {
|
|||||||
if Int(flags) & Int(1 << 3) != 0 {menuButton!.serialize(buffer, true)}
|
if Int(flags) & Int(1 << 3) != 0 {menuButton!.serialize(buffer, true)}
|
||||||
if Int(flags) & Int(1 << 7) != 0 {serializeString(privacyPolicyUrl!, buffer: buffer, boxed: false)}
|
if Int(flags) & Int(1 << 7) != 0 {serializeString(privacyPolicyUrl!, buffer: buffer, boxed: false)}
|
||||||
if Int(flags) & Int(1 << 8) != 0 {appSettings!.serialize(buffer, true)}
|
if Int(flags) & Int(1 << 8) != 0 {appSettings!.serialize(buffer, true)}
|
||||||
|
if Int(flags) & Int(1 << 9) != 0 {verifierSettings!.serialize(buffer, true)}
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public func descriptionFields() -> (String, [(String, Any)]) {
|
public func descriptionFields() -> (String, [(String, Any)]) {
|
||||||
switch self {
|
switch self {
|
||||||
case .botInfo(let flags, let userId, let description, let descriptionPhoto, let descriptionDocument, let commands, let menuButton, let privacyPolicyUrl, let appSettings):
|
case .botInfo(let flags, let userId, let description, let descriptionPhoto, let descriptionDocument, let commands, let menuButton, let privacyPolicyUrl, let appSettings, let verifierSettings):
|
||||||
return ("botInfo", [("flags", flags as Any), ("userId", userId as Any), ("description", description as Any), ("descriptionPhoto", descriptionPhoto as Any), ("descriptionDocument", descriptionDocument as Any), ("commands", commands as Any), ("menuButton", menuButton as Any), ("privacyPolicyUrl", privacyPolicyUrl as Any), ("appSettings", appSettings as Any)])
|
return ("botInfo", [("flags", flags as Any), ("userId", userId as Any), ("description", description as Any), ("descriptionPhoto", descriptionPhoto as Any), ("descriptionDocument", descriptionDocument as Any), ("commands", commands as Any), ("menuButton", menuButton as Any), ("privacyPolicyUrl", privacyPolicyUrl as Any), ("appSettings", appSettings as Any), ("verifierSettings", verifierSettings as Any)])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -237,6 +238,10 @@ public extension Api {
|
|||||||
if Int(_1!) & Int(1 << 8) != 0 {if let signature = reader.readInt32() {
|
if Int(_1!) & Int(1 << 8) != 0 {if let signature = reader.readInt32() {
|
||||||
_9 = Api.parse(reader, signature: signature) as? Api.BotAppSettings
|
_9 = Api.parse(reader, signature: signature) as? Api.BotAppSettings
|
||||||
} }
|
} }
|
||||||
|
var _10: Api.BotVerifierSettings?
|
||||||
|
if Int(_1!) & Int(1 << 9) != 0 {if let signature = reader.readInt32() {
|
||||||
|
_10 = Api.parse(reader, signature: signature) as? Api.BotVerifierSettings
|
||||||
|
} }
|
||||||
let _c1 = _1 != nil
|
let _c1 = _1 != nil
|
||||||
let _c2 = (Int(_1!) & Int(1 << 0) == 0) || _2 != nil
|
let _c2 = (Int(_1!) & Int(1 << 0) == 0) || _2 != nil
|
||||||
let _c3 = (Int(_1!) & Int(1 << 1) == 0) || _3 != nil
|
let _c3 = (Int(_1!) & Int(1 << 1) == 0) || _3 != nil
|
||||||
@ -246,8 +251,9 @@ public extension Api {
|
|||||||
let _c7 = (Int(_1!) & Int(1 << 3) == 0) || _7 != nil
|
let _c7 = (Int(_1!) & Int(1 << 3) == 0) || _7 != nil
|
||||||
let _c8 = (Int(_1!) & Int(1 << 7) == 0) || _8 != nil
|
let _c8 = (Int(_1!) & Int(1 << 7) == 0) || _8 != nil
|
||||||
let _c9 = (Int(_1!) & Int(1 << 8) == 0) || _9 != nil
|
let _c9 = (Int(_1!) & Int(1 << 8) == 0) || _9 != nil
|
||||||
if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 {
|
let _c10 = (Int(_1!) & Int(1 << 9) == 0) || _10 != nil
|
||||||
return Api.BotInfo.botInfo(flags: _1!, userId: _2, description: _3, descriptionPhoto: _4, descriptionDocument: _5, commands: _6, menuButton: _7, privacyPolicyUrl: _8, appSettings: _9)
|
if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 {
|
||||||
|
return Api.BotInfo.botInfo(flags: _1!, userId: _2, description: _3, descriptionPhoto: _4, descriptionDocument: _5, commands: _6, menuButton: _7, privacyPolicyUrl: _8, appSettings: _9, verifierSettings: _10)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return nil
|
return nil
|
||||||
@ -816,6 +822,106 @@ public extension Api {
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public extension Api {
|
||||||
|
enum BotVerification: TypeConstructorDescription {
|
||||||
|
case botVerification(flags: Int32, botId: Int64, icon: Int64, company: String, description: String?)
|
||||||
|
|
||||||
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
||||||
|
switch self {
|
||||||
|
case .botVerification(let flags, let botId, let icon, let company, let description):
|
||||||
|
if boxed {
|
||||||
|
buffer.appendInt32(1243376956)
|
||||||
|
}
|
||||||
|
serializeInt32(flags, buffer: buffer, boxed: false)
|
||||||
|
serializeInt64(botId, buffer: buffer, boxed: false)
|
||||||
|
serializeInt64(icon, buffer: buffer, boxed: false)
|
||||||
|
serializeString(company, buffer: buffer, boxed: false)
|
||||||
|
if Int(flags) & Int(1 << 0) != 0 {serializeString(description!, buffer: buffer, boxed: false)}
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public func descriptionFields() -> (String, [(String, Any)]) {
|
||||||
|
switch self {
|
||||||
|
case .botVerification(let flags, let botId, let icon, let company, let description):
|
||||||
|
return ("botVerification", [("flags", flags as Any), ("botId", botId as Any), ("icon", icon as Any), ("company", company as Any), ("description", description as Any)])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static func parse_botVerification(_ reader: BufferReader) -> BotVerification? {
|
||||||
|
var _1: Int32?
|
||||||
|
_1 = reader.readInt32()
|
||||||
|
var _2: Int64?
|
||||||
|
_2 = reader.readInt64()
|
||||||
|
var _3: Int64?
|
||||||
|
_3 = reader.readInt64()
|
||||||
|
var _4: String?
|
||||||
|
_4 = parseString(reader)
|
||||||
|
var _5: String?
|
||||||
|
if Int(_1!) & Int(1 << 0) != 0 {_5 = parseString(reader) }
|
||||||
|
let _c1 = _1 != nil
|
||||||
|
let _c2 = _2 != nil
|
||||||
|
let _c3 = _3 != nil
|
||||||
|
let _c4 = _4 != nil
|
||||||
|
let _c5 = (Int(_1!) & Int(1 << 0) == 0) || _5 != nil
|
||||||
|
if _c1 && _c2 && _c3 && _c4 && _c5 {
|
||||||
|
return Api.BotVerification.botVerification(flags: _1!, botId: _2!, icon: _3!, company: _4!, description: _5)
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public extension Api {
|
||||||
|
enum BotVerifierSettings: TypeConstructorDescription {
|
||||||
|
case botVerifierSettings(flags: Int32, icon: Int64, company: String, customDescription: String?)
|
||||||
|
|
||||||
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
||||||
|
switch self {
|
||||||
|
case .botVerifierSettings(let flags, let icon, let company, let customDescription):
|
||||||
|
if boxed {
|
||||||
|
buffer.appendInt32(-1328716265)
|
||||||
|
}
|
||||||
|
serializeInt32(flags, buffer: buffer, boxed: false)
|
||||||
|
serializeInt64(icon, buffer: buffer, boxed: false)
|
||||||
|
serializeString(company, buffer: buffer, boxed: false)
|
||||||
|
if Int(flags) & Int(1 << 0) != 0 {serializeString(customDescription!, buffer: buffer, boxed: false)}
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public func descriptionFields() -> (String, [(String, Any)]) {
|
||||||
|
switch self {
|
||||||
|
case .botVerifierSettings(let flags, let icon, let company, let customDescription):
|
||||||
|
return ("botVerifierSettings", [("flags", flags as Any), ("icon", icon as Any), ("company", company as Any), ("customDescription", customDescription as Any)])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static func parse_botVerifierSettings(_ reader: BufferReader) -> BotVerifierSettings? {
|
||||||
|
var _1: Int32?
|
||||||
|
_1 = reader.readInt32()
|
||||||
|
var _2: Int64?
|
||||||
|
_2 = reader.readInt64()
|
||||||
|
var _3: String?
|
||||||
|
_3 = parseString(reader)
|
||||||
|
var _4: String?
|
||||||
|
if Int(_1!) & Int(1 << 0) != 0 {_4 = parseString(reader) }
|
||||||
|
let _c1 = _1 != nil
|
||||||
|
let _c2 = _2 != nil
|
||||||
|
let _c3 = _3 != nil
|
||||||
|
let _c4 = (Int(_1!) & Int(1 << 0) == 0) || _4 != nil
|
||||||
|
if _c1 && _c2 && _c3 && _c4 {
|
||||||
|
return Api.BotVerifierSettings.botVerifierSettings(flags: _1!, icon: _2!, company: _3!, customDescription: _4)
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
public extension Api {
|
public extension Api {
|
||||||
enum BroadcastRevenueBalances: TypeConstructorDescription {
|
enum BroadcastRevenueBalances: TypeConstructorDescription {
|
||||||
case broadcastRevenueBalances(flags: Int32, currentBalance: Int64, availableBalance: Int64, overallRevenue: Int64)
|
case broadcastRevenueBalances(flags: Int32, currentBalance: Int64, availableBalance: Int64, overallRevenue: Int64)
|
||||||
@ -1092,121 +1198,3 @@ public extension Api {
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public extension Api {
|
|
||||||
enum BusinessBotRecipients: TypeConstructorDescription {
|
|
||||||
case businessBotRecipients(flags: Int32, users: [Int64]?, excludeUsers: [Int64]?)
|
|
||||||
|
|
||||||
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
||||||
switch self {
|
|
||||||
case .businessBotRecipients(let flags, let users, let excludeUsers):
|
|
||||||
if boxed {
|
|
||||||
buffer.appendInt32(-1198722189)
|
|
||||||
}
|
|
||||||
serializeInt32(flags, buffer: buffer, boxed: false)
|
|
||||||
if Int(flags) & Int(1 << 4) != 0 {buffer.appendInt32(481674261)
|
|
||||||
buffer.appendInt32(Int32(users!.count))
|
|
||||||
for item in users! {
|
|
||||||
serializeInt64(item, buffer: buffer, boxed: false)
|
|
||||||
}}
|
|
||||||
if Int(flags) & Int(1 << 6) != 0 {buffer.appendInt32(481674261)
|
|
||||||
buffer.appendInt32(Int32(excludeUsers!.count))
|
|
||||||
for item in excludeUsers! {
|
|
||||||
serializeInt64(item, buffer: buffer, boxed: false)
|
|
||||||
}}
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public func descriptionFields() -> (String, [(String, Any)]) {
|
|
||||||
switch self {
|
|
||||||
case .businessBotRecipients(let flags, let users, let excludeUsers):
|
|
||||||
return ("businessBotRecipients", [("flags", flags as Any), ("users", users as Any), ("excludeUsers", excludeUsers as Any)])
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static func parse_businessBotRecipients(_ reader: BufferReader) -> BusinessBotRecipients? {
|
|
||||||
var _1: Int32?
|
|
||||||
_1 = reader.readInt32()
|
|
||||||
var _2: [Int64]?
|
|
||||||
if Int(_1!) & Int(1 << 4) != 0 {if let _ = reader.readInt32() {
|
|
||||||
_2 = Api.parseVector(reader, elementSignature: 570911930, elementType: Int64.self)
|
|
||||||
} }
|
|
||||||
var _3: [Int64]?
|
|
||||||
if Int(_1!) & Int(1 << 6) != 0 {if let _ = reader.readInt32() {
|
|
||||||
_3 = Api.parseVector(reader, elementSignature: 570911930, elementType: Int64.self)
|
|
||||||
} }
|
|
||||||
let _c1 = _1 != nil
|
|
||||||
let _c2 = (Int(_1!) & Int(1 << 4) == 0) || _2 != nil
|
|
||||||
let _c3 = (Int(_1!) & Int(1 << 6) == 0) || _3 != nil
|
|
||||||
if _c1 && _c2 && _c3 {
|
|
||||||
return Api.BusinessBotRecipients.businessBotRecipients(flags: _1!, users: _2, excludeUsers: _3)
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public extension Api {
|
|
||||||
enum BusinessChatLink: TypeConstructorDescription {
|
|
||||||
case businessChatLink(flags: Int32, link: String, message: String, entities: [Api.MessageEntity]?, title: String?, views: Int32)
|
|
||||||
|
|
||||||
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
||||||
switch self {
|
|
||||||
case .businessChatLink(let flags, let link, let message, let entities, let title, let views):
|
|
||||||
if boxed {
|
|
||||||
buffer.appendInt32(-1263638929)
|
|
||||||
}
|
|
||||||
serializeInt32(flags, buffer: buffer, boxed: false)
|
|
||||||
serializeString(link, buffer: buffer, boxed: false)
|
|
||||||
serializeString(message, buffer: buffer, boxed: false)
|
|
||||||
if Int(flags) & Int(1 << 0) != 0 {buffer.appendInt32(481674261)
|
|
||||||
buffer.appendInt32(Int32(entities!.count))
|
|
||||||
for item in entities! {
|
|
||||||
item.serialize(buffer, true)
|
|
||||||
}}
|
|
||||||
if Int(flags) & Int(1 << 1) != 0 {serializeString(title!, buffer: buffer, boxed: false)}
|
|
||||||
serializeInt32(views, buffer: buffer, boxed: false)
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public func descriptionFields() -> (String, [(String, Any)]) {
|
|
||||||
switch self {
|
|
||||||
case .businessChatLink(let flags, let link, let message, let entities, let title, let views):
|
|
||||||
return ("businessChatLink", [("flags", flags as Any), ("link", link as Any), ("message", message as Any), ("entities", entities as Any), ("title", title as Any), ("views", views as Any)])
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static func parse_businessChatLink(_ reader: BufferReader) -> BusinessChatLink? {
|
|
||||||
var _1: Int32?
|
|
||||||
_1 = reader.readInt32()
|
|
||||||
var _2: String?
|
|
||||||
_2 = parseString(reader)
|
|
||||||
var _3: String?
|
|
||||||
_3 = parseString(reader)
|
|
||||||
var _4: [Api.MessageEntity]?
|
|
||||||
if Int(_1!) & Int(1 << 0) != 0 {if let _ = reader.readInt32() {
|
|
||||||
_4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self)
|
|
||||||
} }
|
|
||||||
var _5: String?
|
|
||||||
if Int(_1!) & Int(1 << 1) != 0 {_5 = parseString(reader) }
|
|
||||||
var _6: Int32?
|
|
||||||
_6 = reader.readInt32()
|
|
||||||
let _c1 = _1 != nil
|
|
||||||
let _c2 = _2 != nil
|
|
||||||
let _c3 = _3 != nil
|
|
||||||
let _c4 = (Int(_1!) & Int(1 << 0) == 0) || _4 != nil
|
|
||||||
let _c5 = (Int(_1!) & Int(1 << 1) == 0) || _5 != nil
|
|
||||||
let _c6 = _6 != nil
|
|
||||||
if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 {
|
|
||||||
return Api.BusinessChatLink.businessChatLink(flags: _1!, link: _2!, message: _3!, entities: _4, title: _5, views: _6!)
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@ -452,14 +452,14 @@ public extension Api {
|
|||||||
}
|
}
|
||||||
public extension Api {
|
public extension Api {
|
||||||
enum User: TypeConstructorDescription {
|
enum User: TypeConstructorDescription {
|
||||||
case user(flags: Int32, flags2: Int32, id: Int64, accessHash: Int64?, firstName: String?, lastName: String?, username: String?, phone: String?, photo: Api.UserProfilePhoto?, status: Api.UserStatus?, botInfoVersion: Int32?, restrictionReason: [Api.RestrictionReason]?, botInlinePlaceholder: String?, langCode: String?, emojiStatus: Api.EmojiStatus?, usernames: [Api.Username]?, storiesMaxId: Int32?, color: Api.PeerColor?, profileColor: Api.PeerColor?, botActiveUsers: Int32?)
|
case user(flags: Int32, flags2: Int32, id: Int64, accessHash: Int64?, firstName: String?, lastName: String?, username: String?, phone: String?, photo: Api.UserProfilePhoto?, status: Api.UserStatus?, botInfoVersion: Int32?, restrictionReason: [Api.RestrictionReason]?, botInlinePlaceholder: String?, langCode: String?, emojiStatus: Api.EmojiStatus?, usernames: [Api.Username]?, storiesMaxId: Int32?, color: Api.PeerColor?, profileColor: Api.PeerColor?, botActiveUsers: Int32?, botVerification: Api.BotVerification?)
|
||||||
case userEmpty(id: Int64)
|
case userEmpty(id: Int64)
|
||||||
|
|
||||||
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
||||||
switch self {
|
switch self {
|
||||||
case .user(let flags, let flags2, let id, let accessHash, let firstName, let lastName, let username, let phone, let photo, let status, let botInfoVersion, let restrictionReason, let botInlinePlaceholder, let langCode, let emojiStatus, let usernames, let storiesMaxId, let color, let profileColor, let botActiveUsers):
|
case .user(let flags, let flags2, let id, let accessHash, let firstName, let lastName, let username, let phone, let photo, let status, let botInfoVersion, let restrictionReason, let botInlinePlaceholder, let langCode, let emojiStatus, let usernames, let storiesMaxId, let color, let profileColor, let botActiveUsers, let botVerification):
|
||||||
if boxed {
|
if boxed {
|
||||||
buffer.appendInt32(-2093920310)
|
buffer.appendInt32(1497852246)
|
||||||
}
|
}
|
||||||
serializeInt32(flags, buffer: buffer, boxed: false)
|
serializeInt32(flags, buffer: buffer, boxed: false)
|
||||||
serializeInt32(flags2, buffer: buffer, boxed: false)
|
serializeInt32(flags2, buffer: buffer, boxed: false)
|
||||||
@ -489,6 +489,7 @@ public extension Api {
|
|||||||
if Int(flags2) & Int(1 << 8) != 0 {color!.serialize(buffer, true)}
|
if Int(flags2) & Int(1 << 8) != 0 {color!.serialize(buffer, true)}
|
||||||
if Int(flags2) & Int(1 << 9) != 0 {profileColor!.serialize(buffer, true)}
|
if Int(flags2) & Int(1 << 9) != 0 {profileColor!.serialize(buffer, true)}
|
||||||
if Int(flags2) & Int(1 << 12) != 0 {serializeInt32(botActiveUsers!, buffer: buffer, boxed: false)}
|
if Int(flags2) & Int(1 << 12) != 0 {serializeInt32(botActiveUsers!, buffer: buffer, boxed: false)}
|
||||||
|
if Int(flags2) & Int(1 << 14) != 0 {botVerification!.serialize(buffer, true)}
|
||||||
break
|
break
|
||||||
case .userEmpty(let id):
|
case .userEmpty(let id):
|
||||||
if boxed {
|
if boxed {
|
||||||
@ -501,8 +502,8 @@ public extension Api {
|
|||||||
|
|
||||||
public func descriptionFields() -> (String, [(String, Any)]) {
|
public func descriptionFields() -> (String, [(String, Any)]) {
|
||||||
switch self {
|
switch self {
|
||||||
case .user(let flags, let flags2, let id, let accessHash, let firstName, let lastName, let username, let phone, let photo, let status, let botInfoVersion, let restrictionReason, let botInlinePlaceholder, let langCode, let emojiStatus, let usernames, let storiesMaxId, let color, let profileColor, let botActiveUsers):
|
case .user(let flags, let flags2, let id, let accessHash, let firstName, let lastName, let username, let phone, let photo, let status, let botInfoVersion, let restrictionReason, let botInlinePlaceholder, let langCode, let emojiStatus, let usernames, let storiesMaxId, let color, let profileColor, let botActiveUsers, let botVerification):
|
||||||
return ("user", [("flags", flags as Any), ("flags2", flags2 as Any), ("id", id as Any), ("accessHash", accessHash as Any), ("firstName", firstName as Any), ("lastName", lastName as Any), ("username", username as Any), ("phone", phone as Any), ("photo", photo as Any), ("status", status as Any), ("botInfoVersion", botInfoVersion as Any), ("restrictionReason", restrictionReason as Any), ("botInlinePlaceholder", botInlinePlaceholder as Any), ("langCode", langCode as Any), ("emojiStatus", emojiStatus as Any), ("usernames", usernames as Any), ("storiesMaxId", storiesMaxId as Any), ("color", color as Any), ("profileColor", profileColor as Any), ("botActiveUsers", botActiveUsers as Any)])
|
return ("user", [("flags", flags as Any), ("flags2", flags2 as Any), ("id", id as Any), ("accessHash", accessHash as Any), ("firstName", firstName as Any), ("lastName", lastName as Any), ("username", username as Any), ("phone", phone as Any), ("photo", photo as Any), ("status", status as Any), ("botInfoVersion", botInfoVersion as Any), ("restrictionReason", restrictionReason as Any), ("botInlinePlaceholder", botInlinePlaceholder as Any), ("langCode", langCode as Any), ("emojiStatus", emojiStatus as Any), ("usernames", usernames as Any), ("storiesMaxId", storiesMaxId as Any), ("color", color as Any), ("profileColor", profileColor as Any), ("botActiveUsers", botActiveUsers as Any), ("botVerification", botVerification as Any)])
|
||||||
case .userEmpty(let id):
|
case .userEmpty(let id):
|
||||||
return ("userEmpty", [("id", id as Any)])
|
return ("userEmpty", [("id", id as Any)])
|
||||||
}
|
}
|
||||||
@ -563,6 +564,10 @@ public extension Api {
|
|||||||
} }
|
} }
|
||||||
var _20: Int32?
|
var _20: Int32?
|
||||||
if Int(_2!) & Int(1 << 12) != 0 {_20 = reader.readInt32() }
|
if Int(_2!) & Int(1 << 12) != 0 {_20 = reader.readInt32() }
|
||||||
|
var _21: Api.BotVerification?
|
||||||
|
if Int(_2!) & Int(1 << 14) != 0 {if let signature = reader.readInt32() {
|
||||||
|
_21 = Api.parse(reader, signature: signature) as? Api.BotVerification
|
||||||
|
} }
|
||||||
let _c1 = _1 != nil
|
let _c1 = _1 != nil
|
||||||
let _c2 = _2 != nil
|
let _c2 = _2 != nil
|
||||||
let _c3 = _3 != nil
|
let _c3 = _3 != nil
|
||||||
@ -583,8 +588,9 @@ public extension Api {
|
|||||||
let _c18 = (Int(_2!) & Int(1 << 8) == 0) || _18 != nil
|
let _c18 = (Int(_2!) & Int(1 << 8) == 0) || _18 != nil
|
||||||
let _c19 = (Int(_2!) & Int(1 << 9) == 0) || _19 != nil
|
let _c19 = (Int(_2!) & Int(1 << 9) == 0) || _19 != nil
|
||||||
let _c20 = (Int(_2!) & Int(1 << 12) == 0) || _20 != nil
|
let _c20 = (Int(_2!) & Int(1 << 12) == 0) || _20 != nil
|
||||||
if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 && _c12 && _c13 && _c14 && _c15 && _c16 && _c17 && _c18 && _c19 && _c20 {
|
let _c21 = (Int(_2!) & Int(1 << 14) == 0) || _21 != nil
|
||||||
return Api.User.user(flags: _1!, flags2: _2!, id: _3!, accessHash: _4, firstName: _5, lastName: _6, username: _7, phone: _8, photo: _9, status: _10, botInfoVersion: _11, restrictionReason: _12, botInlinePlaceholder: _13, langCode: _14, emojiStatus: _15, usernames: _16, storiesMaxId: _17, color: _18, profileColor: _19, botActiveUsers: _20)
|
if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 && _c12 && _c13 && _c14 && _c15 && _c16 && _c17 && _c18 && _c19 && _c20 && _c21 {
|
||||||
|
return Api.User.user(flags: _1!, flags2: _2!, id: _3!, accessHash: _4, firstName: _5, lastName: _6, username: _7, phone: _8, photo: _9, status: _10, botInfoVersion: _11, restrictionReason: _12, botInlinePlaceholder: _13, langCode: _14, emojiStatus: _15, usernames: _16, storiesMaxId: _17, color: _18, profileColor: _19, botActiveUsers: _20, botVerification: _21)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
@ -1,3 +1,121 @@
|
|||||||
|
public extension Api {
|
||||||
|
enum BusinessBotRecipients: TypeConstructorDescription {
|
||||||
|
case businessBotRecipients(flags: Int32, users: [Int64]?, excludeUsers: [Int64]?)
|
||||||
|
|
||||||
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
||||||
|
switch self {
|
||||||
|
case .businessBotRecipients(let flags, let users, let excludeUsers):
|
||||||
|
if boxed {
|
||||||
|
buffer.appendInt32(-1198722189)
|
||||||
|
}
|
||||||
|
serializeInt32(flags, buffer: buffer, boxed: false)
|
||||||
|
if Int(flags) & Int(1 << 4) != 0 {buffer.appendInt32(481674261)
|
||||||
|
buffer.appendInt32(Int32(users!.count))
|
||||||
|
for item in users! {
|
||||||
|
serializeInt64(item, buffer: buffer, boxed: false)
|
||||||
|
}}
|
||||||
|
if Int(flags) & Int(1 << 6) != 0 {buffer.appendInt32(481674261)
|
||||||
|
buffer.appendInt32(Int32(excludeUsers!.count))
|
||||||
|
for item in excludeUsers! {
|
||||||
|
serializeInt64(item, buffer: buffer, boxed: false)
|
||||||
|
}}
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public func descriptionFields() -> (String, [(String, Any)]) {
|
||||||
|
switch self {
|
||||||
|
case .businessBotRecipients(let flags, let users, let excludeUsers):
|
||||||
|
return ("businessBotRecipients", [("flags", flags as Any), ("users", users as Any), ("excludeUsers", excludeUsers as Any)])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static func parse_businessBotRecipients(_ reader: BufferReader) -> BusinessBotRecipients? {
|
||||||
|
var _1: Int32?
|
||||||
|
_1 = reader.readInt32()
|
||||||
|
var _2: [Int64]?
|
||||||
|
if Int(_1!) & Int(1 << 4) != 0 {if let _ = reader.readInt32() {
|
||||||
|
_2 = Api.parseVector(reader, elementSignature: 570911930, elementType: Int64.self)
|
||||||
|
} }
|
||||||
|
var _3: [Int64]?
|
||||||
|
if Int(_1!) & Int(1 << 6) != 0 {if let _ = reader.readInt32() {
|
||||||
|
_3 = Api.parseVector(reader, elementSignature: 570911930, elementType: Int64.self)
|
||||||
|
} }
|
||||||
|
let _c1 = _1 != nil
|
||||||
|
let _c2 = (Int(_1!) & Int(1 << 4) == 0) || _2 != nil
|
||||||
|
let _c3 = (Int(_1!) & Int(1 << 6) == 0) || _3 != nil
|
||||||
|
if _c1 && _c2 && _c3 {
|
||||||
|
return Api.BusinessBotRecipients.businessBotRecipients(flags: _1!, users: _2, excludeUsers: _3)
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public extension Api {
|
||||||
|
enum BusinessChatLink: TypeConstructorDescription {
|
||||||
|
case businessChatLink(flags: Int32, link: String, message: String, entities: [Api.MessageEntity]?, title: String?, views: Int32)
|
||||||
|
|
||||||
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
||||||
|
switch self {
|
||||||
|
case .businessChatLink(let flags, let link, let message, let entities, let title, let views):
|
||||||
|
if boxed {
|
||||||
|
buffer.appendInt32(-1263638929)
|
||||||
|
}
|
||||||
|
serializeInt32(flags, buffer: buffer, boxed: false)
|
||||||
|
serializeString(link, buffer: buffer, boxed: false)
|
||||||
|
serializeString(message, buffer: buffer, boxed: false)
|
||||||
|
if Int(flags) & Int(1 << 0) != 0 {buffer.appendInt32(481674261)
|
||||||
|
buffer.appendInt32(Int32(entities!.count))
|
||||||
|
for item in entities! {
|
||||||
|
item.serialize(buffer, true)
|
||||||
|
}}
|
||||||
|
if Int(flags) & Int(1 << 1) != 0 {serializeString(title!, buffer: buffer, boxed: false)}
|
||||||
|
serializeInt32(views, buffer: buffer, boxed: false)
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public func descriptionFields() -> (String, [(String, Any)]) {
|
||||||
|
switch self {
|
||||||
|
case .businessChatLink(let flags, let link, let message, let entities, let title, let views):
|
||||||
|
return ("businessChatLink", [("flags", flags as Any), ("link", link as Any), ("message", message as Any), ("entities", entities as Any), ("title", title as Any), ("views", views as Any)])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static func parse_businessChatLink(_ reader: BufferReader) -> BusinessChatLink? {
|
||||||
|
var _1: Int32?
|
||||||
|
_1 = reader.readInt32()
|
||||||
|
var _2: String?
|
||||||
|
_2 = parseString(reader)
|
||||||
|
var _3: String?
|
||||||
|
_3 = parseString(reader)
|
||||||
|
var _4: [Api.MessageEntity]?
|
||||||
|
if Int(_1!) & Int(1 << 0) != 0 {if let _ = reader.readInt32() {
|
||||||
|
_4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self)
|
||||||
|
} }
|
||||||
|
var _5: String?
|
||||||
|
if Int(_1!) & Int(1 << 1) != 0 {_5 = parseString(reader) }
|
||||||
|
var _6: Int32?
|
||||||
|
_6 = reader.readInt32()
|
||||||
|
let _c1 = _1 != nil
|
||||||
|
let _c2 = _2 != nil
|
||||||
|
let _c3 = _3 != nil
|
||||||
|
let _c4 = (Int(_1!) & Int(1 << 0) == 0) || _4 != nil
|
||||||
|
let _c5 = (Int(_1!) & Int(1 << 1) == 0) || _5 != nil
|
||||||
|
let _c6 = _6 != nil
|
||||||
|
if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 {
|
||||||
|
return Api.BusinessChatLink.businessChatLink(flags: _1!, link: _2!, message: _3!, entities: _4, title: _5, views: _6!)
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
public extension Api {
|
public extension Api {
|
||||||
enum BusinessGreetingMessage: TypeConstructorDescription {
|
enum BusinessGreetingMessage: TypeConstructorDescription {
|
||||||
case businessGreetingMessage(shortcutId: Int32, recipients: Api.BusinessRecipients, noActivityDays: Int32)
|
case businessGreetingMessage(shortcutId: Int32, recipients: Api.BusinessRecipients, noActivityDays: Int32)
|
||||||
|
|||||||
@ -2606,6 +2606,24 @@ public extension Api.functions.bots {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public extension Api.functions.bots {
|
||||||
|
static func setCustomVerification(flags: Int32, bot: Api.InputUser?, peer: Api.InputPeer, customDescription: String?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<Api.Bool>) {
|
||||||
|
let buffer = Buffer()
|
||||||
|
buffer.appendInt32(-1953898563)
|
||||||
|
serializeInt32(flags, buffer: buffer, boxed: false)
|
||||||
|
if Int(flags) & Int(1 << 0) != 0 {bot!.serialize(buffer, true)}
|
||||||
|
peer.serialize(buffer, true)
|
||||||
|
if Int(flags) & Int(1 << 2) != 0 {serializeString(customDescription!, buffer: buffer, boxed: false)}
|
||||||
|
return (FunctionDescription(name: "bots.setCustomVerification", parameters: [("flags", String(describing: flags)), ("bot", String(describing: bot)), ("peer", String(describing: peer)), ("customDescription", String(describing: customDescription))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in
|
||||||
|
let reader = BufferReader(buffer)
|
||||||
|
var result: Api.Bool?
|
||||||
|
if let signature = reader.readInt32() {
|
||||||
|
result = Api.parse(reader, signature: signature) as? Api.Bool
|
||||||
|
}
|
||||||
|
return result
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
public extension Api.functions.bots {
|
public extension Api.functions.bots {
|
||||||
static func toggleUserEmojiStatusPermission(bot: Api.InputUser, enabled: Api.Bool) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<Api.Bool>) {
|
static func toggleUserEmojiStatusPermission(bot: Api.InputUser, enabled: Api.Bool) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<Api.Bool>) {
|
||||||
let buffer = Buffer()
|
let buffer = Buffer()
|
||||||
|
|||||||
@ -534,7 +534,7 @@ public extension Api {
|
|||||||
}
|
}
|
||||||
public extension Api {
|
public extension Api {
|
||||||
indirect enum Chat: TypeConstructorDescription {
|
indirect enum Chat: TypeConstructorDescription {
|
||||||
case channel(flags: Int32, flags2: Int32, id: Int64, accessHash: Int64?, title: String, username: String?, photo: Api.ChatPhoto, date: Int32, restrictionReason: [Api.RestrictionReason]?, adminRights: Api.ChatAdminRights?, bannedRights: Api.ChatBannedRights?, defaultBannedRights: Api.ChatBannedRights?, participantsCount: Int32?, usernames: [Api.Username]?, storiesMaxId: Int32?, color: Api.PeerColor?, profileColor: Api.PeerColor?, emojiStatus: Api.EmojiStatus?, level: Int32?, subscriptionUntilDate: Int32?)
|
case channel(flags: Int32, flags2: Int32, id: Int64, accessHash: Int64?, title: String, username: String?, photo: Api.ChatPhoto, date: Int32, restrictionReason: [Api.RestrictionReason]?, adminRights: Api.ChatAdminRights?, bannedRights: Api.ChatBannedRights?, defaultBannedRights: Api.ChatBannedRights?, participantsCount: Int32?, usernames: [Api.Username]?, storiesMaxId: Int32?, color: Api.PeerColor?, profileColor: Api.PeerColor?, emojiStatus: Api.EmojiStatus?, level: Int32?, subscriptionUntilDate: Int32?, botVerification: Api.BotVerification?)
|
||||||
case channelForbidden(flags: Int32, id: Int64, accessHash: Int64, title: String, untilDate: Int32?)
|
case channelForbidden(flags: Int32, id: Int64, accessHash: Int64, title: String, untilDate: Int32?)
|
||||||
case chat(flags: Int32, id: Int64, title: String, photo: Api.ChatPhoto, participantsCount: Int32, date: Int32, version: Int32, migratedTo: Api.InputChannel?, adminRights: Api.ChatAdminRights?, defaultBannedRights: Api.ChatBannedRights?)
|
case chat(flags: Int32, id: Int64, title: String, photo: Api.ChatPhoto, participantsCount: Int32, date: Int32, version: Int32, migratedTo: Api.InputChannel?, adminRights: Api.ChatAdminRights?, defaultBannedRights: Api.ChatBannedRights?)
|
||||||
case chatEmpty(id: Int64)
|
case chatEmpty(id: Int64)
|
||||||
@ -542,9 +542,9 @@ public extension Api {
|
|||||||
|
|
||||||
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
||||||
switch self {
|
switch self {
|
||||||
case .channel(let flags, let flags2, let id, let accessHash, let title, let username, let photo, let date, let restrictionReason, let adminRights, let bannedRights, let defaultBannedRights, let participantsCount, let usernames, let storiesMaxId, let color, let profileColor, let emojiStatus, let level, let subscriptionUntilDate):
|
case .channel(let flags, let flags2, let id, let accessHash, let title, let username, let photo, let date, let restrictionReason, let adminRights, let bannedRights, let defaultBannedRights, let participantsCount, let usernames, let storiesMaxId, let color, let profileColor, let emojiStatus, let level, let subscriptionUntilDate, let botVerification):
|
||||||
if boxed {
|
if boxed {
|
||||||
buffer.appendInt32(-29067075)
|
buffer.appendInt32(1185852422)
|
||||||
}
|
}
|
||||||
serializeInt32(flags, buffer: buffer, boxed: false)
|
serializeInt32(flags, buffer: buffer, boxed: false)
|
||||||
serializeInt32(flags2, buffer: buffer, boxed: false)
|
serializeInt32(flags2, buffer: buffer, boxed: false)
|
||||||
@ -574,6 +574,7 @@ public extension Api {
|
|||||||
if Int(flags2) & Int(1 << 9) != 0 {emojiStatus!.serialize(buffer, true)}
|
if Int(flags2) & Int(1 << 9) != 0 {emojiStatus!.serialize(buffer, true)}
|
||||||
if Int(flags2) & Int(1 << 10) != 0 {serializeInt32(level!, buffer: buffer, boxed: false)}
|
if Int(flags2) & Int(1 << 10) != 0 {serializeInt32(level!, buffer: buffer, boxed: false)}
|
||||||
if Int(flags2) & Int(1 << 11) != 0 {serializeInt32(subscriptionUntilDate!, buffer: buffer, boxed: false)}
|
if Int(flags2) & Int(1 << 11) != 0 {serializeInt32(subscriptionUntilDate!, buffer: buffer, boxed: false)}
|
||||||
|
if Int(flags2) & Int(1 << 13) != 0 {botVerification!.serialize(buffer, true)}
|
||||||
break
|
break
|
||||||
case .channelForbidden(let flags, let id, let accessHash, let title, let untilDate):
|
case .channelForbidden(let flags, let id, let accessHash, let title, let untilDate):
|
||||||
if boxed {
|
if boxed {
|
||||||
@ -618,8 +619,8 @@ public extension Api {
|
|||||||
|
|
||||||
public func descriptionFields() -> (String, [(String, Any)]) {
|
public func descriptionFields() -> (String, [(String, Any)]) {
|
||||||
switch self {
|
switch self {
|
||||||
case .channel(let flags, let flags2, let id, let accessHash, let title, let username, let photo, let date, let restrictionReason, let adminRights, let bannedRights, let defaultBannedRights, let participantsCount, let usernames, let storiesMaxId, let color, let profileColor, let emojiStatus, let level, let subscriptionUntilDate):
|
case .channel(let flags, let flags2, let id, let accessHash, let title, let username, let photo, let date, let restrictionReason, let adminRights, let bannedRights, let defaultBannedRights, let participantsCount, let usernames, let storiesMaxId, let color, let profileColor, let emojiStatus, let level, let subscriptionUntilDate, let botVerification):
|
||||||
return ("channel", [("flags", flags as Any), ("flags2", flags2 as Any), ("id", id as Any), ("accessHash", accessHash as Any), ("title", title as Any), ("username", username as Any), ("photo", photo as Any), ("date", date as Any), ("restrictionReason", restrictionReason as Any), ("adminRights", adminRights as Any), ("bannedRights", bannedRights as Any), ("defaultBannedRights", defaultBannedRights as Any), ("participantsCount", participantsCount as Any), ("usernames", usernames as Any), ("storiesMaxId", storiesMaxId as Any), ("color", color as Any), ("profileColor", profileColor as Any), ("emojiStatus", emojiStatus as Any), ("level", level as Any), ("subscriptionUntilDate", subscriptionUntilDate as Any)])
|
return ("channel", [("flags", flags as Any), ("flags2", flags2 as Any), ("id", id as Any), ("accessHash", accessHash as Any), ("title", title as Any), ("username", username as Any), ("photo", photo as Any), ("date", date as Any), ("restrictionReason", restrictionReason as Any), ("adminRights", adminRights as Any), ("bannedRights", bannedRights as Any), ("defaultBannedRights", defaultBannedRights as Any), ("participantsCount", participantsCount as Any), ("usernames", usernames as Any), ("storiesMaxId", storiesMaxId as Any), ("color", color as Any), ("profileColor", profileColor as Any), ("emojiStatus", emojiStatus as Any), ("level", level as Any), ("subscriptionUntilDate", subscriptionUntilDate as Any), ("botVerification", botVerification as Any)])
|
||||||
case .channelForbidden(let flags, let id, let accessHash, let title, let untilDate):
|
case .channelForbidden(let flags, let id, let accessHash, let title, let untilDate):
|
||||||
return ("channelForbidden", [("flags", flags as Any), ("id", id as Any), ("accessHash", accessHash as Any), ("title", title as Any), ("untilDate", untilDate as Any)])
|
return ("channelForbidden", [("flags", flags as Any), ("id", id as Any), ("accessHash", accessHash as Any), ("title", title as Any), ("untilDate", untilDate as Any)])
|
||||||
case .chat(let flags, let id, let title, let photo, let participantsCount, let date, let version, let migratedTo, let adminRights, let defaultBannedRights):
|
case .chat(let flags, let id, let title, let photo, let participantsCount, let date, let version, let migratedTo, let adminRights, let defaultBannedRights):
|
||||||
@ -690,6 +691,10 @@ public extension Api {
|
|||||||
if Int(_2!) & Int(1 << 10) != 0 {_19 = reader.readInt32() }
|
if Int(_2!) & Int(1 << 10) != 0 {_19 = reader.readInt32() }
|
||||||
var _20: Int32?
|
var _20: Int32?
|
||||||
if Int(_2!) & Int(1 << 11) != 0 {_20 = reader.readInt32() }
|
if Int(_2!) & Int(1 << 11) != 0 {_20 = reader.readInt32() }
|
||||||
|
var _21: Api.BotVerification?
|
||||||
|
if Int(_2!) & Int(1 << 13) != 0 {if let signature = reader.readInt32() {
|
||||||
|
_21 = Api.parse(reader, signature: signature) as? Api.BotVerification
|
||||||
|
} }
|
||||||
let _c1 = _1 != nil
|
let _c1 = _1 != nil
|
||||||
let _c2 = _2 != nil
|
let _c2 = _2 != nil
|
||||||
let _c3 = _3 != nil
|
let _c3 = _3 != nil
|
||||||
@ -710,8 +715,9 @@ public extension Api {
|
|||||||
let _c18 = (Int(_2!) & Int(1 << 9) == 0) || _18 != nil
|
let _c18 = (Int(_2!) & Int(1 << 9) == 0) || _18 != nil
|
||||||
let _c19 = (Int(_2!) & Int(1 << 10) == 0) || _19 != nil
|
let _c19 = (Int(_2!) & Int(1 << 10) == 0) || _19 != nil
|
||||||
let _c20 = (Int(_2!) & Int(1 << 11) == 0) || _20 != nil
|
let _c20 = (Int(_2!) & Int(1 << 11) == 0) || _20 != nil
|
||||||
if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 && _c12 && _c13 && _c14 && _c15 && _c16 && _c17 && _c18 && _c19 && _c20 {
|
let _c21 = (Int(_2!) & Int(1 << 13) == 0) || _21 != nil
|
||||||
return Api.Chat.channel(flags: _1!, flags2: _2!, id: _3!, accessHash: _4, title: _5!, username: _6, photo: _7!, date: _8!, restrictionReason: _9, adminRights: _10, bannedRights: _11, defaultBannedRights: _12, participantsCount: _13, usernames: _14, storiesMaxId: _15, color: _16, profileColor: _17, emojiStatus: _18, level: _19, subscriptionUntilDate: _20)
|
if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 && _c12 && _c13 && _c14 && _c15 && _c16 && _c17 && _c18 && _c19 && _c20 && _c21 {
|
||||||
|
return Api.Chat.channel(flags: _1!, flags2: _2!, id: _3!, accessHash: _4, title: _5!, username: _6, photo: _7!, date: _8!, restrictionReason: _9, adminRights: _10, bannedRights: _11, defaultBannedRights: _12, participantsCount: _13, usernames: _14, storiesMaxId: _15, color: _16, profileColor: _17, emojiStatus: _18, level: _19, subscriptionUntilDate: _20, botVerification: _21)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return nil
|
return nil
|
||||||
@ -1296,15 +1302,15 @@ public extension Api {
|
|||||||
}
|
}
|
||||||
public extension Api {
|
public extension Api {
|
||||||
indirect enum ChatInvite: TypeConstructorDescription {
|
indirect enum ChatInvite: TypeConstructorDescription {
|
||||||
case chatInvite(flags: Int32, title: String, about: String?, photo: Api.Photo, participantsCount: Int32, participants: [Api.User]?, color: Int32, subscriptionPricing: Api.StarsSubscriptionPricing?, subscriptionFormId: Int64?)
|
case chatInvite(flags: Int32, title: String, about: String?, photo: Api.Photo, participantsCount: Int32, participants: [Api.User]?, color: Int32, subscriptionPricing: Api.StarsSubscriptionPricing?, subscriptionFormId: Int64?, botVerification: Api.BotVerification?)
|
||||||
case chatInviteAlready(chat: Api.Chat)
|
case chatInviteAlready(chat: Api.Chat)
|
||||||
case chatInvitePeek(chat: Api.Chat, expires: Int32)
|
case chatInvitePeek(chat: Api.Chat, expires: Int32)
|
||||||
|
|
||||||
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
||||||
switch self {
|
switch self {
|
||||||
case .chatInvite(let flags, let title, let about, let photo, let participantsCount, let participants, let color, let subscriptionPricing, let subscriptionFormId):
|
case .chatInvite(let flags, let title, let about, let photo, let participantsCount, let participants, let color, let subscriptionPricing, let subscriptionFormId, let botVerification):
|
||||||
if boxed {
|
if boxed {
|
||||||
buffer.appendInt32(-26920803)
|
buffer.appendInt32(1553807106)
|
||||||
}
|
}
|
||||||
serializeInt32(flags, buffer: buffer, boxed: false)
|
serializeInt32(flags, buffer: buffer, boxed: false)
|
||||||
serializeString(title, buffer: buffer, boxed: false)
|
serializeString(title, buffer: buffer, boxed: false)
|
||||||
@ -1319,6 +1325,7 @@ public extension Api {
|
|||||||
serializeInt32(color, buffer: buffer, boxed: false)
|
serializeInt32(color, buffer: buffer, boxed: false)
|
||||||
if Int(flags) & Int(1 << 10) != 0 {subscriptionPricing!.serialize(buffer, true)}
|
if Int(flags) & Int(1 << 10) != 0 {subscriptionPricing!.serialize(buffer, true)}
|
||||||
if Int(flags) & Int(1 << 12) != 0 {serializeInt64(subscriptionFormId!, buffer: buffer, boxed: false)}
|
if Int(flags) & Int(1 << 12) != 0 {serializeInt64(subscriptionFormId!, buffer: buffer, boxed: false)}
|
||||||
|
if Int(flags) & Int(1 << 13) != 0 {botVerification!.serialize(buffer, true)}
|
||||||
break
|
break
|
||||||
case .chatInviteAlready(let chat):
|
case .chatInviteAlready(let chat):
|
||||||
if boxed {
|
if boxed {
|
||||||
@ -1338,8 +1345,8 @@ public extension Api {
|
|||||||
|
|
||||||
public func descriptionFields() -> (String, [(String, Any)]) {
|
public func descriptionFields() -> (String, [(String, Any)]) {
|
||||||
switch self {
|
switch self {
|
||||||
case .chatInvite(let flags, let title, let about, let photo, let participantsCount, let participants, let color, let subscriptionPricing, let subscriptionFormId):
|
case .chatInvite(let flags, let title, let about, let photo, let participantsCount, let participants, let color, let subscriptionPricing, let subscriptionFormId, let botVerification):
|
||||||
return ("chatInvite", [("flags", flags as Any), ("title", title as Any), ("about", about as Any), ("photo", photo as Any), ("participantsCount", participantsCount as Any), ("participants", participants as Any), ("color", color as Any), ("subscriptionPricing", subscriptionPricing as Any), ("subscriptionFormId", subscriptionFormId as Any)])
|
return ("chatInvite", [("flags", flags as Any), ("title", title as Any), ("about", about as Any), ("photo", photo as Any), ("participantsCount", participantsCount as Any), ("participants", participants as Any), ("color", color as Any), ("subscriptionPricing", subscriptionPricing as Any), ("subscriptionFormId", subscriptionFormId as Any), ("botVerification", botVerification as Any)])
|
||||||
case .chatInviteAlready(let chat):
|
case .chatInviteAlready(let chat):
|
||||||
return ("chatInviteAlready", [("chat", chat as Any)])
|
return ("chatInviteAlready", [("chat", chat as Any)])
|
||||||
case .chatInvitePeek(let chat, let expires):
|
case .chatInvitePeek(let chat, let expires):
|
||||||
@ -1372,6 +1379,10 @@ public extension Api {
|
|||||||
} }
|
} }
|
||||||
var _9: Int64?
|
var _9: Int64?
|
||||||
if Int(_1!) & Int(1 << 12) != 0 {_9 = reader.readInt64() }
|
if Int(_1!) & Int(1 << 12) != 0 {_9 = reader.readInt64() }
|
||||||
|
var _10: Api.BotVerification?
|
||||||
|
if Int(_1!) & Int(1 << 13) != 0 {if let signature = reader.readInt32() {
|
||||||
|
_10 = Api.parse(reader, signature: signature) as? Api.BotVerification
|
||||||
|
} }
|
||||||
let _c1 = _1 != nil
|
let _c1 = _1 != nil
|
||||||
let _c2 = _2 != nil
|
let _c2 = _2 != nil
|
||||||
let _c3 = (Int(_1!) & Int(1 << 5) == 0) || _3 != nil
|
let _c3 = (Int(_1!) & Int(1 << 5) == 0) || _3 != nil
|
||||||
@ -1381,8 +1392,9 @@ public extension Api {
|
|||||||
let _c7 = _7 != nil
|
let _c7 = _7 != nil
|
||||||
let _c8 = (Int(_1!) & Int(1 << 10) == 0) || _8 != nil
|
let _c8 = (Int(_1!) & Int(1 << 10) == 0) || _8 != nil
|
||||||
let _c9 = (Int(_1!) & Int(1 << 12) == 0) || _9 != nil
|
let _c9 = (Int(_1!) & Int(1 << 12) == 0) || _9 != nil
|
||||||
if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 {
|
let _c10 = (Int(_1!) & Int(1 << 13) == 0) || _10 != nil
|
||||||
return Api.ChatInvite.chatInvite(flags: _1!, title: _2!, about: _3, photo: _4!, participantsCount: _5!, participants: _6, color: _7!, subscriptionPricing: _8, subscriptionFormId: _9)
|
if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 {
|
||||||
|
return Api.ChatInvite.chatInvite(flags: _1!, title: _2!, about: _3, photo: _4!, participantsCount: _5!, participants: _6, color: _7!, subscriptionPricing: _8, subscriptionFormId: _9, botVerification: _10)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
@ -488,7 +488,7 @@ struct AccountMutableState {
|
|||||||
|
|
||||||
for chat in chats {
|
for chat in chats {
|
||||||
switch chat {
|
switch chat {
|
||||||
case let .channel(_, _, _, _, _, _, _, _, _, _, _, _, participantsCount, _, _, _, _, _, _, _):
|
case let .channel(_, _, _, _, _, _, _, _, _, _, _, _, participantsCount, _, _, _, _, _, _, _, _):
|
||||||
if let participantsCount = participantsCount {
|
if let participantsCount = participantsCount {
|
||||||
self.addOperation(.UpdateCachedPeerData(chat.peerId, { current in
|
self.addOperation(.UpdateCachedPeerData(chat.peerId, { current in
|
||||||
var previous: CachedChannelData
|
var previous: CachedChannelData
|
||||||
@ -552,7 +552,7 @@ struct AccountMutableState {
|
|||||||
var presences: [PeerId: Api.UserStatus] = [:]
|
var presences: [PeerId: Api.UserStatus] = [:]
|
||||||
for user in users {
|
for user in users {
|
||||||
switch user {
|
switch user {
|
||||||
case let .user(_, _, id, _, _, _, _, _, _, status, _, _, _, _, _, _, _, _, _, _):
|
case let .user(_, _, id, _, _, _, _, _, _, status, _, _, _, _, _, _, _, _, _, _, _):
|
||||||
if let status = status {
|
if let status = status {
|
||||||
presences[PeerId(namespace: Namespaces.Peer.CloudUser, id: PeerId.Id._internalFromInt64Value(id))] = status
|
presences[PeerId(namespace: Namespaces.Peer.CloudUser, id: PeerId.Id._internalFromInt64Value(id))] = status
|
||||||
}
|
}
|
||||||
|
|||||||
@ -61,7 +61,7 @@ func parseTelegramGroupOrChannel(chat: Api.Chat) -> Peer? {
|
|||||||
return TelegramGroup(id: PeerId(namespace: Namespaces.Peer.CloudGroup, id: PeerId.Id._internalFromInt64Value(id)), title: "", photo: [], participantCount: 0, role: .member, membership: .Removed, flags: [], defaultBannedRights: nil, migrationReference: nil, creationDate: 0, version: 0)
|
return TelegramGroup(id: PeerId(namespace: Namespaces.Peer.CloudGroup, id: PeerId.Id._internalFromInt64Value(id)), title: "", photo: [], participantCount: 0, role: .member, membership: .Removed, flags: [], defaultBannedRights: nil, migrationReference: nil, creationDate: 0, version: 0)
|
||||||
case let .chatForbidden(id, title):
|
case let .chatForbidden(id, title):
|
||||||
return TelegramGroup(id: PeerId(namespace: Namespaces.Peer.CloudGroup, id: PeerId.Id._internalFromInt64Value(id)), title: title, photo: [], participantCount: 0, role: .member, membership: .Removed, flags: [], defaultBannedRights: nil, migrationReference: nil, creationDate: 0, version: 0)
|
return TelegramGroup(id: PeerId(namespace: Namespaces.Peer.CloudGroup, id: PeerId.Id._internalFromInt64Value(id)), title: title, photo: [], participantCount: 0, role: .member, membership: .Removed, flags: [], defaultBannedRights: nil, migrationReference: nil, creationDate: 0, version: 0)
|
||||||
case let .channel(flags, flags2, id, accessHash, title, username, photo, date, restrictionReason, adminRights, bannedRights, defaultBannedRights, _, usernames, _, color, profileColor, emojiStatus, boostLevel, subscriptionUntilDate):
|
case let .channel(flags, flags2, id, accessHash, title, username, photo, date, restrictionReason, adminRights, bannedRights, defaultBannedRights, _, usernames, _, color, profileColor, emojiStatus, boostLevel, subscriptionUntilDate, _):
|
||||||
let isMin = (flags & (1 << 12)) != 0
|
let isMin = (flags & (1 << 12)) != 0
|
||||||
|
|
||||||
let participationStatus: TelegramChannelParticipationStatus
|
let participationStatus: TelegramChannelParticipationStatus
|
||||||
@ -193,7 +193,7 @@ func mergeGroupOrChannel(lhs: Peer?, rhs: Api.Chat) -> Peer? {
|
|||||||
switch rhs {
|
switch rhs {
|
||||||
case .chat, .chatEmpty, .chatForbidden, .channelForbidden:
|
case .chat, .chatEmpty, .chatForbidden, .channelForbidden:
|
||||||
return parseTelegramGroupOrChannel(chat: rhs)
|
return parseTelegramGroupOrChannel(chat: rhs)
|
||||||
case let .channel(flags, flags2, _, accessHash, title, username, photo, _, _, _, _, defaultBannedRights, _, usernames, _, color, profileColor, emojiStatus, boostLevel, subscriptionUntilDate):
|
case let .channel(flags, flags2, _, accessHash, title, username, photo, _, _, _, _, defaultBannedRights, _, usernames, _, color, profileColor, emojiStatus, boostLevel, subscriptionUntilDate, _):
|
||||||
let isMin = (flags & (1 << 12)) != 0
|
let isMin = (flags & (1 << 12)) != 0
|
||||||
if accessHash != nil && !isMin {
|
if accessHash != nil && !isMin {
|
||||||
return parseTelegramGroupOrChannel(chat: rhs)
|
return parseTelegramGroupOrChannel(chat: rhs)
|
||||||
|
|||||||
@ -31,7 +31,7 @@ extension BotAppSettings {
|
|||||||
extension BotInfo {
|
extension BotInfo {
|
||||||
convenience init(apiBotInfo: Api.BotInfo) {
|
convenience init(apiBotInfo: Api.BotInfo) {
|
||||||
switch apiBotInfo {
|
switch apiBotInfo {
|
||||||
case let .botInfo(_, _, description, descriptionPhoto, descriptionDocument, apiCommands, apiMenuButton, privacyPolicyUrl, appSettings):
|
case let .botInfo(_, _, description, descriptionPhoto, descriptionDocument, apiCommands, apiMenuButton, privacyPolicyUrl, appSettings, _):
|
||||||
let photo: TelegramMediaImage? = descriptionPhoto.flatMap(telegramMediaImageFromApiPhoto)
|
let photo: TelegramMediaImage? = descriptionPhoto.flatMap(telegramMediaImageFromApiPhoto)
|
||||||
let video: TelegramMediaFile? = descriptionDocument.flatMap { telegramMediaFileFromApiDocument($0, altDocuments: []) }
|
let video: TelegramMediaFile? = descriptionDocument.flatMap { telegramMediaFileFromApiDocument($0, altDocuments: []) }
|
||||||
var commands: [BotCommand] = []
|
var commands: [BotCommand] = []
|
||||||
|
|||||||
@ -36,7 +36,7 @@ extension TelegramPeerUsername {
|
|||||||
extension TelegramUser {
|
extension TelegramUser {
|
||||||
convenience init(user: Api.User) {
|
convenience init(user: Api.User) {
|
||||||
switch user {
|
switch user {
|
||||||
case let .user(flags, flags2, id, accessHash, firstName, lastName, username, phone, photo, _, _, restrictionReason, botInlinePlaceholder, _, emojiStatus, usernames, _, color, profileColor, subscriberCount):
|
case let .user(flags, flags2, id, accessHash, firstName, lastName, username, phone, photo, _, _, restrictionReason, botInlinePlaceholder, _, emojiStatus, usernames, _, color, profileColor, subscriberCount, _):
|
||||||
let representations: [TelegramMediaImageRepresentation] = photo.flatMap(parsedTelegramProfilePhoto) ?? []
|
let representations: [TelegramMediaImageRepresentation] = photo.flatMap(parsedTelegramProfilePhoto) ?? []
|
||||||
|
|
||||||
let isMin = (flags & (1 << 20)) != 0
|
let isMin = (flags & (1 << 20)) != 0
|
||||||
@ -135,7 +135,7 @@ extension TelegramUser {
|
|||||||
|
|
||||||
static func merge(_ lhs: TelegramUser?, rhs: Api.User) -> TelegramUser? {
|
static func merge(_ lhs: TelegramUser?, rhs: Api.User) -> TelegramUser? {
|
||||||
switch rhs {
|
switch rhs {
|
||||||
case let .user(flags, _, _, rhsAccessHash, _, _, _, _, photo, _, _, restrictionReason, botInlinePlaceholder, _, emojiStatus, _, _, nameColor, profileColor, subscriberCount):
|
case let .user(flags, _, _, rhsAccessHash, _, _, _, _, photo, _, _, restrictionReason, botInlinePlaceholder, _, emojiStatus, _, _, nameColor, profileColor, subscriberCount, _):
|
||||||
let isMin = (flags & (1 << 20)) != 0
|
let isMin = (flags & (1 << 20)) != 0
|
||||||
if !isMin {
|
if !isMin {
|
||||||
return TelegramUser(user: rhs)
|
return TelegramUser(user: rhs)
|
||||||
|
|||||||
@ -26,7 +26,7 @@ extension TelegramUserPresence {
|
|||||||
|
|
||||||
convenience init?(apiUser: Api.User) {
|
convenience init?(apiUser: Api.User) {
|
||||||
switch apiUser {
|
switch apiUser {
|
||||||
case let .user(_, _, _, _, _, _, _, _, _, status, _, _, _, _, _, _, _, _, _, _):
|
case let .user(_, _, _, _, _, _, _, _, _, status, _, _, _, _, _, _, _, _, _, _, _):
|
||||||
if let status = status {
|
if let status = status {
|
||||||
self.init(apiStatus: status)
|
self.init(apiStatus: status)
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -186,7 +186,7 @@ extension Api.Chat {
|
|||||||
return PeerId(namespace: Namespaces.Peer.CloudGroup, id: PeerId.Id._internalFromInt64Value(id))
|
return PeerId(namespace: Namespaces.Peer.CloudGroup, id: PeerId.Id._internalFromInt64Value(id))
|
||||||
case let .chatForbidden(id, _):
|
case let .chatForbidden(id, _):
|
||||||
return PeerId(namespace: Namespaces.Peer.CloudGroup, id: PeerId.Id._internalFromInt64Value(id))
|
return PeerId(namespace: Namespaces.Peer.CloudGroup, id: PeerId.Id._internalFromInt64Value(id))
|
||||||
case let .channel(_, _, id, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _):
|
case let .channel(_, _, id, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _):
|
||||||
return PeerId(namespace: Namespaces.Peer.CloudChannel, id: PeerId.Id._internalFromInt64Value(id))
|
return PeerId(namespace: Namespaces.Peer.CloudChannel, id: PeerId.Id._internalFromInt64Value(id))
|
||||||
case let .channelForbidden(_, id, _, _, _):
|
case let .channelForbidden(_, id, _, _, _):
|
||||||
return PeerId(namespace: Namespaces.Peer.CloudChannel, id: PeerId.Id._internalFromInt64Value(id))
|
return PeerId(namespace: Namespaces.Peer.CloudChannel, id: PeerId.Id._internalFromInt64Value(id))
|
||||||
@ -197,7 +197,7 @@ extension Api.Chat {
|
|||||||
extension Api.User {
|
extension Api.User {
|
||||||
var peerId: PeerId {
|
var peerId: PeerId {
|
||||||
switch self {
|
switch self {
|
||||||
case let .user(_, _, id, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _):
|
case let .user(_, _, id, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _):
|
||||||
return PeerId(namespace: Namespaces.Peer.CloudUser, id: PeerId.Id._internalFromInt64Value(id))
|
return PeerId(namespace: Namespaces.Peer.CloudUser, id: PeerId.Id._internalFromInt64Value(id))
|
||||||
case let .userEmpty(id):
|
case let .userEmpty(id):
|
||||||
return PeerId(namespace: Namespaces.Peer.CloudUser, id: PeerId.Id._internalFromInt64Value(id))
|
return PeerId(namespace: Namespaces.Peer.CloudUser, id: PeerId.Id._internalFromInt64Value(id))
|
||||||
|
|||||||
@ -2294,7 +2294,7 @@ func _internal_groupCallDisplayAsAvailablePeers(accountPeerId: PeerId, network:
|
|||||||
for chat in chats {
|
for chat in chats {
|
||||||
if let groupOrChannel = parseTelegramGroupOrChannel(chat: chat) {
|
if let groupOrChannel = parseTelegramGroupOrChannel(chat: chat) {
|
||||||
switch chat {
|
switch chat {
|
||||||
case let .channel(_, _, _, _, _, _, _, _, _, _, _, _, participantsCount, _, _, _, _, _, _, _):
|
case let .channel(_, _, _, _, _, _, _, _, _, _, _, _, participantsCount, _, _, _, _, _, _, _, _):
|
||||||
if let participantsCount = participantsCount {
|
if let participantsCount = participantsCount {
|
||||||
subscribers[groupOrChannel.id] = participantsCount
|
subscribers[groupOrChannel.id] = participantsCount
|
||||||
}
|
}
|
||||||
|
|||||||
@ -138,7 +138,7 @@ func _internal_peerSendAsAvailablePeers(accountPeerId: PeerId, network: Network,
|
|||||||
for chat in chats {
|
for chat in chats {
|
||||||
if let groupOrChannel = parsedPeers.get(chat.peerId) {
|
if let groupOrChannel = parsedPeers.get(chat.peerId) {
|
||||||
switch chat {
|
switch chat {
|
||||||
case let .channel(_, _, _, _, _, _, _, _, _, _, _, _, participantsCount, _, _, _, _, _, _, _):
|
case let .channel(_, _, _, _, _, _, _, _, _, _, _, _, participantsCount, _, _, _, _, _, _, _, _):
|
||||||
if let participantsCount = participantsCount {
|
if let participantsCount = participantsCount {
|
||||||
subscribers[groupOrChannel.id] = participantsCount
|
subscribers[groupOrChannel.id] = participantsCount
|
||||||
}
|
}
|
||||||
|
|||||||
@ -558,7 +558,7 @@ func _internal_adminedPublicChannels(account: Account, scope: AdminedPublicChann
|
|||||||
case let .chats(apiChats):
|
case let .chats(apiChats):
|
||||||
chats = apiChats
|
chats = apiChats
|
||||||
for chat in apiChats {
|
for chat in apiChats {
|
||||||
if case let .channel(_, _, _, _, _, _, _, _, _, _, _, _, participantsCount, _, _, _, _, _, _, _) = chat {
|
if case let .channel(_, _, _, _, _, _, _, _, _, _, _, _, participantsCount, _, _, _, _, _, _, _, _) = chat {
|
||||||
subscriberCounts[chat.peerId] = participantsCount.flatMap(Int.init)
|
subscriberCounts[chat.peerId] = participantsCount.flatMap(Int.init)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -630,7 +630,7 @@ func _internal_channelsForStories(account: Account) -> Signal<[Peer], NoError> {
|
|||||||
if let peer = transaction.getPeer(chat.peerId) {
|
if let peer = transaction.getPeer(chat.peerId) {
|
||||||
peers.append(peer)
|
peers.append(peer)
|
||||||
|
|
||||||
if case let .channel(_, _, _, _, _, _, _, _, _, _, _, _, participantsCount, _, _, _, _, _, _, _) = chat, let participantsCount = participantsCount {
|
if case let .channel(_, _, _, _, _, _, _, _, _, _, _, _, participantsCount, _, _, _, _, _, _, _, _) = chat, let participantsCount = participantsCount {
|
||||||
transaction.updatePeerCachedData(peerIds: Set([peer.id]), update: { _, current in
|
transaction.updatePeerCachedData(peerIds: Set([peer.id]), update: { _, current in
|
||||||
var current = current as? CachedChannelData ?? CachedChannelData()
|
var current = current as? CachedChannelData ?? CachedChannelData()
|
||||||
var participantsSummary = current.participantsSummary
|
var participantsSummary = current.participantsSummary
|
||||||
|
|||||||
@ -117,7 +117,7 @@ func _internal_requestRecommendedChannels(account: Account, peerId: EnginePeer.I
|
|||||||
for chat in chats {
|
for chat in chats {
|
||||||
if let peer = transaction.getPeer(chat.peerId) {
|
if let peer = transaction.getPeer(chat.peerId) {
|
||||||
peers.append(EnginePeer(peer))
|
peers.append(EnginePeer(peer))
|
||||||
if case let .channel(_, _, _, _, _, _, _, _, _, _, _, _, participantsCount, _, _, _, _, _, _, _) = chat, let participantsCount = participantsCount {
|
if case let .channel(_, _, _, _, _, _, _, _, _, _, _, _, participantsCount, _, _, _, _, _, _, _, _) = chat, let participantsCount = participantsCount {
|
||||||
transaction.updatePeerCachedData(peerIds: Set([peer.id]), update: { _, current in
|
transaction.updatePeerCachedData(peerIds: Set([peer.id]), update: { _, current in
|
||||||
var current = current as? CachedChannelData ?? CachedChannelData()
|
var current = current as? CachedChannelData ?? CachedChannelData()
|
||||||
var participantsSummary = current.participantsSummary
|
var participantsSummary = current.participantsSummary
|
||||||
|
|||||||
@ -280,7 +280,7 @@ func _internal_checkChatFolderLink(account: Account, slug: String) -> Signal<Cha
|
|||||||
var memberCounts: [PeerId: Int] = [:]
|
var memberCounts: [PeerId: Int] = [:]
|
||||||
|
|
||||||
for chat in chats {
|
for chat in chats {
|
||||||
if case let .channel(_, _, _, _, _, _, _, _, _, _, _, _, participantsCount, _, _, _, _, _, _, _) = chat {
|
if case let .channel(_, _, _, _, _, _, _, _, _, _, _, _, participantsCount, _, _, _, _, _, _, _, _) = chat {
|
||||||
if let participantsCount = participantsCount {
|
if let participantsCount = participantsCount {
|
||||||
memberCounts[chat.peerId] = Int(participantsCount)
|
memberCounts[chat.peerId] = Int(participantsCount)
|
||||||
}
|
}
|
||||||
@ -307,7 +307,7 @@ func _internal_checkChatFolderLink(account: Account, slug: String) -> Signal<Cha
|
|||||||
var memberCounts: [PeerId: Int] = [:]
|
var memberCounts: [PeerId: Int] = [:]
|
||||||
|
|
||||||
for chat in chats {
|
for chat in chats {
|
||||||
if case let .channel(_, _, _, _, _, _, _, _, _, _, _, _, participantsCount, _, _, _, _, _, _, _) = chat {
|
if case let .channel(_, _, _, _, _, _, _, _, _, _, _, _, participantsCount, _, _, _, _, _, _, _, _) = chat {
|
||||||
if let participantsCount = participantsCount {
|
if let participantsCount = participantsCount {
|
||||||
memberCounts[chat.peerId] = Int(participantsCount)
|
memberCounts[chat.peerId] = Int(participantsCount)
|
||||||
}
|
}
|
||||||
@ -602,7 +602,7 @@ func _internal_pollChatFolderUpdatesOnce(account: Account, folderId: Int32) -> S
|
|||||||
var memberCounts: [ChatListFiltersState.ChatListFilterUpdates.MemberCount] = []
|
var memberCounts: [ChatListFiltersState.ChatListFilterUpdates.MemberCount] = []
|
||||||
|
|
||||||
for chat in chats {
|
for chat in chats {
|
||||||
if case let .channel(_, _, _, _, _, _, _, _, _, _, _, _, participantsCount, _, _, _, _, _, _, _) = chat {
|
if case let .channel(_, _, _, _, _, _, _, _, _, _, _, _, participantsCount, _, _, _, _, _, _, _, _) = chat {
|
||||||
if let participantsCount = participantsCount {
|
if let participantsCount = participantsCount {
|
||||||
memberCounts.append(ChatListFiltersState.ChatListFilterUpdates.MemberCount(id: chat.peerId, count: participantsCount))
|
memberCounts.append(ChatListFiltersState.ChatListFilterUpdates.MemberCount(id: chat.peerId, count: participantsCount))
|
||||||
}
|
}
|
||||||
|
|||||||
@ -31,7 +31,7 @@ func _internal_inactiveChannelList(network: Network) -> Signal<[InactiveChannel]
|
|||||||
var participantsCounts: [PeerId: Int32] = [:]
|
var participantsCounts: [PeerId: Int32] = [:]
|
||||||
for chat in chats {
|
for chat in chats {
|
||||||
switch chat {
|
switch chat {
|
||||||
case let .channel(_, _, _, _, _, _, _, _, _, _, _, _, participantsCountValue, _, _, _, _, _, _, _):
|
case let .channel(_, _, _, _, _, _, _, _, _, _, _, _, participantsCountValue, _, _, _, _, _, _, _, _):
|
||||||
if let participantsCountValue = participantsCountValue {
|
if let participantsCountValue = participantsCountValue {
|
||||||
participantsCounts[chat.peerId] = participantsCountValue
|
participantsCounts[chat.peerId] = participantsCountValue
|
||||||
}
|
}
|
||||||
|
|||||||
@ -109,7 +109,7 @@ func _internal_joinLinkInformation(_ hash: String, account: Account) -> Signal<E
|
|||||||
|> mapToSignal { result -> Signal<ExternalJoiningChatState, JoinLinkInfoError> in
|
|> mapToSignal { result -> Signal<ExternalJoiningChatState, JoinLinkInfoError> in
|
||||||
if let result = result {
|
if let result = result {
|
||||||
switch result {
|
switch result {
|
||||||
case let .chatInvite(flags, title, about, invitePhoto, participantsCount, participants, nameColor, subscriptionPricing, subscriptionFormId):
|
case let .chatInvite(flags, title, about, invitePhoto, participantsCount, participants, nameColor, subscriptionPricing, subscriptionFormId, _):
|
||||||
let photo = telegramMediaImageFromApiPhoto(invitePhoto).flatMap({ smallestImageRepresentation($0.representations) })
|
let photo = telegramMediaImageFromApiPhoto(invitePhoto).flatMap({ smallestImageRepresentation($0.representations) })
|
||||||
let flags: ExternalJoiningChatState.Invite.Flags = .init(isChannel: (flags & (1 << 0)) != 0, isBroadcast: (flags & (1 << 1)) != 0, isPublic: (flags & (1 << 2)) != 0, isMegagroup: (flags & (1 << 3)) != 0, requestNeeded: (flags & (1 << 6)) != 0, isVerified: (flags & (1 << 7)) != 0, isScam: (flags & (1 << 8)) != 0, isFake: (flags & (1 << 9)) != 0, canRefulfillSubscription: (flags & (1 << 11)) != 0)
|
let flags: ExternalJoiningChatState.Invite.Flags = .init(isChannel: (flags & (1 << 0)) != 0, isBroadcast: (flags & (1 << 1)) != 0, isPublic: (flags & (1 << 2)) != 0, isMegagroup: (flags & (1 << 3)) != 0, requestNeeded: (flags & (1 << 6)) != 0, isVerified: (flags & (1 << 7)) != 0, isScam: (flags & (1 << 8)) != 0, isFake: (flags & (1 << 9)) != 0, canRefulfillSubscription: (flags & (1 << 11)) != 0)
|
||||||
return .single(.invite(ExternalJoiningChatState.Invite(flags: flags, title: title, about: about, photoRepresentation: photo, participantsCount: participantsCount, participants: participants?.map({ EnginePeer(TelegramUser(user: $0)) }), nameColor: PeerNameColor(rawValue: nameColor), subscriptionPricing: subscriptionPricing.flatMap { StarsSubscriptionPricing(apiStarsSubscriptionPricing: $0) }, subscriptionFormId: subscriptionFormId)))
|
return .single(.invite(ExternalJoiningChatState.Invite(flags: flags, title: title, about: about, photoRepresentation: photo, participantsCount: participantsCount, participants: participants?.map({ EnginePeer(TelegramUser(user: $0)) }), nameColor: PeerNameColor(rawValue: nameColor), subscriptionPricing: subscriptionPricing.flatMap { StarsSubscriptionPricing(apiStarsSubscriptionPricing: $0) }, subscriptionFormId: subscriptionFormId)))
|
||||||
|
|||||||
@ -42,7 +42,7 @@ public func _internal_searchPeers(accountPeerId: PeerId, postbox: Postbox, netwo
|
|||||||
for chat in chats {
|
for chat in chats {
|
||||||
if let groupOrChannel = parseTelegramGroupOrChannel(chat: chat) {
|
if let groupOrChannel = parseTelegramGroupOrChannel(chat: chat) {
|
||||||
switch chat {
|
switch chat {
|
||||||
case let .channel(_, _, _, _, _, _, _, _, _, _, _, _, participantsCount, _, _, _, _, _, _, _):
|
case let .channel(_, _, _, _, _, _, _, _, _, _, _, _, participantsCount, _, _, _, _, _, _, _, _):
|
||||||
if let participantsCount = participantsCount {
|
if let participantsCount = participantsCount {
|
||||||
subscribers[groupOrChannel.id] = participantsCount
|
subscribers[groupOrChannel.id] = participantsCount
|
||||||
}
|
}
|
||||||
|
|||||||
@ -383,7 +383,7 @@ func _internal_fetchAndUpdateCachedPeerData(accountPeerId: PeerId, peerId rawPee
|
|||||||
var subscriberCount: Int32?
|
var subscriberCount: Int32?
|
||||||
for chat in chats {
|
for chat in chats {
|
||||||
if chat.peerId == channelPeerId {
|
if chat.peerId == channelPeerId {
|
||||||
if case let .channel(_, _, _, _, _, _, _, _, _, _, _, _, participantsCount, _, _, _, _, _, _, _) = chat {
|
if case let .channel(_, _, _, _, _, _, _, _, _, _, _, _, participantsCount, _, _, _, _, _, _, _, _) = chat {
|
||||||
subscriberCount = participantsCount
|
subscriberCount = participantsCount
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -458,7 +458,7 @@ func _internal_fetchAndUpdateCachedPeerData(accountPeerId: PeerId, peerId rawPee
|
|||||||
var botInfos: [CachedPeerBotInfo] = []
|
var botInfos: [CachedPeerBotInfo] = []
|
||||||
for botInfo in chatFullBotInfo ?? [] {
|
for botInfo in chatFullBotInfo ?? [] {
|
||||||
switch botInfo {
|
switch botInfo {
|
||||||
case let .botInfo(_, userId, _, _, _, _, _, _, _):
|
case let .botInfo(_, userId, _, _, _, _, _, _, _, _):
|
||||||
if let userId = userId {
|
if let userId = userId {
|
||||||
let peerId = PeerId(namespace: Namespaces.Peer.CloudUser, id: PeerId.Id._internalFromInt64Value(userId))
|
let peerId = PeerId(namespace: Namespaces.Peer.CloudUser, id: PeerId.Id._internalFromInt64Value(userId))
|
||||||
let parsedBotInfo = BotInfo(apiBotInfo: botInfo)
|
let parsedBotInfo = BotInfo(apiBotInfo: botInfo)
|
||||||
@ -648,7 +648,7 @@ func _internal_fetchAndUpdateCachedPeerData(accountPeerId: PeerId, peerId rawPee
|
|||||||
var botInfos: [CachedPeerBotInfo] = []
|
var botInfos: [CachedPeerBotInfo] = []
|
||||||
for botInfo in apiBotInfos {
|
for botInfo in apiBotInfos {
|
||||||
switch botInfo {
|
switch botInfo {
|
||||||
case let .botInfo(_, userId, _, _, _, _, _, _, _):
|
case let .botInfo(_, userId, _, _, _, _, _, _, _, _):
|
||||||
if let userId = userId {
|
if let userId = userId {
|
||||||
let peerId = PeerId(namespace: Namespaces.Peer.CloudUser, id: PeerId.Id._internalFromInt64Value(userId))
|
let peerId = PeerId(namespace: Namespaces.Peer.CloudUser, id: PeerId.Id._internalFromInt64Value(userId))
|
||||||
let parsedBotInfo = BotInfo(apiBotInfo: botInfo)
|
let parsedBotInfo = BotInfo(apiBotInfo: botInfo)
|
||||||
|
|||||||
@ -189,7 +189,7 @@ func _internal_requestAccountPrivacySettings(account: Account) -> Signal<Account
|
|||||||
if let peer = parseTelegramGroupOrChannel(chat: chat) {
|
if let peer = parseTelegramGroupOrChannel(chat: chat) {
|
||||||
var participantCount: Int32? = nil
|
var participantCount: Int32? = nil
|
||||||
switch chat {
|
switch chat {
|
||||||
case let .channel(_, _, _, _, _, _, _, _, _, _, _, _, participantsCountValue, _, _, _, _, _, _, _):
|
case let .channel(_, _, _, _, _, _, _, _, _, _, _, _, participantsCountValue, _, _, _, _, _, _, _, _):
|
||||||
participantCount = participantsCountValue
|
participantCount = participantsCountValue
|
||||||
default:
|
default:
|
||||||
break
|
break
|
||||||
|
|||||||
@ -51,7 +51,7 @@ func updatePeers(transaction: Transaction, accountPeerId: PeerId, peers: Accumul
|
|||||||
if let telegramUser = TelegramUser.merge(transaction.getPeer(user.peerId) as? TelegramUser, rhs: user) {
|
if let telegramUser = TelegramUser.merge(transaction.getPeer(user.peerId) as? TelegramUser, rhs: user) {
|
||||||
parsedPeers.append(telegramUser)
|
parsedPeers.append(telegramUser)
|
||||||
switch user {
|
switch user {
|
||||||
case let .user(flags, flags2, _, _, _, _, _, _, _, _, _, _, _, _, _, _, storiesMaxId, _, _, _):
|
case let .user(flags, flags2, _, _, _, _, _, _, _, _, _, _, _, _, _, _, storiesMaxId, _, _, _, _):
|
||||||
let isMin = (flags & (1 << 20)) != 0
|
let isMin = (flags & (1 << 20)) != 0
|
||||||
let storiesUnavailable = (flags2 & (1 << 4)) != 0
|
let storiesUnavailable = (flags2 & (1 << 4)) != 0
|
||||||
|
|
||||||
@ -72,7 +72,7 @@ func updatePeers(transaction: Transaction, accountPeerId: PeerId, peers: Accumul
|
|||||||
}
|
}
|
||||||
for (_, chat) in peers.chats {
|
for (_, chat) in peers.chats {
|
||||||
switch chat {
|
switch chat {
|
||||||
case let .channel(flags, flags2, _, _, _, _, _, _, _, _, _, _, _, _, storiesMaxId, _, _, _, _, _):
|
case let .channel(flags, flags2, _, _, _, _, _, _, _, _, _, _, _, _, storiesMaxId, _, _, _, _, _, _):
|
||||||
let isMin = (flags & (1 << 12)) != 0
|
let isMin = (flags & (1 << 12)) != 0
|
||||||
let storiesUnavailable = (flags2 & (1 << 3)) != 0
|
let storiesUnavailable = (flags2 & (1 << 3)) != 0
|
||||||
|
|
||||||
@ -315,7 +315,7 @@ func updatePeerPresences(transaction: Transaction, accountPeerId: PeerId, peerPr
|
|||||||
parsedPresences[peerId] = presence
|
parsedPresences[peerId] = presence
|
||||||
default:
|
default:
|
||||||
switch user {
|
switch user {
|
||||||
case let .user(flags, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _):
|
case let .user(flags, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _):
|
||||||
let isMin = (flags & (1 << 20)) != 0
|
let isMin = (flags & (1 << 20)) != 0
|
||||||
if isMin, let _ = transaction.getPeerPresence(peerId: peerId) {
|
if isMin, let _ = transaction.getPeerPresence(peerId: peerId) {
|
||||||
} else {
|
} else {
|
||||||
@ -383,7 +383,7 @@ func updateContacts(transaction: Transaction, apiUsers: [Api.User]) {
|
|||||||
for user in apiUsers {
|
for user in apiUsers {
|
||||||
var isContact: Bool?
|
var isContact: Bool?
|
||||||
switch user {
|
switch user {
|
||||||
case let .user(flags, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _):
|
case let .user(flags, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _):
|
||||||
if (flags & (1 << 20)) == 0 {
|
if (flags & (1 << 20)) == 0 {
|
||||||
isContact = (flags & (1 << 11)) != 0
|
isContact = (flags & (1 << 11)) != 0
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user