diff --git a/TelegramCore/Api0.swift b/TelegramCore/Api0.swift index c87af517fb..21e37bd4c5 100644 --- a/TelegramCore/Api0.swift +++ b/TelegramCore/Api0.swift @@ -10,7 +10,7 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = { dict[-206066487] = { return Api.InputGeoPoint.parse_inputGeoPoint($0) } dict[-784000893] = { return Api.payments.ValidatedRequestedInfo.parse_validatedRequestedInfo($0) } dict[461151667] = { return Api.ChatFull.parse_chatFull($0) } - dict[430407729] = { return Api.ChatFull.parse_channelFull($0) } + dict[-1736252138] = { return Api.ChatFull.parse_channelFull($0) } dict[1465219162] = { return Api.PollResults.parse_pollResults($0) } dict[-925415106] = { return Api.ChatParticipant.parse_chatParticipant($0) } dict[-636267638] = { return Api.ChatParticipant.parse_chatParticipantCreator($0) } @@ -475,6 +475,7 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = { dict[-1160215659] = { return Api.InputMessage.parse_inputMessageReplyTo($0) } dict[-2037963464] = { return Api.InputMessage.parse_inputMessagePinned($0) } dict[-1564789301] = { return Api.PhoneCallProtocol.parse_phoneCallProtocol($0) } + dict[-1567175714] = { return Api.MessageFwdAuthor.parse_messageFwdAuthor($0) } dict[-1539849235] = { return Api.WallPaper.parse_wallPaper($0) } dict[-1938715001] = { return Api.messages.Messages.parse_messages($0) } dict[1951620897] = { return Api.messages.Messages.parse_messagesNotModified($0) } @@ -735,9 +736,6 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = { dict[546203849] = { return Api.MessageEntity.parse_inputMessageEntityMentionName($0) } dict[-1687559349] = { return Api.MessageEntity.parse_messageEntityPhone($0) } dict[1280209983] = { return Api.MessageEntity.parse_messageEntityCashtag($0) } - dict[-1672577397] = { return Api.MessageEntity.parse_messageEntityUnderline($0) } - dict[-1090087980] = { return Api.MessageEntity.parse_messageEntityStrike($0) } - dict[34469328] = { return Api.MessageEntity.parse_messageEntityBlockquote($0) } dict[483901197] = { return Api.InputPhoto.parse_inputPhotoEmpty($0) } dict[1001634122] = { return Api.InputPhoto.parse_inputPhoto($0) } dict[-567906571] = { return Api.contacts.TopPeers.parse_topPeersNotModified($0) } @@ -1120,6 +1118,8 @@ struct Api { _1.serialize(buffer, boxed) case let _1 as Api.PhoneCallProtocol: _1.serialize(buffer, boxed) + case let _1 as Api.MessageFwdAuthor: + _1.serialize(buffer, boxed) case let _1 as Api.WallPaper: _1.serialize(buffer, boxed) case let _1 as Api.messages.Messages: diff --git a/TelegramCore/Api1.swift b/TelegramCore/Api1.swift index 889c250d3d..828b8b06b0 100644 --- a/TelegramCore/Api1.swift +++ b/TelegramCore/Api1.swift @@ -76,7 +76,7 @@ extension Api { break case .channelFull(let flags, let id, let about, let participantsCount, let adminsCount, let kickedCount, let bannedCount, let onlineCount, let readInboxMaxId, let readOutboxMaxId, let unreadCount, let chatPhoto, let notifySettings, let exportedInvite, let botInfo, let migratedFromChatId, let migratedFromMaxId, let pinnedMsgId, let stickerset, let availableMinId, let folderId, let linkedChatId, let pts): if boxed { - buffer.appendInt32(430407729) + buffer.appendInt32(-1736252138) } serializeInt32(flags, buffer: buffer, boxed: false) serializeInt32(id, buffer: buffer, boxed: false) @@ -103,7 +103,7 @@ extension Api { if Int(flags) & Int(1 << 8) != 0 {stickerset!.serialize(buffer, true)} if Int(flags) & Int(1 << 9) != 0 {serializeInt32(availableMinId!, buffer: buffer, boxed: false)} if Int(flags) & Int(1 << 11) != 0 {serializeInt32(folderId!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 12) != 0 {serializeInt32(linkedChatId!, buffer: buffer, boxed: false)} + if Int(flags) & Int(1 << 13) != 0 {serializeInt32(linkedChatId!, buffer: buffer, boxed: false)} serializeInt32(pts, buffer: buffer, boxed: false) break } @@ -220,7 +220,7 @@ extension Api { var _21: Int32? if Int(_1!) & Int(1 << 11) != 0 {_21 = reader.readInt32() } var _22: Int32? - if Int(_1!) & Int(1 << 12) != 0 {_22 = reader.readInt32() } + if Int(_1!) & Int(1 << 13) != 0 {_22 = reader.readInt32() } var _23: Int32? _23 = reader.readInt32() let _c1 = _1 != nil @@ -244,7 +244,7 @@ extension Api { let _c19 = (Int(_1!) & Int(1 << 8) == 0) || _19 != nil let _c20 = (Int(_1!) & Int(1 << 9) == 0) || _20 != nil let _c21 = (Int(_1!) & Int(1 << 11) == 0) || _21 != nil - let _c22 = (Int(_1!) & Int(1 << 12) == 0) || _22 != nil + let _c22 = (Int(_1!) & Int(1 << 13) == 0) || _22 != nil let _c23 = _23 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 && _c12 && _c13 && _c14 && _c15 && _c16 && _c17 && _c18 && _c19 && _c20 && _c21 && _c22 && _c23 { return Api.ChatFull.channelFull(flags: _1!, id: _2!, about: _3!, participantsCount: _4, adminsCount: _5, kickedCount: _6, bannedCount: _7, onlineCount: _8, readInboxMaxId: _9!, readOutboxMaxId: _10!, unreadCount: _11!, chatPhoto: _12!, notifySettings: _13!, exportedInvite: _14!, botInfo: _15!, migratedFromChatId: _16, migratedFromMaxId: _17, pinnedMsgId: _18, stickerset: _19, availableMinId: _20, folderId: _21, linkedChatId: _22, pts: _23!) @@ -12016,6 +12016,40 @@ extension Api { } } + } + enum MessageFwdAuthor: TypeConstructorDescription { + case messageFwdAuthor(channelId: Int32) + + func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .messageFwdAuthor(let channelId): + if boxed { + buffer.appendInt32(-1567175714) + } + serializeInt32(channelId, buffer: buffer, boxed: false) + break + } + } + + func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .messageFwdAuthor(let channelId): + return ("messageFwdAuthor", [("channelId", channelId)]) + } + } + + static func parse_messageFwdAuthor(_ reader: BufferReader) -> MessageFwdAuthor? { + var _1: Int32? + _1 = reader.readInt32() + let _c1 = _1 != nil + if _c1 { + return Api.MessageFwdAuthor.messageFwdAuthor(channelId: _1!) + } + else { + return nil + } + } + } enum WallPaper: TypeConstructorDescription { case wallPaper(id: Int64, flags: Int32, accessHash: Int64, slug: String, document: Api.Document, settings: Api.WallPaperSettings?) @@ -18199,9 +18233,6 @@ extension Api { case inputMessageEntityMentionName(offset: Int32, length: Int32, userId: Api.InputUser) case messageEntityPhone(offset: Int32, length: Int32) case messageEntityCashtag(offset: Int32, length: Int32) - case messageEntityUnderline(offset: Int32, length: Int32) - case messageEntityStrike(offset: Int32, length: Int32) - case messageEntityBlockquote(offset: Int32, length: Int32) func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { @@ -18314,27 +18345,6 @@ extension Api { serializeInt32(offset, buffer: buffer, boxed: false) serializeInt32(length, buffer: buffer, boxed: false) break - case .messageEntityUnderline(let offset, let length): - if boxed { - buffer.appendInt32(-1672577397) - } - serializeInt32(offset, buffer: buffer, boxed: false) - serializeInt32(length, buffer: buffer, boxed: false) - break - case .messageEntityStrike(let offset, let length): - if boxed { - buffer.appendInt32(-1090087980) - } - serializeInt32(offset, buffer: buffer, boxed: false) - serializeInt32(length, buffer: buffer, boxed: false) - break - case .messageEntityBlockquote(let offset, let length): - if boxed { - buffer.appendInt32(34469328) - } - serializeInt32(offset, buffer: buffer, boxed: false) - serializeInt32(length, buffer: buffer, boxed: false) - break } } @@ -18370,12 +18380,6 @@ extension Api { return ("messageEntityPhone", [("offset", offset), ("length", length)]) case .messageEntityCashtag(let offset, let length): return ("messageEntityCashtag", [("offset", offset), ("length", length)]) - case .messageEntityUnderline(let offset, let length): - return ("messageEntityUnderline", [("offset", offset), ("length", length)]) - case .messageEntityStrike(let offset, let length): - return ("messageEntityStrike", [("offset", offset), ("length", length)]) - case .messageEntityBlockquote(let offset, let length): - return ("messageEntityBlockquote", [("offset", offset), ("length", length)]) } } @@ -18603,48 +18607,6 @@ extension Api { return nil } } - static func parse_messageEntityUnderline(_ reader: BufferReader) -> MessageEntity? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.MessageEntity.messageEntityUnderline(offset: _1!, length: _2!) - } - else { - return nil - } - } - static func parse_messageEntityStrike(_ reader: BufferReader) -> MessageEntity? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.MessageEntity.messageEntityStrike(offset: _1!, length: _2!) - } - else { - return nil - } - } - static func parse_messageEntityBlockquote(_ reader: BufferReader) -> MessageEntity? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.MessageEntity.messageEntityBlockquote(offset: _1!, length: _2!) - } - else { - return nil - } - } } enum InputPhoto: TypeConstructorDescription { diff --git a/TelegramCore/StoreMessage_Telegram.swift b/TelegramCore/StoreMessage_Telegram.swift index c3a364eea1..eae475f495 100644 --- a/TelegramCore/StoreMessage_Telegram.swift +++ b/TelegramCore/StoreMessage_Telegram.swift @@ -363,12 +363,12 @@ func messageTextEntitiesFromApiEntities(_ entities: [Api.MessageEntity]) -> [Mes result.append(MessageTextEntity(range: Int(offset) ..< Int(offset + length), type: .PhoneNumber)) case let .messageEntityCashtag(offset, length): result.append(MessageTextEntity(range: Int(offset) ..< Int(offset + length), type: .Hashtag)) - case let .messageEntityUnderline(offset, length): + /*case let .messageEntityUnderline(offset, length): result.append(MessageTextEntity(range: Int(offset) ..< Int(offset + length), type: .Italic)) case let .messageEntityStrike(offset, length): result.append(MessageTextEntity(range: Int(offset) ..< Int(offset + length), type: .Italic)) case let .messageEntityBlockquote(offset, length): - result.append(MessageTextEntity(range: Int(offset) ..< Int(offset + length), type: .Italic)) + result.append(MessageTextEntity(range: Int(offset) ..< Int(offset + length), type: .Italic))*/ } } return result