Update API

This commit is contained in:
Isaac 2023-11-22 16:42:29 +04:00
parent 9a2562a887
commit 497c7fab1f
27 changed files with 818 additions and 545 deletions

View File

@ -166,7 +166,7 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
dict[-531931925] = { return Api.ChannelParticipantsFilter.parse_channelParticipantsMentions($0) }
dict[-566281095] = { return Api.ChannelParticipantsFilter.parse_channelParticipantsRecent($0) }
dict[106343499] = { return Api.ChannelParticipantsFilter.parse_channelParticipantsSearch($0) }
dict[427944574] = { return Api.Chat.parse_channel($0) }
dict[-1903702824] = { return Api.Chat.parse_channel($0) }
dict[399807445] = { return Api.Chat.parse_channelForbidden($0) }
dict[1103884886] = { return Api.Chat.parse_chat($0) }
dict[693512293] = { return Api.Chat.parse_chatEmpty($0) }
@ -636,6 +636,7 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
dict[918946202] = { return Api.Peer.parse_peerChat($0) }
dict[1498486562] = { return Api.Peer.parse_peerUser($0) }
dict[-386039788] = { return Api.PeerBlocked.parse_peerBlocked($0) }
dict[-1171816122] = { return Api.PeerColor.parse_peerColor($0) }
dict[-901375139] = { return Api.PeerLocated.parse_peerLocated($0) }
dict[-118740917] = { return Api.PeerLocated.parse_peerSelfLocated($0) }
dict[-1721619444] = { return Api.PeerNotifySettings.parse_peerNotifySettings($0) }
@ -967,7 +968,7 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
dict[-1886646706] = { return Api.UrlAuthResult.parse_urlAuthResultAccepted($0) }
dict[-1445536993] = { return Api.UrlAuthResult.parse_urlAuthResultDefault($0) }
dict[-1831650802] = { return Api.UrlAuthResult.parse_urlAuthResultRequest($0) }
dict[-346018011] = { return Api.User.parse_user($0) }
dict[559694904] = { return Api.User.parse_user($0) }
dict[-742634630] = { return Api.User.parse_userEmpty($0) }
dict[-1179571092] = { return Api.UserFull.parse_userFull($0) }
dict[-2100168954] = { return Api.UserProfilePhoto.parse_userProfilePhoto($0) }
@ -1082,6 +1083,9 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
dict[415997816] = { return Api.help.InviteText.parse_inviteText($0) }
dict[-1600596305] = { return Api.help.PassportConfig.parse_passportConfig($0) }
dict[-1078332329] = { return Api.help.PassportConfig.parse_passportConfigNotModified($0) }
dict[1780171841] = { return Api.help.PeerColorOption.parse_peerColorOption($0) }
dict[16313608] = { return Api.help.PeerColors.parse_peerColors($0) }
dict[732034510] = { return Api.help.PeerColors.parse_peerColorsNotModified($0) }
dict[1395946908] = { return Api.help.PremiumPromo.parse_premiumPromo($0) }
dict[-1942390465] = { return Api.help.PromoData.parse_promoData($0) }
dict[-1728664459] = { return Api.help.PromoData.parse_promoDataEmpty($0) }
@ -1160,7 +1164,7 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
dict[946083368] = { return Api.messages.StickerSetInstallResult.parse_stickerSetInstallResultSuccess($0) }
dict[816245886] = { return Api.messages.Stickers.parse_stickers($0) }
dict[-244016606] = { return Api.messages.Stickers.parse_stickersNotModified($0) }
dict[-1821037486] = { return Api.messages.TranscribedAudio.parse_transcribedAudio($0) }
dict[-809903785] = { return Api.messages.TranscribedAudio.parse_transcribedAudio($0) }
dict[870003448] = { return Api.messages.TranslatedText.parse_translateResult($0) }
dict[1218005070] = { return Api.messages.VotesList.parse_votesList($0) }
dict[-44166467] = { return Api.messages.WebPage.parse_webPage($0) }
@ -1650,6 +1654,8 @@ public extension Api {
_1.serialize(buffer, boxed)
case let _1 as Api.PeerBlocked:
_1.serialize(buffer, boxed)
case let _1 as Api.PeerColor:
_1.serialize(buffer, boxed)
case let _1 as Api.PeerLocated:
_1.serialize(buffer, boxed)
case let _1 as Api.PeerNotifySettings:
@ -1938,6 +1944,10 @@ public extension Api {
_1.serialize(buffer, boxed)
case let _1 as Api.help.PassportConfig:
_1.serialize(buffer, boxed)
case let _1 as Api.help.PeerColorOption:
_1.serialize(buffer, boxed)
case let _1 as Api.help.PeerColors:
_1.serialize(buffer, boxed)
case let _1 as Api.help.PremiumPromo:
_1.serialize(buffer, boxed)
case let _1 as Api.help.PromoData:

View File

@ -686,6 +686,46 @@ public extension Api {
}
}
public extension Api {
enum PeerColor: TypeConstructorDescription {
case peerColor(color: Int32, backgroundEmojiId: Int64)
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
switch self {
case .peerColor(let color, let backgroundEmojiId):
if boxed {
buffer.appendInt32(-1171816122)
}
serializeInt32(color, buffer: buffer, boxed: false)
serializeInt64(backgroundEmojiId, buffer: buffer, boxed: false)
break
}
}
public func descriptionFields() -> (String, [(String, Any)]) {
switch self {
case .peerColor(let color, let backgroundEmojiId):
return ("peerColor", [("color", color as Any), ("backgroundEmojiId", backgroundEmojiId as Any)])
}
}
public static func parse_peerColor(_ reader: BufferReader) -> PeerColor? {
var _1: Int32?
_1 = reader.readInt32()
var _2: Int64?
_2 = reader.readInt64()
let _c1 = _1 != nil
let _c2 = _2 != nil
if _c1 && _c2 {
return Api.PeerColor.peerColor(color: _1!, backgroundEmojiId: _2!)
}
else {
return nil
}
}
}
}
public extension Api {
enum PeerLocated: TypeConstructorDescription {
case peerLocated(peer: Api.Peer, expires: Int32, distance: Int32)

View File

@ -452,14 +452,14 @@ public extension Api {
}
public extension Api {
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: Int32?, backgroundEmojiId: Int64?)
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?)
case userEmpty(id: Int64)
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
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 backgroundEmojiId):
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):
if boxed {
buffer.appendInt32(-346018011)
buffer.appendInt32(559694904)
}
serializeInt32(flags, buffer: buffer, boxed: false)
serializeInt32(flags2, buffer: buffer, boxed: false)
@ -486,8 +486,8 @@ public extension Api {
item.serialize(buffer, true)
}}
if Int(flags2) & Int(1 << 5) != 0 {serializeInt32(storiesMaxId!, buffer: buffer, boxed: false)}
if Int(flags2) & Int(1 << 7) != 0 {serializeInt32(color!, buffer: buffer, boxed: false)}
if Int(flags2) & Int(1 << 6) != 0 {serializeInt64(backgroundEmojiId!, buffer: buffer, boxed: false)}
if Int(flags2) & Int(1 << 8) != 0 {color!.serialize(buffer, true)}
if Int(flags2) & Int(1 << 9) != 0 {profileColor!.serialize(buffer, true)}
break
case .userEmpty(let id):
if boxed {
@ -500,8 +500,8 @@ public extension Api {
public func descriptionFields() -> (String, [(String, Any)]) {
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 backgroundEmojiId):
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), ("backgroundEmojiId", backgroundEmojiId as Any)])
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):
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)])
case .userEmpty(let id):
return ("userEmpty", [("id", id as Any)])
}
@ -552,10 +552,14 @@ public extension Api {
} }
var _17: Int32?
if Int(_2!) & Int(1 << 5) != 0 {_17 = reader.readInt32() }
var _18: Int32?
if Int(_2!) & Int(1 << 7) != 0 {_18 = reader.readInt32() }
var _19: Int64?
if Int(_2!) & Int(1 << 6) != 0 {_19 = reader.readInt64() }
var _18: Api.PeerColor?
if Int(_2!) & Int(1 << 8) != 0 {if let signature = reader.readInt32() {
_18 = Api.parse(reader, signature: signature) as? Api.PeerColor
} }
var _19: Api.PeerColor?
if Int(_2!) & Int(1 << 9) != 0 {if let signature = reader.readInt32() {
_19 = Api.parse(reader, signature: signature) as? Api.PeerColor
} }
let _c1 = _1 != nil
let _c2 = _2 != nil
let _c3 = _3 != nil
@ -573,10 +577,10 @@ public extension Api {
let _c15 = (Int(_1!) & Int(1 << 30) == 0) || _15 != nil
let _c16 = (Int(_2!) & Int(1 << 0) == 0) || _16 != nil
let _c17 = (Int(_2!) & Int(1 << 5) == 0) || _17 != nil
let _c18 = (Int(_2!) & Int(1 << 7) == 0) || _18 != nil
let _c19 = (Int(_2!) & Int(1 << 6) == 0) || _19 != nil
let _c18 = (Int(_2!) & Int(1 << 8) == 0) || _18 != nil
let _c19 = (Int(_2!) & Int(1 << 9) == 0) || _19 != nil
if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 && _c12 && _c13 && _c14 && _c15 && _c16 && _c17 && _c18 && _c19 {
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, backgroundEmojiId: _19)
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)
}
else {
return nil

View File

@ -1102,6 +1102,124 @@ public extension Api.help {
}
}
public extension Api.help {
enum PeerColorOption: TypeConstructorDescription {
case peerColorOption(flags: Int32, colorId: Int32, colors: [Int32]?, darkColors: [Int32]?)
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
switch self {
case .peerColorOption(let flags, let colorId, let colors, let darkColors):
if boxed {
buffer.appendInt32(1780171841)
}
serializeInt32(flags, buffer: buffer, boxed: false)
serializeInt32(colorId, buffer: buffer, boxed: false)
if Int(flags) & Int(1 << 1) != 0 {buffer.appendInt32(481674261)
buffer.appendInt32(Int32(colors!.count))
for item in colors! {
serializeInt32(item, buffer: buffer, boxed: false)
}}
if Int(flags) & Int(1 << 2) != 0 {buffer.appendInt32(481674261)
buffer.appendInt32(Int32(darkColors!.count))
for item in darkColors! {
serializeInt32(item, buffer: buffer, boxed: false)
}}
break
}
}
public func descriptionFields() -> (String, [(String, Any)]) {
switch self {
case .peerColorOption(let flags, let colorId, let colors, let darkColors):
return ("peerColorOption", [("flags", flags as Any), ("colorId", colorId as Any), ("colors", colors as Any), ("darkColors", darkColors as Any)])
}
}
public static func parse_peerColorOption(_ reader: BufferReader) -> PeerColorOption? {
var _1: Int32?
_1 = reader.readInt32()
var _2: Int32?
_2 = reader.readInt32()
var _3: [Int32]?
if Int(_1!) & Int(1 << 1) != 0 {if let _ = reader.readInt32() {
_3 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self)
} }
var _4: [Int32]?
if Int(_1!) & Int(1 << 2) != 0 {if let _ = reader.readInt32() {
_4 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self)
} }
let _c1 = _1 != nil
let _c2 = _2 != nil
let _c3 = (Int(_1!) & Int(1 << 1) == 0) || _3 != nil
let _c4 = (Int(_1!) & Int(1 << 2) == 0) || _4 != nil
if _c1 && _c2 && _c3 && _c4 {
return Api.help.PeerColorOption.peerColorOption(flags: _1!, colorId: _2!, colors: _3, darkColors: _4)
}
else {
return nil
}
}
}
}
public extension Api.help {
enum PeerColors: TypeConstructorDescription {
case peerColors(hash: Int32, colors: [Api.help.PeerColorOption])
case peerColorsNotModified
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
switch self {
case .peerColors(let hash, let colors):
if boxed {
buffer.appendInt32(16313608)
}
serializeInt32(hash, buffer: buffer, boxed: false)
buffer.appendInt32(481674261)
buffer.appendInt32(Int32(colors.count))
for item in colors {
item.serialize(buffer, true)
}
break
case .peerColorsNotModified:
if boxed {
buffer.appendInt32(732034510)
}
break
}
}
public func descriptionFields() -> (String, [(String, Any)]) {
switch self {
case .peerColors(let hash, let colors):
return ("peerColors", [("hash", hash as Any), ("colors", colors as Any)])
case .peerColorsNotModified:
return ("peerColorsNotModified", [])
}
}
public static func parse_peerColors(_ reader: BufferReader) -> PeerColors? {
var _1: Int32?
_1 = reader.readInt32()
var _2: [Api.help.PeerColorOption]?
if let _ = reader.readInt32() {
_2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.help.PeerColorOption.self)
}
let _c1 = _1 != nil
let _c2 = _2 != nil
if _c1 && _c2 {
return Api.help.PeerColors.peerColors(hash: _1!, colors: _2!)
}
else {
return nil
}
}
public static func parse_peerColorsNotModified(_ reader: BufferReader) -> PeerColors? {
return Api.help.PeerColors.peerColorsNotModified
}
}
}
public extension Api.help {
enum PremiumPromo: TypeConstructorDescription {
case premiumPromo(statusText: String, statusEntities: [Api.MessageEntity], videoSections: [String], videos: [Api.Document], periodOptions: [Api.PremiumSubscriptionOption], users: [Api.User])
@ -1282,143 +1400,3 @@ public extension Api.help {
}
}
public extension Api.help {
enum RecentMeUrls: TypeConstructorDescription {
case recentMeUrls(urls: [Api.RecentMeUrl], chats: [Api.Chat], users: [Api.User])
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
switch self {
case .recentMeUrls(let urls, let chats, let users):
if boxed {
buffer.appendInt32(235081943)
}
buffer.appendInt32(481674261)
buffer.appendInt32(Int32(urls.count))
for item in urls {
item.serialize(buffer, true)
}
buffer.appendInt32(481674261)
buffer.appendInt32(Int32(chats.count))
for item in chats {
item.serialize(buffer, true)
}
buffer.appendInt32(481674261)
buffer.appendInt32(Int32(users.count))
for item in users {
item.serialize(buffer, true)
}
break
}
}
public func descriptionFields() -> (String, [(String, Any)]) {
switch self {
case .recentMeUrls(let urls, let chats, let users):
return ("recentMeUrls", [("urls", urls as Any), ("chats", chats as Any), ("users", users as Any)])
}
}
public static func parse_recentMeUrls(_ reader: BufferReader) -> RecentMeUrls? {
var _1: [Api.RecentMeUrl]?
if let _ = reader.readInt32() {
_1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.RecentMeUrl.self)
}
var _2: [Api.Chat]?
if let _ = reader.readInt32() {
_2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self)
}
var _3: [Api.User]?
if let _ = reader.readInt32() {
_3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self)
}
let _c1 = _1 != nil
let _c2 = _2 != nil
let _c3 = _3 != nil
if _c1 && _c2 && _c3 {
return Api.help.RecentMeUrls.recentMeUrls(urls: _1!, chats: _2!, users: _3!)
}
else {
return nil
}
}
}
}
public extension Api.help {
enum Support: TypeConstructorDescription {
case support(phoneNumber: String, user: Api.User)
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
switch self {
case .support(let phoneNumber, let user):
if boxed {
buffer.appendInt32(398898678)
}
serializeString(phoneNumber, buffer: buffer, boxed: false)
user.serialize(buffer, true)
break
}
}
public func descriptionFields() -> (String, [(String, Any)]) {
switch self {
case .support(let phoneNumber, let user):
return ("support", [("phoneNumber", phoneNumber as Any), ("user", user as Any)])
}
}
public static func parse_support(_ reader: BufferReader) -> Support? {
var _1: String?
_1 = parseString(reader)
var _2: Api.User?
if let signature = reader.readInt32() {
_2 = Api.parse(reader, signature: signature) as? Api.User
}
let _c1 = _1 != nil
let _c2 = _2 != nil
if _c1 && _c2 {
return Api.help.Support.support(phoneNumber: _1!, user: _2!)
}
else {
return nil
}
}
}
}
public extension Api.help {
enum SupportName: TypeConstructorDescription {
case supportName(name: String)
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
switch self {
case .supportName(let name):
if boxed {
buffer.appendInt32(-1945767479)
}
serializeString(name, buffer: buffer, boxed: false)
break
}
}
public func descriptionFields() -> (String, [(String, Any)]) {
switch self {
case .supportName(let name):
return ("supportName", [("name", name as Any)])
}
}
public static func parse_supportName(_ reader: BufferReader) -> SupportName? {
var _1: String?
_1 = parseString(reader)
let _c1 = _1 != nil
if _c1 {
return Api.help.SupportName.supportName(name: _1!)
}
else {
return nil
}
}
}
}

View File

@ -1,3 +1,143 @@
public extension Api.help {
enum RecentMeUrls: TypeConstructorDescription {
case recentMeUrls(urls: [Api.RecentMeUrl], chats: [Api.Chat], users: [Api.User])
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
switch self {
case .recentMeUrls(let urls, let chats, let users):
if boxed {
buffer.appendInt32(235081943)
}
buffer.appendInt32(481674261)
buffer.appendInt32(Int32(urls.count))
for item in urls {
item.serialize(buffer, true)
}
buffer.appendInt32(481674261)
buffer.appendInt32(Int32(chats.count))
for item in chats {
item.serialize(buffer, true)
}
buffer.appendInt32(481674261)
buffer.appendInt32(Int32(users.count))
for item in users {
item.serialize(buffer, true)
}
break
}
}
public func descriptionFields() -> (String, [(String, Any)]) {
switch self {
case .recentMeUrls(let urls, let chats, let users):
return ("recentMeUrls", [("urls", urls as Any), ("chats", chats as Any), ("users", users as Any)])
}
}
public static func parse_recentMeUrls(_ reader: BufferReader) -> RecentMeUrls? {
var _1: [Api.RecentMeUrl]?
if let _ = reader.readInt32() {
_1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.RecentMeUrl.self)
}
var _2: [Api.Chat]?
if let _ = reader.readInt32() {
_2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self)
}
var _3: [Api.User]?
if let _ = reader.readInt32() {
_3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self)
}
let _c1 = _1 != nil
let _c2 = _2 != nil
let _c3 = _3 != nil
if _c1 && _c2 && _c3 {
return Api.help.RecentMeUrls.recentMeUrls(urls: _1!, chats: _2!, users: _3!)
}
else {
return nil
}
}
}
}
public extension Api.help {
enum Support: TypeConstructorDescription {
case support(phoneNumber: String, user: Api.User)
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
switch self {
case .support(let phoneNumber, let user):
if boxed {
buffer.appendInt32(398898678)
}
serializeString(phoneNumber, buffer: buffer, boxed: false)
user.serialize(buffer, true)
break
}
}
public func descriptionFields() -> (String, [(String, Any)]) {
switch self {
case .support(let phoneNumber, let user):
return ("support", [("phoneNumber", phoneNumber as Any), ("user", user as Any)])
}
}
public static func parse_support(_ reader: BufferReader) -> Support? {
var _1: String?
_1 = parseString(reader)
var _2: Api.User?
if let signature = reader.readInt32() {
_2 = Api.parse(reader, signature: signature) as? Api.User
}
let _c1 = _1 != nil
let _c2 = _2 != nil
if _c1 && _c2 {
return Api.help.Support.support(phoneNumber: _1!, user: _2!)
}
else {
return nil
}
}
}
}
public extension Api.help {
enum SupportName: TypeConstructorDescription {
case supportName(name: String)
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
switch self {
case .supportName(let name):
if boxed {
buffer.appendInt32(-1945767479)
}
serializeString(name, buffer: buffer, boxed: false)
break
}
}
public func descriptionFields() -> (String, [(String, Any)]) {
switch self {
case .supportName(let name):
return ("supportName", [("name", name as Any)])
}
}
public static func parse_supportName(_ reader: BufferReader) -> SupportName? {
var _1: String?
_1 = parseString(reader)
let _c1 = _1 != nil
if _c1 {
return Api.help.SupportName.supportName(name: _1!)
}
else {
return nil
}
}
}
}
public extension Api.help {
enum TermsOfService: TypeConstructorDescription {
case termsOfService(flags: Int32, id: Api.DataJSON, text: String, entities: [Api.MessageEntity], minAgeConfirm: Int32?)
@ -1290,89 +1430,3 @@ public extension Api.messages {
}
}
public extension Api.messages {
enum ExportedChatInvite: TypeConstructorDescription {
case exportedChatInvite(invite: Api.ExportedChatInvite, users: [Api.User])
case exportedChatInviteReplaced(invite: Api.ExportedChatInvite, newInvite: Api.ExportedChatInvite, users: [Api.User])
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
switch self {
case .exportedChatInvite(let invite, let users):
if boxed {
buffer.appendInt32(410107472)
}
invite.serialize(buffer, true)
buffer.appendInt32(481674261)
buffer.appendInt32(Int32(users.count))
for item in users {
item.serialize(buffer, true)
}
break
case .exportedChatInviteReplaced(let invite, let newInvite, let users):
if boxed {
buffer.appendInt32(572915951)
}
invite.serialize(buffer, true)
newInvite.serialize(buffer, true)
buffer.appendInt32(481674261)
buffer.appendInt32(Int32(users.count))
for item in users {
item.serialize(buffer, true)
}
break
}
}
public func descriptionFields() -> (String, [(String, Any)]) {
switch self {
case .exportedChatInvite(let invite, let users):
return ("exportedChatInvite", [("invite", invite as Any), ("users", users as Any)])
case .exportedChatInviteReplaced(let invite, let newInvite, let users):
return ("exportedChatInviteReplaced", [("invite", invite as Any), ("newInvite", newInvite as Any), ("users", users as Any)])
}
}
public static func parse_exportedChatInvite(_ reader: BufferReader) -> ExportedChatInvite? {
var _1: Api.ExportedChatInvite?
if let signature = reader.readInt32() {
_1 = Api.parse(reader, signature: signature) as? Api.ExportedChatInvite
}
var _2: [Api.User]?
if let _ = reader.readInt32() {
_2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self)
}
let _c1 = _1 != nil
let _c2 = _2 != nil
if _c1 && _c2 {
return Api.messages.ExportedChatInvite.exportedChatInvite(invite: _1!, users: _2!)
}
else {
return nil
}
}
public static func parse_exportedChatInviteReplaced(_ reader: BufferReader) -> ExportedChatInvite? {
var _1: Api.ExportedChatInvite?
if let signature = reader.readInt32() {
_1 = Api.parse(reader, signature: signature) as? Api.ExportedChatInvite
}
var _2: Api.ExportedChatInvite?
if let signature = reader.readInt32() {
_2 = Api.parse(reader, signature: signature) as? Api.ExportedChatInvite
}
var _3: [Api.User]?
if let _ = reader.readInt32() {
_3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self)
}
let _c1 = _1 != nil
let _c2 = _2 != nil
let _c3 = _3 != nil
if _c1 && _c2 && _c3 {
return Api.messages.ExportedChatInvite.exportedChatInviteReplaced(invite: _1!, newInvite: _2!, users: _3!)
}
else {
return nil
}
}
}
}

View File

@ -1,3 +1,89 @@
public extension Api.messages {
enum ExportedChatInvite: TypeConstructorDescription {
case exportedChatInvite(invite: Api.ExportedChatInvite, users: [Api.User])
case exportedChatInviteReplaced(invite: Api.ExportedChatInvite, newInvite: Api.ExportedChatInvite, users: [Api.User])
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
switch self {
case .exportedChatInvite(let invite, let users):
if boxed {
buffer.appendInt32(410107472)
}
invite.serialize(buffer, true)
buffer.appendInt32(481674261)
buffer.appendInt32(Int32(users.count))
for item in users {
item.serialize(buffer, true)
}
break
case .exportedChatInviteReplaced(let invite, let newInvite, let users):
if boxed {
buffer.appendInt32(572915951)
}
invite.serialize(buffer, true)
newInvite.serialize(buffer, true)
buffer.appendInt32(481674261)
buffer.appendInt32(Int32(users.count))
for item in users {
item.serialize(buffer, true)
}
break
}
}
public func descriptionFields() -> (String, [(String, Any)]) {
switch self {
case .exportedChatInvite(let invite, let users):
return ("exportedChatInvite", [("invite", invite as Any), ("users", users as Any)])
case .exportedChatInviteReplaced(let invite, let newInvite, let users):
return ("exportedChatInviteReplaced", [("invite", invite as Any), ("newInvite", newInvite as Any), ("users", users as Any)])
}
}
public static func parse_exportedChatInvite(_ reader: BufferReader) -> ExportedChatInvite? {
var _1: Api.ExportedChatInvite?
if let signature = reader.readInt32() {
_1 = Api.parse(reader, signature: signature) as? Api.ExportedChatInvite
}
var _2: [Api.User]?
if let _ = reader.readInt32() {
_2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self)
}
let _c1 = _1 != nil
let _c2 = _2 != nil
if _c1 && _c2 {
return Api.messages.ExportedChatInvite.exportedChatInvite(invite: _1!, users: _2!)
}
else {
return nil
}
}
public static func parse_exportedChatInviteReplaced(_ reader: BufferReader) -> ExportedChatInvite? {
var _1: Api.ExportedChatInvite?
if let signature = reader.readInt32() {
_1 = Api.parse(reader, signature: signature) as? Api.ExportedChatInvite
}
var _2: Api.ExportedChatInvite?
if let signature = reader.readInt32() {
_2 = Api.parse(reader, signature: signature) as? Api.ExportedChatInvite
}
var _3: [Api.User]?
if let _ = reader.readInt32() {
_3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self)
}
let _c1 = _1 != nil
let _c2 = _2 != nil
let _c3 = _3 != nil
if _c1 && _c2 && _c3 {
return Api.messages.ExportedChatInvite.exportedChatInviteReplaced(invite: _1!, newInvite: _2!, users: _3!)
}
else {
return nil
}
}
}
}
public extension Api.messages {
enum ExportedChatInvites: TypeConstructorDescription {
case exportedChatInvites(count: Int32, invites: [Api.ExportedChatInvite], users: [Api.User])
@ -1440,65 +1526,3 @@ public extension Api.messages {
}
}
public extension Api.messages {
enum SentEncryptedMessage: TypeConstructorDescription {
case sentEncryptedFile(date: Int32, file: Api.EncryptedFile)
case sentEncryptedMessage(date: Int32)
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
switch self {
case .sentEncryptedFile(let date, let file):
if boxed {
buffer.appendInt32(-1802240206)
}
serializeInt32(date, buffer: buffer, boxed: false)
file.serialize(buffer, true)
break
case .sentEncryptedMessage(let date):
if boxed {
buffer.appendInt32(1443858741)
}
serializeInt32(date, buffer: buffer, boxed: false)
break
}
}
public func descriptionFields() -> (String, [(String, Any)]) {
switch self {
case .sentEncryptedFile(let date, let file):
return ("sentEncryptedFile", [("date", date as Any), ("file", file as Any)])
case .sentEncryptedMessage(let date):
return ("sentEncryptedMessage", [("date", date as Any)])
}
}
public static func parse_sentEncryptedFile(_ reader: BufferReader) -> SentEncryptedMessage? {
var _1: Int32?
_1 = reader.readInt32()
var _2: Api.EncryptedFile?
if let signature = reader.readInt32() {
_2 = Api.parse(reader, signature: signature) as? Api.EncryptedFile
}
let _c1 = _1 != nil
let _c2 = _2 != nil
if _c1 && _c2 {
return Api.messages.SentEncryptedMessage.sentEncryptedFile(date: _1!, file: _2!)
}
else {
return nil
}
}
public static func parse_sentEncryptedMessage(_ reader: BufferReader) -> SentEncryptedMessage? {
var _1: Int32?
_1 = reader.readInt32()
let _c1 = _1 != nil
if _c1 {
return Api.messages.SentEncryptedMessage.sentEncryptedMessage(date: _1!)
}
else {
return nil
}
}
}
}

View File

@ -1,3 +1,65 @@
public extension Api.messages {
enum SentEncryptedMessage: TypeConstructorDescription {
case sentEncryptedFile(date: Int32, file: Api.EncryptedFile)
case sentEncryptedMessage(date: Int32)
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
switch self {
case .sentEncryptedFile(let date, let file):
if boxed {
buffer.appendInt32(-1802240206)
}
serializeInt32(date, buffer: buffer, boxed: false)
file.serialize(buffer, true)
break
case .sentEncryptedMessage(let date):
if boxed {
buffer.appendInt32(1443858741)
}
serializeInt32(date, buffer: buffer, boxed: false)
break
}
}
public func descriptionFields() -> (String, [(String, Any)]) {
switch self {
case .sentEncryptedFile(let date, let file):
return ("sentEncryptedFile", [("date", date as Any), ("file", file as Any)])
case .sentEncryptedMessage(let date):
return ("sentEncryptedMessage", [("date", date as Any)])
}
}
public static func parse_sentEncryptedFile(_ reader: BufferReader) -> SentEncryptedMessage? {
var _1: Int32?
_1 = reader.readInt32()
var _2: Api.EncryptedFile?
if let signature = reader.readInt32() {
_2 = Api.parse(reader, signature: signature) as? Api.EncryptedFile
}
let _c1 = _1 != nil
let _c2 = _2 != nil
if _c1 && _c2 {
return Api.messages.SentEncryptedMessage.sentEncryptedFile(date: _1!, file: _2!)
}
else {
return nil
}
}
public static func parse_sentEncryptedMessage(_ reader: BufferReader) -> SentEncryptedMessage? {
var _1: Int32?
_1 = reader.readInt32()
let _c1 = _1 != nil
if _c1 {
return Api.messages.SentEncryptedMessage.sentEncryptedMessage(date: _1!)
}
else {
return nil
}
}
}
}
public extension Api.messages {
enum SponsoredMessages: TypeConstructorDescription {
case sponsoredMessages(flags: Int32, postsBetween: Int32?, messages: [Api.SponsoredMessage], chats: [Api.Chat], users: [Api.User])
@ -274,25 +336,27 @@ public extension Api.messages {
}
public extension Api.messages {
enum TranscribedAudio: TypeConstructorDescription {
case transcribedAudio(flags: Int32, transcriptionId: Int64, text: String)
case transcribedAudio(flags: Int32, transcriptionId: Int64, text: String, trialRemainsNum: Int32?, trialRemainsUntilDate: Int32?)
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
switch self {
case .transcribedAudio(let flags, let transcriptionId, let text):
case .transcribedAudio(let flags, let transcriptionId, let text, let trialRemainsNum, let trialRemainsUntilDate):
if boxed {
buffer.appendInt32(-1821037486)
buffer.appendInt32(-809903785)
}
serializeInt32(flags, buffer: buffer, boxed: false)
serializeInt64(transcriptionId, buffer: buffer, boxed: false)
serializeString(text, buffer: buffer, boxed: false)
if Int(flags) & Int(1 << 1) != 0 {serializeInt32(trialRemainsNum!, buffer: buffer, boxed: false)}
if Int(flags) & Int(1 << 1) != 0 {serializeInt32(trialRemainsUntilDate!, buffer: buffer, boxed: false)}
break
}
}
public func descriptionFields() -> (String, [(String, Any)]) {
switch self {
case .transcribedAudio(let flags, let transcriptionId, let text):
return ("transcribedAudio", [("flags", flags as Any), ("transcriptionId", transcriptionId as Any), ("text", text as Any)])
case .transcribedAudio(let flags, let transcriptionId, let text, let trialRemainsNum, let trialRemainsUntilDate):
return ("transcribedAudio", [("flags", flags as Any), ("transcriptionId", transcriptionId as Any), ("text", text as Any), ("trialRemainsNum", trialRemainsNum as Any), ("trialRemainsUntilDate", trialRemainsUntilDate as Any)])
}
}
@ -303,11 +367,17 @@ public extension Api.messages {
_2 = reader.readInt64()
var _3: String?
_3 = parseString(reader)
var _4: Int32?
if Int(_1!) & Int(1 << 1) != 0 {_4 = reader.readInt32() }
var _5: Int32?
if Int(_1!) & Int(1 << 1) != 0 {_5 = reader.readInt32() }
let _c1 = _1 != nil
let _c2 = _2 != nil
let _c3 = _3 != nil
if _c1 && _c2 && _c3 {
return Api.messages.TranscribedAudio.transcribedAudio(flags: _1!, transcriptionId: _2!, text: _3!)
let _c4 = (Int(_1!) & Int(1 << 1) == 0) || _4 != nil
let _c5 = (Int(_1!) & Int(1 << 1) == 0) || _5 != nil
if _c1 && _c2 && _c3 && _c4 && _c5 {
return Api.messages.TranscribedAudio.transcribedAudio(flags: _1!, transcriptionId: _2!, text: _3!, trialRemainsNum: _4, trialRemainsUntilDate: _5)
}
else {
return nil
@ -1494,143 +1564,3 @@ public extension Api.phone {
}
}
public extension Api.photos {
enum Photo: TypeConstructorDescription {
case photo(photo: Api.Photo, users: [Api.User])
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
switch self {
case .photo(let photo, let users):
if boxed {
buffer.appendInt32(539045032)
}
photo.serialize(buffer, true)
buffer.appendInt32(481674261)
buffer.appendInt32(Int32(users.count))
for item in users {
item.serialize(buffer, true)
}
break
}
}
public func descriptionFields() -> (String, [(String, Any)]) {
switch self {
case .photo(let photo, let users):
return ("photo", [("photo", photo as Any), ("users", users as Any)])
}
}
public static func parse_photo(_ reader: BufferReader) -> Photo? {
var _1: Api.Photo?
if let signature = reader.readInt32() {
_1 = Api.parse(reader, signature: signature) as? Api.Photo
}
var _2: [Api.User]?
if let _ = reader.readInt32() {
_2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self)
}
let _c1 = _1 != nil
let _c2 = _2 != nil
if _c1 && _c2 {
return Api.photos.Photo.photo(photo: _1!, users: _2!)
}
else {
return nil
}
}
}
}
public extension Api.photos {
enum Photos: TypeConstructorDescription {
case photos(photos: [Api.Photo], users: [Api.User])
case photosSlice(count: Int32, photos: [Api.Photo], users: [Api.User])
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
switch self {
case .photos(let photos, let users):
if boxed {
buffer.appendInt32(-1916114267)
}
buffer.appendInt32(481674261)
buffer.appendInt32(Int32(photos.count))
for item in photos {
item.serialize(buffer, true)
}
buffer.appendInt32(481674261)
buffer.appendInt32(Int32(users.count))
for item in users {
item.serialize(buffer, true)
}
break
case .photosSlice(let count, let photos, let users):
if boxed {
buffer.appendInt32(352657236)
}
serializeInt32(count, buffer: buffer, boxed: false)
buffer.appendInt32(481674261)
buffer.appendInt32(Int32(photos.count))
for item in photos {
item.serialize(buffer, true)
}
buffer.appendInt32(481674261)
buffer.appendInt32(Int32(users.count))
for item in users {
item.serialize(buffer, true)
}
break
}
}
public func descriptionFields() -> (String, [(String, Any)]) {
switch self {
case .photos(let photos, let users):
return ("photos", [("photos", photos as Any), ("users", users as Any)])
case .photosSlice(let count, let photos, let users):
return ("photosSlice", [("count", count as Any), ("photos", photos as Any), ("users", users as Any)])
}
}
public static func parse_photos(_ reader: BufferReader) -> Photos? {
var _1: [Api.Photo]?
if let _ = reader.readInt32() {
_1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Photo.self)
}
var _2: [Api.User]?
if let _ = reader.readInt32() {
_2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self)
}
let _c1 = _1 != nil
let _c2 = _2 != nil
if _c1 && _c2 {
return Api.photos.Photos.photos(photos: _1!, users: _2!)
}
else {
return nil
}
}
public static func parse_photosSlice(_ reader: BufferReader) -> Photos? {
var _1: Int32?
_1 = reader.readInt32()
var _2: [Api.Photo]?
if let _ = reader.readInt32() {
_2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Photo.self)
}
var _3: [Api.User]?
if let _ = reader.readInt32() {
_3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self)
}
let _c1 = _1 != nil
let _c2 = _2 != nil
let _c3 = _3 != nil
if _c1 && _c2 && _c3 {
return Api.photos.Photos.photosSlice(count: _1!, photos: _2!, users: _3!)
}
else {
return nil
}
}
}
}

View File

@ -522,7 +522,7 @@ public extension Api {
}
public extension Api {
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: Int32?, backgroundEmojiId: Int64?)
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?)
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 chatEmpty(id: Int64)
@ -530,9 +530,9 @@ public extension Api {
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
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 backgroundEmojiId):
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):
if boxed {
buffer.appendInt32(427944574)
buffer.appendInt32(-1903702824)
}
serializeInt32(flags, buffer: buffer, boxed: false)
serializeInt32(flags2, buffer: buffer, boxed: false)
@ -557,8 +557,7 @@ public extension Api {
item.serialize(buffer, true)
}}
if Int(flags2) & Int(1 << 4) != 0 {serializeInt32(storiesMaxId!, buffer: buffer, boxed: false)}
if Int(flags2) & Int(1 << 6) != 0 {serializeInt32(color!, buffer: buffer, boxed: false)}
if Int(flags2) & Int(1 << 5) != 0 {serializeInt64(backgroundEmojiId!, buffer: buffer, boxed: false)}
if Int(flags2) & Int(1 << 7) != 0 {color!.serialize(buffer, true)}
break
case .channelForbidden(let flags, let id, let accessHash, let title, let untilDate):
if boxed {
@ -603,8 +602,8 @@ public extension Api {
public func descriptionFields() -> (String, [(String, Any)]) {
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 backgroundEmojiId):
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), ("backgroundEmojiId", backgroundEmojiId as Any)])
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):
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)])
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)])
case .chat(let flags, let id, let title, let photo, let participantsCount, let date, let version, let migratedTo, let adminRights, let defaultBannedRights):
@ -659,10 +658,10 @@ public extension Api {
} }
var _15: Int32?
if Int(_2!) & Int(1 << 4) != 0 {_15 = reader.readInt32() }
var _16: Int32?
if Int(_2!) & Int(1 << 6) != 0 {_16 = reader.readInt32() }
var _17: Int64?
if Int(_2!) & Int(1 << 5) != 0 {_17 = reader.readInt64() }
var _16: Api.PeerColor?
if Int(_2!) & Int(1 << 7) != 0 {if let signature = reader.readInt32() {
_16 = Api.parse(reader, signature: signature) as? Api.PeerColor
} }
let _c1 = _1 != nil
let _c2 = _2 != nil
let _c3 = _3 != nil
@ -678,10 +677,9 @@ public extension Api {
let _c13 = (Int(_1!) & Int(1 << 17) == 0) || _13 != nil
let _c14 = (Int(_2!) & Int(1 << 0) == 0) || _14 != nil
let _c15 = (Int(_2!) & Int(1 << 4) == 0) || _15 != nil
let _c16 = (Int(_2!) & Int(1 << 6) == 0) || _16 != nil
let _c17 = (Int(_2!) & Int(1 << 5) == 0) || _17 != nil
if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 && _c12 && _c13 && _c14 && _c15 && _c16 && _c17 {
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, backgroundEmojiId: _17)
let _c16 = (Int(_2!) & Int(1 << 7) == 0) || _16 != nil
if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 && _c12 && _c13 && _c14 && _c15 && _c16 {
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)
}
else {
return nil

View File

@ -1,3 +1,143 @@
public extension Api.photos {
enum Photo: TypeConstructorDescription {
case photo(photo: Api.Photo, users: [Api.User])
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
switch self {
case .photo(let photo, let users):
if boxed {
buffer.appendInt32(539045032)
}
photo.serialize(buffer, true)
buffer.appendInt32(481674261)
buffer.appendInt32(Int32(users.count))
for item in users {
item.serialize(buffer, true)
}
break
}
}
public func descriptionFields() -> (String, [(String, Any)]) {
switch self {
case .photo(let photo, let users):
return ("photo", [("photo", photo as Any), ("users", users as Any)])
}
}
public static func parse_photo(_ reader: BufferReader) -> Photo? {
var _1: Api.Photo?
if let signature = reader.readInt32() {
_1 = Api.parse(reader, signature: signature) as? Api.Photo
}
var _2: [Api.User]?
if let _ = reader.readInt32() {
_2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self)
}
let _c1 = _1 != nil
let _c2 = _2 != nil
if _c1 && _c2 {
return Api.photos.Photo.photo(photo: _1!, users: _2!)
}
else {
return nil
}
}
}
}
public extension Api.photos {
enum Photos: TypeConstructorDescription {
case photos(photos: [Api.Photo], users: [Api.User])
case photosSlice(count: Int32, photos: [Api.Photo], users: [Api.User])
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
switch self {
case .photos(let photos, let users):
if boxed {
buffer.appendInt32(-1916114267)
}
buffer.appendInt32(481674261)
buffer.appendInt32(Int32(photos.count))
for item in photos {
item.serialize(buffer, true)
}
buffer.appendInt32(481674261)
buffer.appendInt32(Int32(users.count))
for item in users {
item.serialize(buffer, true)
}
break
case .photosSlice(let count, let photos, let users):
if boxed {
buffer.appendInt32(352657236)
}
serializeInt32(count, buffer: buffer, boxed: false)
buffer.appendInt32(481674261)
buffer.appendInt32(Int32(photos.count))
for item in photos {
item.serialize(buffer, true)
}
buffer.appendInt32(481674261)
buffer.appendInt32(Int32(users.count))
for item in users {
item.serialize(buffer, true)
}
break
}
}
public func descriptionFields() -> (String, [(String, Any)]) {
switch self {
case .photos(let photos, let users):
return ("photos", [("photos", photos as Any), ("users", users as Any)])
case .photosSlice(let count, let photos, let users):
return ("photosSlice", [("count", count as Any), ("photos", photos as Any), ("users", users as Any)])
}
}
public static func parse_photos(_ reader: BufferReader) -> Photos? {
var _1: [Api.Photo]?
if let _ = reader.readInt32() {
_1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Photo.self)
}
var _2: [Api.User]?
if let _ = reader.readInt32() {
_2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self)
}
let _c1 = _1 != nil
let _c2 = _2 != nil
if _c1 && _c2 {
return Api.photos.Photos.photos(photos: _1!, users: _2!)
}
else {
return nil
}
}
public static func parse_photosSlice(_ reader: BufferReader) -> Photos? {
var _1: Int32?
_1 = reader.readInt32()
var _2: [Api.Photo]?
if let _ = reader.readInt32() {
_2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Photo.self)
}
var _3: [Api.User]?
if let _ = reader.readInt32() {
_3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self)
}
let _c1 = _1 != nil
let _c2 = _2 != nil
let _c3 = _3 != nil
if _c1 && _c2 && _c3 {
return Api.photos.Photos.photosSlice(count: _1!, photos: _2!, users: _3!)
}
else {
return nil
}
}
}
}
public extension Api.premium {
enum BoostsList: TypeConstructorDescription {
case boostsList(flags: Int32, count: Int32, boosts: [Api.Boost], nextOffset: String?, users: [Api.User])
@ -1518,55 +1658,3 @@ public extension Api.updates {
}
}
public extension Api.updates {
enum State: TypeConstructorDescription {
case state(pts: Int32, qts: Int32, date: Int32, seq: Int32, unreadCount: Int32)
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
switch self {
case .state(let pts, let qts, let date, let seq, let unreadCount):
if boxed {
buffer.appendInt32(-1519637954)
}
serializeInt32(pts, buffer: buffer, boxed: false)
serializeInt32(qts, buffer: buffer, boxed: false)
serializeInt32(date, buffer: buffer, boxed: false)
serializeInt32(seq, buffer: buffer, boxed: false)
serializeInt32(unreadCount, buffer: buffer, boxed: false)
break
}
}
public func descriptionFields() -> (String, [(String, Any)]) {
switch self {
case .state(let pts, let qts, let date, let seq, let unreadCount):
return ("state", [("pts", pts as Any), ("qts", qts as Any), ("date", date as Any), ("seq", seq as Any), ("unreadCount", unreadCount as Any)])
}
}
public static func parse_state(_ reader: BufferReader) -> State? {
var _1: Int32?
_1 = reader.readInt32()
var _2: Int32?
_2 = reader.readInt32()
var _3: Int32?
_3 = reader.readInt32()
var _4: Int32?
_4 = reader.readInt32()
var _5: Int32?
_5 = reader.readInt32()
let _c1 = _1 != nil
let _c2 = _2 != nil
let _c3 = _3 != nil
let _c4 = _4 != nil
let _c5 = _5 != nil
if _c1 && _c2 && _c3 && _c4 && _c5 {
return Api.updates.State.state(pts: _1!, qts: _2!, date: _3!, seq: _4!, unreadCount: _5!)
}
else {
return nil
}
}
}
}

View File

@ -1,3 +1,55 @@
public extension Api.updates {
enum State: TypeConstructorDescription {
case state(pts: Int32, qts: Int32, date: Int32, seq: Int32, unreadCount: Int32)
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
switch self {
case .state(let pts, let qts, let date, let seq, let unreadCount):
if boxed {
buffer.appendInt32(-1519637954)
}
serializeInt32(pts, buffer: buffer, boxed: false)
serializeInt32(qts, buffer: buffer, boxed: false)
serializeInt32(date, buffer: buffer, boxed: false)
serializeInt32(seq, buffer: buffer, boxed: false)
serializeInt32(unreadCount, buffer: buffer, boxed: false)
break
}
}
public func descriptionFields() -> (String, [(String, Any)]) {
switch self {
case .state(let pts, let qts, let date, let seq, let unreadCount):
return ("state", [("pts", pts as Any), ("qts", qts as Any), ("date", date as Any), ("seq", seq as Any), ("unreadCount", unreadCount as Any)])
}
}
public static func parse_state(_ reader: BufferReader) -> State? {
var _1: Int32?
_1 = reader.readInt32()
var _2: Int32?
_2 = reader.readInt32()
var _3: Int32?
_3 = reader.readInt32()
var _4: Int32?
_4 = reader.readInt32()
var _5: Int32?
_5 = reader.readInt32()
let _c1 = _1 != nil
let _c2 = _2 != nil
let _c3 = _3 != nil
let _c4 = _4 != nil
let _c5 = _5 != nil
if _c1 && _c2 && _c3 && _c4 && _c5 {
return Api.updates.State.state(pts: _1!, qts: _2!, date: _3!, seq: _4!, unreadCount: _5!)
}
else {
return nil
}
}
}
}
public extension Api.upload {
enum CdnFile: TypeConstructorDescription {
case cdnFile(bytes: Buffer)

View File

@ -3946,6 +3946,36 @@ public extension Api.functions.help {
})
}
}
public extension Api.functions.help {
static func getPeerColors(hash: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<Api.help.PeerColors>) {
let buffer = Buffer()
buffer.appendInt32(-629083089)
serializeInt32(hash, buffer: buffer, boxed: false)
return (FunctionDescription(name: "help.getPeerColors", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.help.PeerColors? in
let reader = BufferReader(buffer)
var result: Api.help.PeerColors?
if let signature = reader.readInt32() {
result = Api.parse(reader, signature: signature) as? Api.help.PeerColors
}
return result
})
}
}
public extension Api.functions.help {
static func getPeerProfileColors(hash: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<Api.help.PeerColors>) {
let buffer = Buffer()
buffer.appendInt32(-1412453891)
serializeInt32(hash, buffer: buffer, boxed: false)
return (FunctionDescription(name: "help.getPeerProfileColors", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.help.PeerColors? in
let reader = BufferReader(buffer)
var result: Api.help.PeerColors?
if let signature = reader.readInt32() {
result = Api.parse(reader, signature: signature) as? Api.help.PeerColors
}
return result
})
}
}
public extension Api.functions.help {
static func getPremiumPromo() -> (FunctionDescription, Buffer, DeserializeFunctionResponse<Api.help.PremiumPromo>) {
let buffer = Buffer()

View File

@ -469,7 +469,7 @@ struct AccountMutableState {
for chat in chats {
switch chat {
case let .channel(_, _, _, _, _, _, _, _, _, _, _, _, participantsCount, _, _, _, _):
case let .channel(_, _, _, _, _, _, _, _, _, _, _, _, participantsCount, _, _, _):
if let participantsCount = participantsCount {
self.addOperation(.UpdateCachedPeerData(chat.peerId, { current in
var previous: CachedChannelData

View File

@ -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)
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)
case let .channel(flags, flags2, id, accessHash, title, username, photo, date, restrictionReason, adminRights, bannedRights, defaultBannedRights, _, usernames, _, nameColor, backgroundEmojiId):
case let .channel(flags, flags2, id, accessHash, title, username, photo, date, restrictionReason, adminRights, bannedRights, defaultBannedRights, _, usernames, _, color):
let isMin = (flags & (1 << 12)) != 0
let participationStatus: TelegramChannelParticipationStatus
@ -153,6 +153,16 @@ func parseTelegramGroupOrChannel(chat: Api.Chat) -> Peer? {
}
}
var nameColor: Int32?
var backgroundEmojiId: Int64?
if let color = color {
switch color {
case let .peerColor(color, backgroundEmojiIdValue):
nameColor = color
backgroundEmojiId = backgroundEmojiIdValue
}
}
return TelegramChannel(id: PeerId(namespace: Namespaces.Peer.CloudChannel, id: PeerId.Id._internalFromInt64Value(id)), accessHash: accessHashValue, title: title, username: username, photo: imageRepresentationsForApiChatPhoto(photo), creationDate: date, version: 0, participationStatus: participationStatus, info: info, flags: channelFlags, restrictionInfo: restrictionInfo, adminRights: adminRights.flatMap(TelegramChatAdminRights.init), bannedRights: bannedRights.flatMap(TelegramChatBannedRights.init), defaultBannedRights: defaultBannedRights.flatMap(TelegramChatBannedRights.init), usernames: usernames?.map(TelegramPeerUsername.init(apiUsername:)) ?? [], storiesHidden: storiesHidden, nameColor: nameColor.flatMap { PeerNameColor(rawValue: $0) }, backgroundEmojiId: backgroundEmojiId, profileColor: nil, profileBackgroundEmojiId: nil)
case let .channelForbidden(flags, id, accessHash, title, untilDate):
let info: TelegramChannelInfo
@ -170,7 +180,7 @@ func mergeGroupOrChannel(lhs: Peer?, rhs: Api.Chat) -> Peer? {
switch rhs {
case .chat, .chatEmpty, .chatForbidden, .channelForbidden:
return parseTelegramGroupOrChannel(chat: rhs)
case let .channel(flags, flags2, _, accessHash, title, username, photo, _, _, _, _, defaultBannedRights, _, usernames, _, nameColor, backgroundEmojiId):
case let .channel(flags, flags2, _, accessHash, title, username, photo, _, _, _, _, defaultBannedRights, _, usernames, _, color):
let isMin = (flags & (1 << 12)) != 0
if accessHash != nil && !isMin {
return parseTelegramGroupOrChannel(chat: rhs)
@ -212,7 +222,17 @@ func mergeGroupOrChannel(lhs: Peer?, rhs: Api.Chat) -> Peer? {
}
}
return TelegramChannel(id: lhs.id, accessHash: lhs.accessHash, title: title, username: username, photo: imageRepresentationsForApiChatPhoto(photo), creationDate: lhs.creationDate, version: lhs.version, participationStatus: lhs.participationStatus, info: info, flags: channelFlags, restrictionInfo: lhs.restrictionInfo, adminRights: lhs.adminRights, bannedRights: lhs.bannedRights, defaultBannedRights: defaultBannedRights.flatMap(TelegramChatBannedRights.init), usernames: usernames?.map(TelegramPeerUsername.init(apiUsername:)) ?? [], storiesHidden: storiesHidden, nameColor: nameColor.flatMap { PeerNameColor(rawValue: $0) }, backgroundEmojiId: backgroundEmojiId, profileColor: nil, profileBackgroundEmojiId: nil)
var nameColorIndex: Int32?
var backgroundEmojiId: Int64?
if let color = color {
switch color {
case let .peerColor(color, backgroundEmojiIdValue):
nameColorIndex = color
backgroundEmojiId = backgroundEmojiIdValue
}
}
return TelegramChannel(id: lhs.id, accessHash: lhs.accessHash, title: title, username: username, photo: imageRepresentationsForApiChatPhoto(photo), creationDate: lhs.creationDate, version: lhs.version, participationStatus: lhs.participationStatus, info: info, flags: channelFlags, restrictionInfo: lhs.restrictionInfo, adminRights: lhs.adminRights, bannedRights: lhs.bannedRights, defaultBannedRights: defaultBannedRights.flatMap(TelegramChatBannedRights.init), usernames: usernames?.map(TelegramPeerUsername.init(apiUsername:)) ?? [], storiesHidden: storiesHidden, nameColor: nameColorIndex.flatMap { PeerNameColor(rawValue: $0) }, backgroundEmojiId: backgroundEmojiId, profileColor: nil, profileBackgroundEmojiId: nil)
} else {
return parseTelegramGroupOrChannel(chat: rhs)
}

View File

@ -36,7 +36,7 @@ extension TelegramPeerUsername {
extension TelegramUser {
convenience init(user: Api.User) {
switch user {
case let .user(flags, flags2, id, accessHash, firstName, lastName, username, phone, photo, _, _, restrictionReason, botInlinePlaceholder, _, emojiStatus, usernames, _, nameColor, backgroundEmojiId):
case let .user(flags, flags2, id, accessHash, firstName, lastName, username, phone, photo, _, _, restrictionReason, botInlinePlaceholder, _, emojiStatus, usernames, _, color, profileColor):
let representations: [TelegramMediaImageRepresentation] = photo.flatMap(parsedTelegramProfilePhoto) ?? []
let isMin = (flags & (1 << 20)) != 0
@ -96,7 +96,27 @@ extension TelegramUser {
let restrictionInfo: PeerAccessRestrictionInfo? = restrictionReason.flatMap(PeerAccessRestrictionInfo.init(apiReasons:))
self.init(id: PeerId(namespace: Namespaces.Peer.CloudUser, id: PeerId.Id._internalFromInt64Value(id)), accessHash: accessHashValue, firstName: firstName, lastName: lastName, username: username, phone: phone, photo: representations, botInfo: botInfo, restrictionInfo: restrictionInfo, flags: userFlags, emojiStatus: emojiStatus.flatMap(PeerEmojiStatus.init(apiStatus:)), usernames: usernames?.map(TelegramPeerUsername.init(apiUsername:)) ?? [], storiesHidden: storiesHidden, nameColor: nameColor.flatMap { PeerNameColor(rawValue: $0) }, backgroundEmojiId: backgroundEmojiId, profileColor: nil, profileBackgroundEmojiId: nil)
var nameColorIndex: Int32?
var backgroundEmojiId: Int64?
if let color = color {
switch color {
case let .peerColor(color, backgroundEmojiIdValue):
nameColorIndex = color
backgroundEmojiId = backgroundEmojiIdValue
}
}
var profileColorIndex: Int32?
var profileBackgroundEmojiId: Int64?
if let profileColor = profileColor {
switch profileColor {
case let .peerColor(color, backgroundEmojiIdValue):
profileColorIndex = color
profileBackgroundEmojiId = backgroundEmojiIdValue
}
}
self.init(id: PeerId(namespace: Namespaces.Peer.CloudUser, id: PeerId.Id._internalFromInt64Value(id)), accessHash: accessHashValue, firstName: firstName, lastName: lastName, username: username, phone: phone, photo: representations, botInfo: botInfo, restrictionInfo: restrictionInfo, flags: userFlags, emojiStatus: emojiStatus.flatMap(PeerEmojiStatus.init(apiStatus:)), usernames: usernames?.map(TelegramPeerUsername.init(apiUsername:)) ?? [], storiesHidden: storiesHidden, nameColor: nameColorIndex.flatMap { PeerNameColor(rawValue: $0) }, backgroundEmojiId: backgroundEmojiId, profileColor: profileColorIndex.flatMap { PeerNameColor(rawValue: $0) }, profileBackgroundEmojiId: profileBackgroundEmojiId)
case let .userEmpty(id):
self.init(id: PeerId(namespace: Namespaces.Peer.CloudUser, id: PeerId.Id._internalFromInt64Value(id)), accessHash: nil, firstName: nil, lastName: nil, username: nil, phone: nil, photo: [], botInfo: nil, restrictionInfo: nil, flags: [], emojiStatus: nil, usernames: [], storiesHidden: nil, nameColor: nil, backgroundEmojiId: nil, profileColor: nil, profileBackgroundEmojiId: nil)
}
@ -104,7 +124,7 @@ extension TelegramUser {
static func merge(_ lhs: TelegramUser?, rhs: Api.User) -> TelegramUser? {
switch rhs {
case let .user(flags, _, _, rhsAccessHash, _, _, _, _, photo, _, _, restrictionReason, botInlinePlaceholder, _, emojiStatus, _, _, nameColor, backgroundEmojiId):
case let .user(flags, _, _, rhsAccessHash, _, _, _, _, photo, _, _, restrictionReason, botInlinePlaceholder, _, emojiStatus, _, _, nameColor, profileColor):
let isMin = (flags & (1 << 20)) != 0
if !isMin {
return TelegramUser(user: rhs)
@ -180,7 +200,27 @@ extension TelegramUser {
accessHash = lhs.accessHash ?? rhsAccessHashValue
}
return TelegramUser(id: lhs.id, accessHash: accessHash, firstName: lhs.firstName, lastName: lhs.lastName, username: lhs.username, phone: lhs.phone, photo: telegramPhoto, botInfo: botInfo, restrictionInfo: restrictionInfo, flags: userFlags, emojiStatus: emojiStatus.flatMap(PeerEmojiStatus.init(apiStatus:)), usernames: lhs.usernames, storiesHidden: lhs.storiesHidden, nameColor: nameColor.flatMap { PeerNameColor(rawValue: $0) }, backgroundEmojiId: backgroundEmojiId, profileColor: nil, profileBackgroundEmojiId: nil)
var nameColorIndex: Int32?
var backgroundEmojiId: Int64?
if let nameColor = nameColor {
switch nameColor {
case let .peerColor(color, backgroundEmojiIdValue):
nameColorIndex = color
backgroundEmojiId = backgroundEmojiIdValue
}
}
var profileColorIndex: Int32?
var profileBackgroundEmojiId: Int64?
if let profileColor = profileColor {
switch profileColor {
case let .peerColor(color, backgroundEmojiIdValue):
profileColorIndex = color
profileBackgroundEmojiId = backgroundEmojiIdValue
}
}
return TelegramUser(id: lhs.id, accessHash: accessHash, firstName: lhs.firstName, lastName: lhs.lastName, username: lhs.username, phone: lhs.phone, photo: telegramPhoto, botInfo: botInfo, restrictionInfo: restrictionInfo, flags: userFlags, emojiStatus: emojiStatus.flatMap(PeerEmojiStatus.init(apiStatus:)), usernames: lhs.usernames, storiesHidden: lhs.storiesHidden, nameColor: nameColorIndex.flatMap { PeerNameColor(rawValue: $0) }, backgroundEmojiId: backgroundEmojiId, profileColor: profileColorIndex.flatMap { PeerNameColor(rawValue: $0) }, profileBackgroundEmojiId: profileBackgroundEmojiId)
} else {
return TelegramUser(user: rhs)
}

View File

@ -182,7 +182,7 @@ extension Api.Chat {
return PeerId(namespace: Namespaces.Peer.CloudGroup, id: PeerId.Id._internalFromInt64Value(id))
case let .chatForbidden(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))
case let .channelForbidden(_, id, _, _, _):
return PeerId(namespace: Namespaces.Peer.CloudChannel, id: PeerId.Id._internalFromInt64Value(id))

View File

@ -52,7 +52,6 @@ public enum UpdateNameColorAndEmojiError {
}
func _internal_updateNameColorAndEmoji(account: Account, nameColor: PeerNameColor, backgroundEmojiId: Int64?, profileColor: PeerNameColor?, profileBackgroundEmojiId: Int64?) -> Signal<Void, UpdateNameColorAndEmojiError> {
let flags: Int32 = (1 << 0)
return account.postbox.transaction { transaction -> Signal<Peer, NoError> in
guard let peer = transaction.getPeer(account.peerId) as? TelegramUser else {
return .complete()
@ -65,12 +64,18 @@ func _internal_updateNameColorAndEmoji(account: Account, nameColor: PeerNameColo
|> switchToLatest
|> castError(UpdateNameColorAndEmojiError.self)
|> mapToSignal { _ -> Signal<Void, UpdateNameColorAndEmojiError> in
return account.network.request(Api.functions.account.updateColor(flags: flags, color: nameColor.rawValue, backgroundEmojiId: backgroundEmojiId ?? 0))
let flagsReplies: Int32 = 1 << 0
let flagsProfile: Int32 = (1 << 0) | (1 << 1)
return combineLatest(
account.network.request(Api.functions.account.updateColor(flags: flagsReplies, color: nameColor.rawValue, backgroundEmojiId: backgroundEmojiId ?? 0)),
account.network.request(Api.functions.account.updateColor(flags: flagsProfile, color: profileColor?.rawValue ?? 0, backgroundEmojiId: profileBackgroundEmojiId ?? 0))
)
|> mapError { _ -> UpdateNameColorAndEmojiError in
return .generic
}
|> mapToSignal { _ -> Signal<Void, UpdateNameColorAndEmojiError> in
|> mapToSignal { _, _ -> Signal<Void, UpdateNameColorAndEmojiError> in
return .complete()
}
}
}

View File

@ -2254,7 +2254,7 @@ func _internal_groupCallDisplayAsAvailablePeers(accountPeerId: PeerId, network:
for chat in chats {
if let groupOrChannel = parseTelegramGroupOrChannel(chat: chat) {
switch chat {
case let .channel(_, _, _, _, _, _, _, _, _, _, _, _, participantsCount, _, _, _, _):
case let .channel(_, _, _, _, _, _, _, _, _, _, _, _, participantsCount, _, _, _):
if let participantsCount = participantsCount {
subscribers[groupOrChannel.id] = participantsCount
}

View File

@ -138,7 +138,7 @@ func _internal_peerSendAsAvailablePeers(accountPeerId: PeerId, network: Network,
for chat in chats {
if let groupOrChannel = parsedPeers.get(chat.peerId) {
switch chat {
case let .channel(_, _, _, _, _, _, _, _, _, _, _, _, participantsCount, _, _, _, _):
case let .channel(_, _, _, _, _, _, _, _, _, _, _, _, participantsCount, _, _, _):
if let participantsCount = participantsCount {
subscribers[groupOrChannel.id] = participantsCount
}

View File

@ -188,7 +188,7 @@ func _internal_transcribeAudio(postbox: Postbox, network: Network, messageId: Me
switch result {
case let .success(transcribedAudio):
switch transcribedAudio {
case let .transcribedAudio(flags, transcriptionId, text):
case let .transcribedAudio(flags, transcriptionId, text, _, _):
let isPending = (flags & (1 << 0)) != 0
updatedAttribute = AudioTranscriptionMessageAttribute(id: transcriptionId, text: text, isPending: isPending, didRate: false, error: nil)

View File

@ -595,7 +595,7 @@ func _internal_channelsForStories(account: Account) -> Signal<[Peer], NoError> {
if let peer = transaction.getPeer(chat.peerId) {
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
var current = current as? CachedChannelData ?? CachedChannelData()
var participantsSummary = current.participantsSummary

View File

@ -67,7 +67,7 @@ func _internal_requestRecommendedChannels(account: Account, peerId: EnginePeer.I
for chat in chats {
if let peer = transaction.getPeer(chat.peerId) {
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
var current = current as? CachedChannelData ?? CachedChannelData()
var participantsSummary = current.participantsSummary

View File

@ -280,7 +280,7 @@ func _internal_checkChatFolderLink(account: Account, slug: String) -> Signal<Cha
var memberCounts: [PeerId: Int] = [:]
for chat in chats {
if case let .channel(_, _, _, _, _, _, _, _, _, _, _, _, participantsCount, _, _, _, _) = chat {
if case let .channel(_, _, _, _, _, _, _, _, _, _, _, _, participantsCount, _, _, _) = chat {
if let participantsCount = participantsCount {
memberCounts[chat.peerId] = Int(participantsCount)
}
@ -307,7 +307,7 @@ func _internal_checkChatFolderLink(account: Account, slug: String) -> Signal<Cha
var memberCounts: [PeerId: Int] = [:]
for chat in chats {
if case let .channel(_, _, _, _, _, _, _, _, _, _, _, _, participantsCount, _, _, _, _) = chat {
if case let .channel(_, _, _, _, _, _, _, _, _, _, _, _, participantsCount, _, _, _) = chat {
if let participantsCount = participantsCount {
memberCounts[chat.peerId] = Int(participantsCount)
}
@ -621,7 +621,7 @@ func _internal_pollChatFolderUpdatesOnce(account: Account, folderId: Int32) -> S
var memberCounts: [ChatListFiltersState.ChatListFilterUpdates.MemberCount] = []
for chat in chats {
if case let .channel(_, _, _, _, _, _, _, _, _, _, _, _, participantsCount, _, _, _, _) = chat {
if case let .channel(_, _, _, _, _, _, _, _, _, _, _, _, participantsCount, _, _, _) = chat {
if let participantsCount = participantsCount {
memberCounts.append(ChatListFiltersState.ChatListFilterUpdates.MemberCount(id: chat.peerId, count: participantsCount))
}

View File

@ -31,7 +31,7 @@ func _internal_inactiveChannelList(network: Network) -> Signal<[InactiveChannel]
var participantsCounts: [PeerId: Int32] = [:]
for chat in chats {
switch chat {
case let .channel(_, _, _, _, _, _, _, _, _, _, _, _, participantsCountValue, _, _, _, _):
case let .channel(_, _, _, _, _, _, _, _, _, _, _, _, participantsCountValue, _, _, _):
if let participantsCountValue = participantsCountValue {
participantsCounts[chat.peerId] = participantsCountValue
}

View File

@ -38,7 +38,7 @@ public func _internal_searchPeers(accountPeerId: PeerId, postbox: Postbox, netwo
for chat in chats {
if let groupOrChannel = parseTelegramGroupOrChannel(chat: chat) {
switch chat {
case let .channel(_, _, _, _, _, _, _, _, _, _, _, _, participantsCount, _, _, _, _):
case let .channel(_, _, _, _, _, _, _, _, _, _, _, _, participantsCount, _, _, _):
if let participantsCount = participantsCount {
subscribers[groupOrChannel.id] = participantsCount
}

View File

@ -166,7 +166,7 @@ func _internal_requestAccountPrivacySettings(account: Account) -> Signal<Account
if let peer = parseTelegramGroupOrChannel(chat: chat) {
var participantCount: Int32? = nil
switch chat {
case let .channel(_, _, _, _, _, _, _, _, _, _, _, _, participantsCountValue, _, _, _, _):
case let .channel(_, _, _, _, _, _, _, _, _, _, _, _, participantsCountValue, _, _, _):
participantCount = participantsCountValue
default:
break

View File

@ -72,7 +72,7 @@ func updatePeers(transaction: Transaction, accountPeerId: PeerId, peers: Accumul
}
for (_, chat) in peers.chats {
switch chat {
case let .channel(flags, flags2, _, _, _, _, _, _, _, _, _, _, _, _, storiesMaxId, _, _):
case let .channel(flags, flags2, _, _, _, _, _, _, _, _, _, _, _, _, storiesMaxId, _):
let isMin = (flags & (1 << 12)) != 0
let storiesUnavailable = (flags2 & (1 << 3)) != 0

View File

@ -822,9 +822,9 @@ func peerInfoScreenData(context: AccountContext, peerId: PeerId, strings: Presen
var peer: Peer?
peer = peerView.peers[userPeerId]
if let user = peer as? TelegramUser, let profileColor = user.nameColor {
/*if let user = peer as? TelegramUser, let profileColor = user.nameColor {
peer = user.withUpdatedProfileColor(PeerNameColor(rawValue: profileColor.rawValue)).withUpdatedProfileBackgroundEmojiId(user.backgroundEmojiId)
}
}*/
return PeerInfoScreenData(
peer: peer,