From bfe30a0f9c7e04b84fc3284b7d0861092f022490 Mon Sep 17 00:00:00 2001 From: Peter Iakovlev Date: Tue, 13 Mar 2018 21:40:16 +0400 Subject: [PATCH] no message --- .../AccountStateManagementUtils.swift | 20 +- TelegramCore/AccountStateManager.swift | 2 +- TelegramCore/AccountStateReset.swift | 17 +- TelegramCore/Api.swift | 1046 +++++------------ TelegramCore/ApiGroupOrChannel.swift | 6 +- TelegramCore/FetchChatList.swift | 18 +- TelegramCore/GroupFeedPeers.swift | 6 +- .../HistoryViewChannelStateValidation.swift | 6 +- TelegramCore/Holes.swift | 6 +- ...anagedConsumePersonalMessagesActions.swift | 5 +- ...agedGroupFeedReadStateSyncOperations.swift | 18 +- ...gedSynchronizeGroupedPeersOperations.swift | 6 +- ...agedSynchronizePinnedChatsOperations.swift | 9 +- TelegramCore/SearchMessages.swift | 6 +- TelegramCore/SearchPeers.swift | 3 +- TelegramCore/SynchronizePeerReadState.swift | 10 +- TelegramCore/UpdatesApiUtils.swift | 7 +- 17 files changed, 374 insertions(+), 817 deletions(-) diff --git a/TelegramCore/AccountStateManagementUtils.swift b/TelegramCore/AccountStateManagementUtils.swift index 98c850214d..f891489aec 100644 --- a/TelegramCore/AccountStateManagementUtils.swift +++ b/TelegramCore/AccountStateManagementUtils.swift @@ -827,12 +827,13 @@ private func finalStateWithUpdates(account: Account, state: AccountMutableState, updatedState.readInbox(MessageId(peerId: peer.peerId, namespace: Namespaces.Message.Cloud, id: maxId)) case let .updateReadHistoryOutbox(peer, maxId, _, _): updatedState.readOutbox(MessageId(peerId: peer.peerId, namespace: Namespaces.Message.Cloud, id: maxId)) - case let .updateReadFeed(_, feedId, maxPosition, unreadCount, unreadMutedCount): + /*feed*/ + /*case let .updateReadFeed(_, feedId, maxPosition, unreadCount, unreadMutedCount): switch maxPosition { case let .feedPosition(date, peer, id): let index = MessageIndex(id: MessageId(peerId: peer.peerId, namespace: Namespaces.Message.Cloud, id: id), timestamp: date) updatedState.readGroupFeedInbox(groupId: PeerGroupId(rawValue: feedId), index: index) - } + }*/ case let .updateWebPage(apiWebpage, _, _): switch apiWebpage { case let .webPageEmpty(id): @@ -1004,8 +1005,9 @@ private func finalStateWithUpdates(account: Account, state: AccountMutableState, switch peer { case let .dialogPeer(peer): item = .peer(peer.peerId) - case let .dialogPeerFeed(feedId): - item = .group(PeerGroupId(rawValue: feedId)) + /*feed*/ + /*case let .dialogPeerFeed(feedId): + item = .group(PeerGroupId(rawValue: feedId))*/ } if (flags & (1 << 0)) != 0 { updatedState.addUpdatePinnedItemIds(.pin(item)) @@ -1019,8 +1021,9 @@ private func finalStateWithUpdates(account: Account, state: AccountMutableState, switch $0 { case let .dialogPeer(peer): item = .peer(peer.peerId) - case let .dialogPeerFeed(feedId): - item = .group(PeerGroupId(rawValue: feedId)) + /*feed*/ + /*case let .dialogPeerFeed(feedId): + item = .group(PeerGroupId(rawValue: feedId))*/ } return item })) @@ -1364,9 +1367,10 @@ private func resetChannels(_ account: Account, peers: [Peer], state: AccountMuta apiUnreadMentionsCount = unreadMentionsCount apiNotificationSettings = peerNotificationSettings apiChannelPts = pts - case .dialogFeed: + /*feed*/ + /*case .dialogFeed: assertionFailure() - continue loop + continue loop*/ } let peerId: PeerId diff --git a/TelegramCore/AccountStateManager.swift b/TelegramCore/AccountStateManager.swift index 8d413fa72e..9423ec2eba 100644 --- a/TelegramCore/AccountStateManager.swift +++ b/TelegramCore/AccountStateManager.swift @@ -259,7 +259,7 @@ public final class AccountStateManager { |> take(1) |> mapToSignal { state -> Signal<(Api.updates.Difference?, AccountReplayedFinalState?), NoError> in if let authorizedState = state.state { - let request = account.network.request(Api.functions.updates.getDifference(flags: 1 << 0, pts: authorizedState.pts, ptsTotalLimit: 300000, date: authorizedState.date, qts: authorizedState.qts)) + let request = account.network.request(Api.functions.updates.getDifference(flags: 1 << 0, pts: authorizedState.pts, ptsTotalLimit: 1000, date: authorizedState.date, qts: authorizedState.qts)) |> retryRequest return request |> mapToSignal { difference -> Signal<(Api.updates.Difference?, AccountReplayedFinalState?), NoError> in switch difference { diff --git a/TelegramCore/AccountStateReset.swift b/TelegramCore/AccountStateReset.swift index a4c6b3457c..c642ec1304 100644 --- a/TelegramCore/AccountStateReset.swift +++ b/TelegramCore/AccountStateReset.swift @@ -16,7 +16,7 @@ func accountStateReset(postbox: Postbox, network: Network) -> Signal retryRequest - return combineLatest(network.request(Api.functions.messages.getDialogs(flags: 0, feedId: nil, offsetDate: 0, offsetId: 0, offsetPeer: .inputPeerEmpty, limit: 100)) + return combineLatest(network.request(Api.functions.messages.getDialogs(flags: 0, /*feed*//*feedId: nil,*/ offsetDate: 0, offsetId: 0, offsetPeer: .inputPeerEmpty, limit: 100)) |> retryRequest, pinnedChats, state) |> mapToSignal { result, pinnedChats, state -> Signal in var dialogsDialogs: [Api.Dialog] = [] @@ -54,9 +54,10 @@ func accountStateReset(postbox: Postbox, network: Network) -> Signal Signal Signal String +} + fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = { var dict: [Int32 : (BufferReader) -> Any?] = [:] dict[-1471112230] = { return $0.readInt32() } @@ -127,9 +131,6 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = { dict[129960444] = { return Api.UserStatus.parse_userStatusLastWeek($0) } dict[2011940674] = { return Api.UserStatus.parse_userStatusLastMonth($0) } dict[-455150117] = { return Api.Dialog.parse_dialog($0) } - dict[906521922] = { return Api.Dialog.parse_dialogFeed($0) } - dict[1330637553] = { return Api.FeedBroadcasts.parse_feedBroadcasts($0) } - dict[-1704428358] = { return Api.FeedBroadcasts.parse_feedBroadcastsUngrouped($0) } dict[381645902] = { return Api.SendMessageAction.parse_sendMessageTypingAction($0) } dict[-44119819] = { return Api.SendMessageAction.parse_sendMessageCancelAction($0) } dict[-1584933265] = { return Api.SendMessageAction.parse_sendMessageRecordVideoAction($0) } @@ -212,7 +213,6 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = { dict[1893427255] = { return Api.Update.parse_updateChannelAvailableMessages($0) } dict[433225532] = { return Api.Update.parse_updateDialogPinned($0) } dict[-364071333] = { return Api.Update.parse_updatePinnedDialogs($0) } - dict[1873186369] = { return Api.Update.parse_updateReadFeed($0) } dict[1558266229] = { return Api.PopularContact.parse_popularContact($0) } dict[367766557] = { return Api.ChannelParticipant.parse_channelParticipant($0) } dict[-1557620115] = { return Api.ChannelParticipant.parse_channelParticipantSelf($0) } @@ -223,7 +223,6 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = { dict[-1878523231] = { return Api.contacts.Blocked.parse_blockedSlice($0) } dict[1779444325] = { return Api.account.AuthorizationResult.parse_authorizationResult($0) } dict[-55902537] = { return Api.InputDialogPeer.parse_inputDialogPeer($0) } - dict[741914831] = { return Api.InputDialogPeer.parse_inputDialogPeerFeed($0) } dict[-994444869] = { return Api.Error.parse_error($0) } dict[-1560655744] = { return Api.KeyboardButton.parse_keyboardButton($0) } dict[629866245] = { return Api.KeyboardButton.parse_keyboardButtonUrl($0) } @@ -317,7 +316,6 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = { dict[1800845601] = { return Api.payments.PaymentResult.parse_paymentVerficationNeeded($0) } dict[1694474197] = { return Api.messages.Chats.parse_chats($0) } dict[-1663561404] = { return Api.messages.Chats.parse_chatsSlice($0) } - dict[1348066419] = { return Api.FeedPosition.parse_feedPosition($0) } dict[482797855] = { return Api.InputSingleMedia.parse_inputSingleMedia($0) } dict[218751099] = { return Api.InputPrivacyRule.parse_inputPrivacyValueAllowContacts($0) } dict[407582158] = { return Api.InputPrivacyRule.parse_inputPrivacyValueAllowAll($0) } @@ -343,8 +341,6 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = { dict[-714643696] = { return Api.ChannelAdminLogEventAction.parse_channelAdminLogEventActionParticipantToggleAdmin($0) } dict[-1312568665] = { return Api.ChannelAdminLogEventAction.parse_channelAdminLogEventActionChangeStickerSet($0) } dict[1599903217] = { return Api.ChannelAdminLogEventAction.parse_channelAdminLogEventActionTogglePreHistoryHidden($0) } - dict[1182322895] = { return Api.messages.FeedMessages.parse_feedMessagesNotModified($0) } - dict[1438884273] = { return Api.messages.FeedMessages.parse_feedMessages($0) } dict[-543777747] = { return Api.auth.ExportedAuthorization.parse_exportedAuthorization($0) } dict[-1269012015] = { return Api.messages.AffectedHistory.parse_affectedHistory($0) } dict[-2037289493] = { return Api.account.PasswordInputSettings.parse_passwordInputSettings($0) } @@ -511,8 +507,6 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = { dict[1816636575] = { return Api.LangPackString.parse_langPackStringPluralized($0) } dict[695856818] = { return Api.LangPackString.parse_langPackStringDeleted($0) } dict[-1036396922] = { return Api.InputWebFileLocation.parse_inputWebFileLocation($0) } - dict[-2001655273] = { return Api.channels.FeedSources.parse_feedSourcesNotModified($0) } - dict[-1903441347] = { return Api.channels.FeedSources.parse_feedSources($0) } dict[1436466797] = { return Api.MessageFwdHeader.parse_messageFwdHeader($0) } dict[398898678] = { return Api.help.Support.parse_support($0) } dict[1474492012] = { return Api.MessagesFilter.parse_inputMessagesFilterEmpty($0) } @@ -600,7 +594,6 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = { dict[-1378534221] = { return Api.PeerNotifyEvents.parse_peerNotifyEventsEmpty($0) } dict[1830677896] = { return Api.PeerNotifyEvents.parse_peerNotifyEventsAll($0) } dict[-445792507] = { return Api.DialogPeer.parse_dialogPeer($0) } - dict[-633170927] = { return Api.DialogPeer.parse_dialogPeerFeed($0) } dict[1599050311] = { return Api.ContactLink.parse_contactLinkUnknown($0) } dict[-17968211] = { return Api.ContactLink.parse_contactLinkNone($0) } dict[646922073] = { return Api.ContactLink.parse_contactLinkHasPhone($0) } @@ -779,8 +772,6 @@ public struct Api { _1.serialize(buffer, boxed) case let _1 as Api.Dialog: _1.serialize(buffer, boxed) - case let _1 as Api.FeedBroadcasts: - _1.serialize(buffer, boxed) case let _1 as Api.SendMessageAction: _1.serialize(buffer, boxed) case let _1 as Api.PrivacyKey: @@ -867,8 +858,6 @@ public struct Api { _1.serialize(buffer, boxed) case let _1 as Api.messages.Chats: _1.serialize(buffer, boxed) - case let _1 as Api.FeedPosition: - _1.serialize(buffer, boxed) case let _1 as Api.InputSingleMedia: _1.serialize(buffer, boxed) case let _1 as Api.InputPrivacyRule: @@ -877,8 +866,6 @@ public struct Api { _1.serialize(buffer, boxed) case let _1 as Api.ChannelAdminLogEventAction: _1.serialize(buffer, boxed) - case let _1 as Api.messages.FeedMessages: - _1.serialize(buffer, boxed) case let _1 as Api.auth.ExportedAuthorization: _1.serialize(buffer, boxed) case let _1 as Api.messages.AffectedHistory: @@ -1051,8 +1038,6 @@ public struct Api { _1.serialize(buffer, boxed) case let _1 as Api.InputWebFileLocation: _1.serialize(buffer, boxed) - case let _1 as Api.channels.FeedSources: - _1.serialize(buffer, boxed) case let _1 as Api.MessageFwdHeader: _1.serialize(buffer, boxed) case let _1 as Api.help.Support: @@ -1174,7 +1159,6 @@ public struct Api { break } } - fileprivate static func parse_stickerSet(_ reader: BufferReader) -> StickerSet? { var _1: Api.StickerSet? if let signature = reader.readInt32() { @@ -1199,6 +1183,7 @@ public struct Api { } } + } public enum ArchivedStickers { @@ -1219,7 +1204,6 @@ public struct Api { break } } - fileprivate static func parse_archivedStickers(_ reader: BufferReader) -> ArchivedStickers? { var _1: Int32? _1 = reader.readInt32() @@ -1237,6 +1221,7 @@ public struct Api { } } + } public enum SentEncryptedMessage { @@ -1260,7 +1245,6 @@ public struct Api { break } } - fileprivate static func parse_sentEncryptedMessage(_ reader: BufferReader) -> SentEncryptedMessage? { var _1: Int32? _1 = reader.readInt32() @@ -1289,6 +1273,7 @@ public struct Api { } } + } public enum Stickers { @@ -1316,7 +1301,6 @@ public struct Api { break } } - fileprivate static func parse_stickersNotModified(_ reader: BufferReader) -> Stickers? { return Api.messages.Stickers.stickersNotModified } @@ -1337,6 +1321,7 @@ public struct Api { } } + } public enum FoundStickerSets { @@ -1364,7 +1349,6 @@ public struct Api { break } } - fileprivate static func parse_foundStickerSetsNotModified(_ reader: BufferReader) -> FoundStickerSets? { return Api.messages.FoundStickerSets.foundStickerSetsNotModified } @@ -1385,6 +1369,7 @@ public struct Api { } } + } public enum FoundGifs { @@ -1405,7 +1390,6 @@ public struct Api { break } } - fileprivate static func parse_foundGifs(_ reader: BufferReader) -> FoundGifs? { var _1: Int32? _1 = reader.readInt32() @@ -1423,6 +1407,7 @@ public struct Api { } } + } public enum BotResults { @@ -1452,7 +1437,6 @@ public struct Api { break } } - fileprivate static func parse_botResults(_ reader: BufferReader) -> BotResults? { var _1: Int32? _1 = reader.readInt32() @@ -1489,6 +1473,7 @@ public struct Api { } } + } public enum BotCallbackAnswer { @@ -1507,7 +1492,6 @@ public struct Api { break } } - fileprivate static func parse_botCallbackAnswer(_ reader: BufferReader) -> BotCallbackAnswer? { var _1: Int32? _1 = reader.readInt32() @@ -1529,6 +1513,7 @@ public struct Api { } } + } public enum Chats { @@ -1560,7 +1545,6 @@ public struct Api { break } } - fileprivate static func parse_chats(_ reader: BufferReader) -> Chats? { var _1: [Api.Chat]? if let _ = reader.readInt32() { @@ -1591,6 +1575,7 @@ public struct Api { } } + } public enum DhConfig { @@ -1616,7 +1601,6 @@ public struct Api { break } } - fileprivate static func parse_dhConfigNotModified(_ reader: BufferReader) -> DhConfig? { var _1: Buffer? _1 = parseBytes(reader) @@ -1649,91 +1633,6 @@ public struct Api { } } - } - - public enum FeedMessages { - case feedMessagesNotModified - case feedMessages(flags: Int32, maxPosition: Api.FeedPosition?, minPosition: Api.FeedPosition?, readMaxPosition: Api.FeedPosition?, messages: [Api.Message], chats: [Api.Chat], users: [Api.User]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .feedMessagesNotModified: - if boxed { - buffer.appendInt32(1182322895) - } - - break - case .feedMessages(let flags, let maxPosition, let minPosition, let readMaxPosition, let messages, let chats, let users): - if boxed { - buffer.appendInt32(1438884273) - } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {maxPosition!.serialize(buffer, true)} - if Int(flags) & Int(1 << 1) != 0 {minPosition!.serialize(buffer, true)} - if Int(flags) & Int(1 << 2) != 0 {readMaxPosition!.serialize(buffer, true)} - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(messages.count)) - for item in messages { - 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 - } - } - - fileprivate static func parse_feedMessagesNotModified(_ reader: BufferReader) -> FeedMessages? { - return Api.messages.FeedMessages.feedMessagesNotModified - } - fileprivate static func parse_feedMessages(_ reader: BufferReader) -> FeedMessages? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.FeedPosition? - if Int(_1!) & Int(1 << 0) != 0 {if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.FeedPosition - } } - var _3: Api.FeedPosition? - if Int(_1!) & Int(1 << 1) != 0 {if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.FeedPosition - } } - var _4: Api.FeedPosition? - if Int(_1!) & Int(1 << 2) != 0 {if let signature = reader.readInt32() { - _4 = Api.parse(reader, signature: signature) as? Api.FeedPosition - } } - var _5: [Api.Message]? - if let _ = reader.readInt32() { - _5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Message.self) - } - var _6: [Api.Chat]? - if let _ = reader.readInt32() { - _6 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) - } - var _7: [Api.User]? - if let _ = reader.readInt32() { - _7 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) - } - let _c1 = _1 != nil - let _c2 = (Int(_1!) & Int(1 << 0) == 0) || _2 != nil - let _c3 = (Int(_1!) & Int(1 << 1) == 0) || _3 != nil - let _c4 = (Int(_1!) & Int(1 << 2) == 0) || _4 != nil - let _c5 = _5 != nil - let _c6 = _6 != nil - let _c7 = _7 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { - return Api.messages.FeedMessages.feedMessages(flags: _1!, maxPosition: _2, minPosition: _3, readMaxPosition: _4, messages: _5!, chats: _6!, users: _7!) - } - else { - return nil - } - } } @@ -1752,7 +1651,6 @@ public struct Api { break } } - fileprivate static func parse_affectedHistory(_ reader: BufferReader) -> AffectedHistory? { var _1: Int32? _1 = reader.readInt32() @@ -1771,6 +1669,7 @@ public struct Api { } } + } public enum MessageEditData { @@ -1786,7 +1685,6 @@ public struct Api { break } } - fileprivate static func parse_messageEditData(_ reader: BufferReader) -> MessageEditData? { var _1: Int32? _1 = reader.readInt32() @@ -1799,6 +1697,7 @@ public struct Api { } } + } public enum ChatFull { @@ -1824,7 +1723,6 @@ public struct Api { break } } - fileprivate static func parse_chatFull(_ reader: BufferReader) -> ChatFull? { var _1: Api.ChatFull? if let signature = reader.readInt32() { @@ -1849,6 +1747,7 @@ public struct Api { } } + } public enum StickerSetInstallResult { @@ -1875,7 +1774,6 @@ public struct Api { break } } - fileprivate static func parse_stickerSetInstallResultSuccess(_ reader: BufferReader) -> StickerSetInstallResult? { return Api.messages.StickerSetInstallResult.stickerSetInstallResultSuccess } @@ -1893,6 +1791,7 @@ public struct Api { } } + } public enum AffectedMessages { @@ -1909,7 +1808,6 @@ public struct Api { break } } - fileprivate static func parse_affectedMessages(_ reader: BufferReader) -> AffectedMessages? { var _1: Int32? _1 = reader.readInt32() @@ -1925,6 +1823,7 @@ public struct Api { } } + } public enum SavedGifs { @@ -1952,7 +1851,6 @@ public struct Api { break } } - fileprivate static func parse_savedGifsNotModified(_ reader: BufferReader) -> SavedGifs? { return Api.messages.SavedGifs.savedGifsNotModified } @@ -1973,6 +1871,7 @@ public struct Api { } } + } public enum Messages { @@ -2055,7 +1954,6 @@ public struct Api { break } } - fileprivate static func parse_messages(_ reader: BufferReader) -> Messages? { var _1: [Api.Message]? if let _ = reader.readInt32() { @@ -2149,6 +2047,7 @@ public struct Api { } } + } public enum PeerDialogs { @@ -2184,7 +2083,6 @@ public struct Api { break } } - fileprivate static func parse_peerDialogs(_ reader: BufferReader) -> PeerDialogs? { var _1: [Api.Dialog]? if let _ = reader.readInt32() { @@ -2219,6 +2117,7 @@ public struct Api { } } + } public enum RecentStickers { @@ -2256,7 +2155,6 @@ public struct Api { break } } - fileprivate static func parse_recentStickersNotModified(_ reader: BufferReader) -> RecentStickers? { return Api.messages.RecentStickers.recentStickersNotModified } @@ -2287,6 +2185,7 @@ public struct Api { } } + } public enum FeaturedStickers { @@ -2319,7 +2218,6 @@ public struct Api { break } } - fileprivate static func parse_featuredStickersNotModified(_ reader: BufferReader) -> FeaturedStickers? { return Api.messages.FeaturedStickers.featuredStickersNotModified } @@ -2345,6 +2243,7 @@ public struct Api { } } + } public enum Dialogs { @@ -2406,7 +2305,6 @@ public struct Api { break } } - fileprivate static func parse_dialogs(_ reader: BufferReader) -> Dialogs? { var _1: [Api.Dialog]? if let _ = reader.readInt32() { @@ -2467,6 +2365,7 @@ public struct Api { } } + } public enum FavedStickers { @@ -2499,7 +2398,6 @@ public struct Api { break } } - fileprivate static func parse_favedStickersNotModified(_ reader: BufferReader) -> FavedStickers? { return Api.messages.FavedStickers.favedStickersNotModified } @@ -2525,6 +2423,7 @@ public struct Api { } } + } public enum AllStickers { @@ -2552,7 +2451,6 @@ public struct Api { break } } - fileprivate static func parse_allStickersNotModified(_ reader: BufferReader) -> AllStickers? { return Api.messages.AllStickers.allStickersNotModified } @@ -2573,6 +2471,7 @@ public struct Api { } } + } public enum HighScores { @@ -2597,7 +2496,6 @@ public struct Api { break } } - fileprivate static func parse_highScores(_ reader: BufferReader) -> HighScores? { var _1: [Api.HighScore]? if let _ = reader.readInt32() { @@ -2617,6 +2515,7 @@ public struct Api { } } + } } @@ -2641,7 +2540,6 @@ public struct Api { break } } - fileprivate static func parse_inputGeoPointEmpty(_ reader: BufferReader) -> InputGeoPoint? { return Api.InputGeoPoint.inputGeoPointEmpty } @@ -2660,6 +2558,7 @@ public struct Api { } } + } public enum ChatFull { @@ -2713,7 +2612,6 @@ public struct Api { break } } - fileprivate static func parse_chatFull(_ reader: BufferReader) -> ChatFull? { var _1: Int32? _1 = reader.readInt32() @@ -2826,6 +2724,7 @@ public struct Api { } } + } public enum ChatParticipant { @@ -2859,7 +2758,6 @@ public struct Api { break } } - fileprivate static func parse_chatParticipant(_ reader: BufferReader) -> ChatParticipant? { var _1: Int32? _1 = reader.readInt32() @@ -2906,6 +2804,7 @@ public struct Api { } } + } public enum CdnConfig { @@ -2925,7 +2824,6 @@ public struct Api { break } } - fileprivate static func parse_cdnConfig(_ reader: BufferReader) -> CdnConfig? { var _1: [Api.CdnPublicKey]? if let _ = reader.readInt32() { @@ -2940,6 +2838,7 @@ public struct Api { } } + } public indirect enum PageBlock { @@ -3148,7 +3047,6 @@ public struct Api { break } } - fileprivate static func parse_pageBlockUnsupported(_ reader: BufferReader) -> PageBlock? { return Api.PageBlock.pageBlockUnsupported } @@ -3508,6 +3406,7 @@ public struct Api { } } + } public enum Photo { @@ -3538,7 +3437,6 @@ public struct Api { break } } - fileprivate static func parse_photoEmpty(_ reader: BufferReader) -> Photo? { var _1: Int64? _1 = reader.readInt64() @@ -3576,6 +3474,7 @@ public struct Api { } } + } public enum Chat { @@ -3583,7 +3482,7 @@ public struct Api { case chat(flags: Int32, id: Int32, title: String, photo: Api.ChatPhoto, participantsCount: Int32, date: Int32, version: Int32, migratedTo: Api.InputChannel?) case chatForbidden(id: Int32, title: String) case channelForbidden(flags: Int32, id: Int32, accessHash: Int64, title: String, untilDate: Int32?) - case channel(flags: Int32, id: Int32, accessHash: Int64?, title: String, username: String?, photo: Api.ChatPhoto, date: Int32, version: Int32, restrictionReason: String?, adminRights: Api.ChannelAdminRights?, bannedRights: Api.ChannelBannedRights?, participantsCount: Int32?, feedId: Int32?) + case channel(flags: Int32, id: Int32, accessHash: Int64?, title: String, username: String?, photo: Api.ChatPhoto, date: Int32, version: Int32, restrictionReason: String?, adminRights: Api.ChannelAdminRights?, bannedRights: Api.ChannelBannedRights?, participantsCount: Int32?) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { @@ -3623,7 +3522,7 @@ public struct Api { serializeString(title, buffer: buffer, boxed: false) if Int(flags) & Int(1 << 16) != 0 {serializeInt32(untilDate!, buffer: buffer, boxed: false)} break - case .channel(let flags, let id, let accessHash, let title, let username, let photo, let date, let version, let restrictionReason, let adminRights, let bannedRights, let participantsCount, let feedId): + case .channel(let flags, let id, let accessHash, let title, let username, let photo, let date, let version, let restrictionReason, let adminRights, let bannedRights, let participantsCount): if boxed { buffer.appendInt32(-930515796) } @@ -3639,11 +3538,9 @@ public struct Api { if Int(flags) & Int(1 << 14) != 0 {adminRights!.serialize(buffer, true)} if Int(flags) & Int(1 << 15) != 0 {bannedRights!.serialize(buffer, true)} if Int(flags) & Int(1 << 17) != 0 {serializeInt32(participantsCount!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 18) != 0 {serializeInt32(feedId!, buffer: buffer, boxed: false)} break } } - fileprivate static func parse_chatEmpty(_ reader: BufferReader) -> Chat? { var _1: Int32? _1 = reader.readInt32() @@ -3759,8 +3656,6 @@ public struct Api { } } var _12: Int32? if Int(_1!) & Int(1 << 17) != 0 {_12 = reader.readInt32() } - var _13: Int32? - if Int(_1!) & Int(1 << 18) != 0 {_13 = reader.readInt32() } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = (Int(_1!) & Int(1 << 13) == 0) || _3 != nil @@ -3773,15 +3668,15 @@ public struct Api { let _c10 = (Int(_1!) & Int(1 << 14) == 0) || _10 != nil let _c11 = (Int(_1!) & Int(1 << 15) == 0) || _11 != nil let _c12 = (Int(_1!) & Int(1 << 17) == 0) || _12 != nil - let _c13 = (Int(_1!) & Int(1 << 18) == 0) || _13 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 && _c12 && _c13 { - return Api.Chat.channel(flags: _1!, id: _2!, accessHash: _3, title: _4!, username: _5, photo: _6!, date: _7!, version: _8!, restrictionReason: _9, adminRights: _10, bannedRights: _11, participantsCount: _12, feedId: _13) + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 && _c12 { + return Api.Chat.channel(flags: _1!, id: _2!, accessHash: _3, title: _4!, username: _5, photo: _6!, date: _7!, version: _8!, restrictionReason: _9, adminRights: _10, bannedRights: _11, participantsCount: _12) } else { return nil } } + } public enum ChatInvite { @@ -3812,7 +3707,6 @@ public struct Api { break } } - fileprivate static func parse_chatInviteAlready(_ reader: BufferReader) -> ChatInvite? { var _1: Api.Chat? if let signature = reader.readInt32() { @@ -3854,6 +3748,7 @@ public struct Api { } } + } public enum StickerSetCovered { @@ -3882,7 +3777,6 @@ public struct Api { break } } - fileprivate static func parse_stickerSetCovered(_ reader: BufferReader) -> StickerSetCovered? { var _1: Api.StickerSet? if let signature = reader.readInt32() { @@ -3920,6 +3814,7 @@ public struct Api { } } + } public enum RecentMeUrl { @@ -3967,7 +3862,6 @@ public struct Api { break } } - fileprivate static func parse_recentMeUrlUnknown(_ reader: BufferReader) -> RecentMeUrl? { var _1: String? _1 = parseString(reader) @@ -4040,6 +3934,7 @@ public struct Api { } } + } public indirect enum RichText { @@ -4125,7 +4020,6 @@ public struct Api { break } } - fileprivate static func parse_textEmpty(_ reader: BufferReader) -> RichText? { return Api.RichText.textEmpty } @@ -4254,6 +4148,7 @@ public struct Api { } } + } public enum UserFull { @@ -4276,7 +4171,6 @@ public struct Api { break } } - fileprivate static func parse_userFull(_ reader: BufferReader) -> UserFull? { var _1: Int32? _1 = reader.readInt32() @@ -4320,6 +4214,7 @@ public struct Api { } } + } public enum SecureValueAccepted { @@ -4336,7 +4231,6 @@ public struct Api { break } } - fileprivate static func parse_secureValueAccepted(_ reader: BufferReader) -> SecureValueAccepted? { var _1: String? _1 = parseString(reader) @@ -4352,6 +4246,7 @@ public struct Api { } } + } public enum InputPeerNotifyEvents { @@ -4374,7 +4269,6 @@ public struct Api { break } } - fileprivate static func parse_inputPeerNotifyEventsEmpty(_ reader: BufferReader) -> InputPeerNotifyEvents? { return Api.InputPeerNotifyEvents.inputPeerNotifyEventsEmpty } @@ -4382,6 +4276,7 @@ public struct Api { return Api.InputPeerNotifyEvents.inputPeerNotifyEventsAll } + } public enum InputChannel { @@ -4405,7 +4300,6 @@ public struct Api { break } } - fileprivate static func parse_inputChannelEmpty(_ reader: BufferReader) -> InputChannel? { return Api.InputChannel.inputChannelEmpty } @@ -4424,6 +4318,7 @@ public struct Api { } } + } public enum DcOption { @@ -4442,7 +4337,6 @@ public struct Api { break } } - fileprivate static func parse_dcOption(_ reader: BufferReader) -> DcOption? { var _1: Int32? _1 = reader.readInt32() @@ -4464,6 +4358,7 @@ public struct Api { } } + } public enum LangPackLanguage { @@ -4481,7 +4376,6 @@ public struct Api { break } } - fileprivate static func parse_langPackLanguage(_ reader: BufferReader) -> LangPackLanguage? { var _1: String? _1 = parseString(reader) @@ -4500,6 +4394,7 @@ public struct Api { } } + } public enum LangPackDifference { @@ -4522,7 +4417,6 @@ public struct Api { break } } - fileprivate static func parse_langPackDifference(_ reader: BufferReader) -> LangPackDifference? { var _1: String? _1 = parseString(reader) @@ -4546,6 +4440,7 @@ public struct Api { } } + } public enum InputEncryptedFile { @@ -4588,7 +4483,6 @@ public struct Api { break } } - fileprivate static func parse_inputEncryptedFileEmpty(_ reader: BufferReader) -> InputEncryptedFile? { return Api.InputEncryptedFile.inputEncryptedFileEmpty } @@ -4644,6 +4538,7 @@ public struct Api { } } + } public enum ExportedMessageLink { @@ -4660,7 +4555,6 @@ public struct Api { break } } - fileprivate static func parse_exportedMessageLink(_ reader: BufferReader) -> ExportedMessageLink? { var _1: String? _1 = parseString(reader) @@ -4676,6 +4570,7 @@ public struct Api { } } + } public enum InputFile { @@ -4703,7 +4598,6 @@ public struct Api { break } } - fileprivate static func parse_inputFile(_ reader: BufferReader) -> InputFile? { var _1: Int64? _1 = reader.readInt64() @@ -4742,6 +4636,7 @@ public struct Api { } } + } public enum Peer { @@ -4771,7 +4666,6 @@ public struct Api { break } } - fileprivate static func parse_peerUser(_ reader: BufferReader) -> Peer? { var _1: Int32? _1 = reader.readInt32() @@ -4806,6 +4700,7 @@ public struct Api { } } + } public enum PaymentRequestedInfo { @@ -4825,7 +4720,6 @@ public struct Api { break } } - fileprivate static func parse_paymentRequestedInfo(_ reader: BufferReader) -> PaymentRequestedInfo? { var _1: Int32? _1 = reader.readInt32() @@ -4852,6 +4746,7 @@ public struct Api { } } + } public enum UserStatus { @@ -4902,7 +4797,6 @@ public struct Api { break } } - fileprivate static func parse_userStatusEmpty(_ reader: BufferReader) -> UserStatus? { return Api.UserStatus.userStatusEmpty } @@ -4938,11 +4832,11 @@ public struct Api { return Api.UserStatus.userStatusLastMonth } + } public enum Dialog { case dialog(flags: Int32, peer: Api.Peer, topMessage: Int32, readInboxMaxId: Int32, readOutboxMaxId: Int32, unreadCount: Int32, unreadMentionsCount: Int32, notifySettings: Api.PeerNotifySettings, pts: Int32?, draft: Api.DraftMessage?) - case dialogFeed(flags: Int32, peer: Api.Peer, topMessage: Int32, feedId: Int32, feedOtherChannels: [Int32], readMaxPosition: Api.FeedPosition?, unreadCount: Int32, unreadMutedCount: Int32) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { @@ -4961,26 +4855,8 @@ public struct Api { if Int(flags) & Int(1 << 0) != 0 {serializeInt32(pts!, buffer: buffer, boxed: false)} if Int(flags) & Int(1 << 1) != 0 {draft!.serialize(buffer, true)} break - case .dialogFeed(let flags, let peer, let topMessage, let feedId, let feedOtherChannels, let readMaxPosition, let unreadCount, let unreadMutedCount): - if boxed { - buffer.appendInt32(906521922) - } - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - serializeInt32(topMessage, buffer: buffer, boxed: false) - serializeInt32(feedId, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(feedOtherChannels.count)) - for item in feedOtherChannels { - serializeInt32(item, buffer: buffer, boxed: false) - } - if Int(flags) & Int(1 << 3) != 0 {readMaxPosition!.serialize(buffer, true)} - serializeInt32(unreadCount, buffer: buffer, boxed: false) - serializeInt32(unreadMutedCount, buffer: buffer, boxed: false) - break } } - fileprivate static func parse_dialog(_ reader: BufferReader) -> Dialog? { var _1: Int32? _1 = reader.readInt32() @@ -5025,106 +4901,7 @@ public struct Api { return nil } } - fileprivate static func parse_dialogFeed(_ reader: BufferReader) -> Dialog? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.Peer? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.Peer - } - var _3: Int32? - _3 = reader.readInt32() - var _4: Int32? - _4 = reader.readInt32() - var _5: [Int32]? - if let _ = reader.readInt32() { - _5 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) - } - var _6: Api.FeedPosition? - if Int(_1!) & Int(1 << 3) != 0 {if let signature = reader.readInt32() { - _6 = Api.parse(reader, signature: signature) as? Api.FeedPosition - } } - var _7: Int32? - _7 = reader.readInt32() - var _8: Int32? - _8 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - let _c6 = (Int(_1!) & Int(1 << 3) == 0) || _6 != nil - let _c7 = _7 != nil - let _c8 = _8 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 { - return Api.Dialog.dialogFeed(flags: _1!, peer: _2!, topMessage: _3!, feedId: _4!, feedOtherChannels: _5!, readMaxPosition: _6, unreadCount: _7!, unreadMutedCount: _8!) - } - else { - return nil - } - } - } - - public enum FeedBroadcasts { - case feedBroadcasts(feedId: Int32, channels: [Int32]) - case feedBroadcastsUngrouped(channels: [Int32]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .feedBroadcasts(let feedId, let channels): - if boxed { - buffer.appendInt32(1330637553) - } - serializeInt32(feedId, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(channels.count)) - for item in channels { - serializeInt32(item, buffer: buffer, boxed: false) - } - break - case .feedBroadcastsUngrouped(let channels): - if boxed { - buffer.appendInt32(-1704428358) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(channels.count)) - for item in channels { - serializeInt32(item, buffer: buffer, boxed: false) - } - break - } - } - - fileprivate static func parse_feedBroadcasts(_ reader: BufferReader) -> FeedBroadcasts? { - var _1: Int32? - _1 = reader.readInt32() - var _2: [Int32]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.FeedBroadcasts.feedBroadcasts(feedId: _1!, channels: _2!) - } - else { - return nil - } - } - fileprivate static func parse_feedBroadcastsUngrouped(_ reader: BufferReader) -> FeedBroadcasts? { - var _1: [Int32]? - if let _ = reader.readInt32() { - _1 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) - } - let _c1 = _1 != nil - if _c1 { - return Api.FeedBroadcasts.feedBroadcastsUngrouped(channels: _1!) - } - else { - return nil - } - } } @@ -5225,7 +5002,6 @@ public struct Api { break } } - fileprivate static func parse_sendMessageTypingAction(_ reader: BufferReader) -> SendMessageAction? { return Api.SendMessageAction.sendMessageTypingAction } @@ -5298,6 +5074,7 @@ public struct Api { return Api.SendMessageAction.sendMessageUploadRoundAction } + } public enum PrivacyKey { @@ -5327,7 +5104,6 @@ public struct Api { break } } - fileprivate static func parse_privacyKeyStatusTimestamp(_ reader: BufferReader) -> PrivacyKey? { return Api.PrivacyKey.privacyKeyStatusTimestamp } @@ -5338,6 +5114,7 @@ public struct Api { return Api.PrivacyKey.privacyKeyPhoneCall } + } public enum Update { @@ -5407,7 +5184,6 @@ public struct Api { case updateChannelAvailableMessages(channelId: Int32, availableMinId: Int32) case updateDialogPinned(flags: Int32, peer: Api.DialogPeer) case updatePinnedDialogs(flags: Int32, order: [Api.DialogPeer]?) - case updateReadFeed(flags: Int32, feedId: Int32, maxPosition: Api.FeedPosition, unreadCount: Int32?, unreadMutedCount: Int32?) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { @@ -5955,19 +5731,8 @@ public struct Api { item.serialize(buffer, true) }} break - case .updateReadFeed(let flags, let feedId, let maxPosition, let unreadCount, let unreadMutedCount): - if boxed { - buffer.appendInt32(1873186369) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt32(feedId, buffer: buffer, boxed: false) - maxPosition.serialize(buffer, true) - if Int(flags) & Int(1 << 0) != 0 {serializeInt32(unreadCount!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 0) != 0 {serializeInt32(unreadMutedCount!, buffer: buffer, boxed: false)} - break } } - fileprivate static func parse_updateNewMessage(_ reader: BufferReader) -> Update? { var _1: Api.Message? if let signature = reader.readInt32() { @@ -7056,31 +6821,7 @@ public struct Api { return nil } } - fileprivate static func parse_updateReadFeed(_ reader: BufferReader) -> Update? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - var _3: Api.FeedPosition? - if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.FeedPosition - } - var _4: Int32? - if Int(_1!) & Int(1 << 0) != 0 {_4 = reader.readInt32() } - var _5: Int32? - if Int(_1!) & Int(1 << 0) != 0 {_5 = 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 << 0) == 0) || _5 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.Update.updateReadFeed(flags: _1!, feedId: _2!, maxPosition: _3!, unreadCount: _4, unreadMutedCount: _5) - } - else { - return nil - } - } + } @@ -7098,7 +6839,6 @@ public struct Api { break } } - fileprivate static func parse_popularContact(_ reader: BufferReader) -> PopularContact? { var _1: Int64? _1 = reader.readInt64() @@ -7114,6 +6854,7 @@ public struct Api { } } + } public enum ChannelParticipant { @@ -7169,7 +6910,6 @@ public struct Api { break } } - fileprivate static func parse_channelParticipant(_ reader: BufferReader) -> ChannelParticipant? { var _1: Int32? _1 = reader.readInt32() @@ -7266,11 +7006,11 @@ public struct Api { } } + } public enum InputDialogPeer { case inputDialogPeer(peer: Api.InputPeer) - case inputDialogPeerFeed(feedId: Int32) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { @@ -7280,15 +7020,8 @@ public struct Api { } peer.serialize(buffer, true) break - case .inputDialogPeerFeed(let feedId): - if boxed { - buffer.appendInt32(741914831) - } - serializeInt32(feedId, buffer: buffer, boxed: false) - break } } - fileprivate static func parse_inputDialogPeer(_ reader: BufferReader) -> InputDialogPeer? { var _1: Api.InputPeer? if let signature = reader.readInt32() { @@ -7302,17 +7035,7 @@ public struct Api { return nil } } - fileprivate static func parse_inputDialogPeerFeed(_ reader: BufferReader) -> InputDialogPeer? { - var _1: Int32? - _1 = reader.readInt32() - let _c1 = _1 != nil - if _c1 { - return Api.InputDialogPeer.inputDialogPeerFeed(feedId: _1!) - } - else { - return nil - } - } + } @@ -7330,7 +7053,6 @@ public struct Api { break } } - fileprivate static func parse_error(_ reader: BufferReader) -> Error? { var _1: Int32? _1 = reader.readInt32() @@ -7346,6 +7068,7 @@ public struct Api { } } + } public enum KeyboardButton { @@ -7414,7 +7137,6 @@ public struct Api { break } } - fileprivate static func parse_keyboardButton(_ reader: BufferReader) -> KeyboardButton? { var _1: String? _1 = parseString(reader) @@ -7516,6 +7238,7 @@ public struct Api { } } + } public enum ContactStatus { @@ -7532,7 +7255,6 @@ public struct Api { break } } - fileprivate static func parse_contactStatus(_ reader: BufferReader) -> ContactStatus? { var _1: Int32? _1 = reader.readInt32() @@ -7550,6 +7272,7 @@ public struct Api { } } + } public enum SecureFile { @@ -7576,7 +7299,6 @@ public struct Api { break } } - fileprivate static func parse_secureFileEmpty(_ reader: BufferReader) -> SecureFile? { return Api.SecureFile.secureFileEmpty } @@ -7604,6 +7326,7 @@ public struct Api { } } + } public enum PhotoSize { @@ -7641,7 +7364,6 @@ public struct Api { break } } - fileprivate static func parse_photoSizeEmpty(_ reader: BufferReader) -> PhotoSize? { var _1: String? _1 = parseString(reader) @@ -7704,6 +7426,7 @@ public struct Api { } } + } public enum InlineBotSwitchPM { @@ -7720,7 +7443,6 @@ public struct Api { break } } - fileprivate static func parse_inlineBotSwitchPM(_ reader: BufferReader) -> InlineBotSwitchPM? { var _1: String? _1 = parseString(reader) @@ -7736,6 +7458,7 @@ public struct Api { } } + } public enum FileLocation { @@ -7763,7 +7486,6 @@ public struct Api { break } } - fileprivate static func parse_fileLocationUnavailable(_ reader: BufferReader) -> FileLocation? { var _1: Int64? _1 = reader.readInt64() @@ -7802,6 +7524,7 @@ public struct Api { } } + } public enum InputNotifyPeer { @@ -7838,7 +7561,6 @@ public struct Api { break } } - fileprivate static func parse_inputNotifyPeer(_ reader: BufferReader) -> InputNotifyPeer? { var _1: Api.InputPeer? if let signature = reader.readInt32() { @@ -7862,6 +7584,7 @@ public struct Api { return Api.InputNotifyPeer.inputNotifyAll } + } public enum EncryptedMessage { @@ -7891,7 +7614,6 @@ public struct Api { break } } - fileprivate static func parse_encryptedMessage(_ reader: BufferReader) -> EncryptedMessage? { var _1: Int64? _1 = reader.readInt64() @@ -7938,6 +7660,7 @@ public struct Api { } } + } public enum ChannelParticipantsFilter { @@ -7988,7 +7711,6 @@ public struct Api { break } } - fileprivate static func parse_channelParticipantsRecent(_ reader: BufferReader) -> ChannelParticipantsFilter? { return Api.ChannelParticipantsFilter.channelParticipantsRecent } @@ -8032,6 +7754,7 @@ public struct Api { } } + } public enum WebPage { @@ -8086,7 +7809,6 @@ public struct Api { break } } - fileprivate static func parse_webPageEmpty(_ reader: BufferReader) -> WebPage? { var _1: Int64? _1 = reader.readInt64() @@ -8184,6 +7906,7 @@ public struct Api { return Api.WebPage.webPageNotModified } + } public enum InputBotInlineMessage { @@ -8261,7 +7984,6 @@ public struct Api { break } } - fileprivate static func parse_inputBotInlineMessageText(_ reader: BufferReader) -> InputBotInlineMessage? { var _1: Int32? _1 = reader.readInt32() @@ -8406,6 +8128,7 @@ public struct Api { } } + } public enum KeyboardButtonRow { @@ -8425,7 +8148,6 @@ public struct Api { break } } - fileprivate static func parse_keyboardButtonRow(_ reader: BufferReader) -> KeyboardButtonRow? { var _1: [Api.KeyboardButton]? if let _ = reader.readInt32() { @@ -8440,6 +8162,7 @@ public struct Api { } } + } public enum StickerSet { @@ -8462,7 +8185,6 @@ public struct Api { break } } - fileprivate static func parse_stickerSet(_ reader: BufferReader) -> StickerSet? { var _1: Int32? _1 = reader.readInt32() @@ -8496,6 +8218,7 @@ public struct Api { } } + } public enum InputContact { @@ -8514,7 +8237,6 @@ public struct Api { break } } - fileprivate static func parse_inputPhoneContact(_ reader: BufferReader) -> InputContact? { var _1: Int64? _1 = reader.readInt64() @@ -8536,6 +8258,7 @@ public struct Api { } } + } public enum TopPeerCategory { @@ -8586,7 +8309,6 @@ public struct Api { break } } - fileprivate static func parse_topPeerCategoryBotsPM(_ reader: BufferReader) -> TopPeerCategory? { return Api.TopPeerCategory.topPeerCategoryBotsPM } @@ -8606,6 +8328,7 @@ public struct Api { return Api.TopPeerCategory.topPeerCategoryPhoneCalls } + } public enum ChannelMessagesFilter { @@ -8633,7 +8356,6 @@ public struct Api { break } } - fileprivate static func parse_channelMessagesFilterEmpty(_ reader: BufferReader) -> ChannelMessagesFilter? { return Api.ChannelMessagesFilter.channelMessagesFilterEmpty } @@ -8654,6 +8376,7 @@ public struct Api { } } + } public enum InputDocument { @@ -8677,7 +8400,6 @@ public struct Api { break } } - fileprivate static func parse_inputDocumentEmpty(_ reader: BufferReader) -> InputDocument? { return Api.InputDocument.inputDocumentEmpty } @@ -8696,6 +8418,7 @@ public struct Api { } } + } public enum InputMedia { @@ -8848,7 +8571,6 @@ public struct Api { break } } - fileprivate static func parse_inputMediaEmpty(_ reader: BufferReader) -> InputMedia? { return Api.InputMedia.inputMediaEmpty } @@ -9128,6 +8850,7 @@ public struct Api { } } + } public enum InputPeer { @@ -9173,7 +8896,6 @@ public struct Api { break } } - fileprivate static func parse_inputPeerEmpty(_ reader: BufferReader) -> InputPeer? { return Api.InputPeer.inputPeerEmpty } @@ -9220,6 +8942,7 @@ public struct Api { } } + } public enum Contact { @@ -9236,7 +8959,6 @@ public struct Api { break } } - fileprivate static func parse_contact(_ reader: BufferReader) -> Contact? { var _1: Int32? _1 = reader.readInt32() @@ -9254,6 +8976,7 @@ public struct Api { } } + } public enum FileHash { @@ -9271,7 +8994,6 @@ public struct Api { break } } - fileprivate static func parse_fileHash(_ reader: BufferReader) -> FileHash? { var _1: Int32? _1 = reader.readInt32() @@ -9290,6 +9012,7 @@ public struct Api { } } + } public enum BotInlineResult { @@ -9327,7 +9050,6 @@ public struct Api { break } } - fileprivate static func parse_botInlineMediaResult(_ reader: BufferReader) -> BotInlineResult? { var _1: Int32? _1 = reader.readInt32() @@ -9408,43 +9130,6 @@ public struct Api { } } - } - - public enum FeedPosition { - case feedPosition(date: Int32, peer: Api.Peer, id: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .feedPosition(let date, let peer, let id): - if boxed { - buffer.appendInt32(1348066419) - } - serializeInt32(date, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - serializeInt32(id, buffer: buffer, boxed: false) - break - } - } - - fileprivate static func parse_feedPosition(_ reader: BufferReader) -> FeedPosition? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.Peer? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.Peer - } - var _3: Int32? - _3 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.FeedPosition.feedPosition(date: _1!, peer: _2!, id: _3!) - } - else { - return nil - } - } } @@ -9469,7 +9154,6 @@ public struct Api { break } } - fileprivate static func parse_inputSingleMedia(_ reader: BufferReader) -> InputSingleMedia? { var _1: Int32? _1 = reader.readInt32() @@ -9498,6 +9182,7 @@ public struct Api { } } + } public enum InputPrivacyRule { @@ -9556,7 +9241,6 @@ public struct Api { break } } - fileprivate static func parse_inputPrivacyValueAllowContacts(_ reader: BufferReader) -> InputPrivacyRule? { return Api.InputPrivacyRule.inputPrivacyValueAllowContacts } @@ -9596,6 +9280,7 @@ public struct Api { } } + } public enum ChannelAdminLogEventAction { @@ -9724,7 +9409,6 @@ public struct Api { break } } - fileprivate static func parse_channelAdminLogEventActionChangeTitle(_ reader: BufferReader) -> ChannelAdminLogEventAction? { var _1: String? _1 = parseString(reader) @@ -9942,6 +9626,7 @@ public struct Api { } } + } public enum LabeledPrice { @@ -9958,7 +9643,6 @@ public struct Api { break } } - fileprivate static func parse_labeledPrice(_ reader: BufferReader) -> LabeledPrice? { var _1: String? _1 = parseString(reader) @@ -9974,6 +9658,7 @@ public struct Api { } } + } public enum ReportReason { @@ -10010,7 +9695,6 @@ public struct Api { break } } - fileprivate static func parse_inputReportReasonSpam(_ reader: BufferReader) -> ReportReason? { return Api.ReportReason.inputReportReasonSpam } @@ -10032,6 +9716,7 @@ public struct Api { } } + } public enum InputEncryptedChat { @@ -10048,7 +9733,6 @@ public struct Api { break } } - fileprivate static func parse_inputEncryptedChat(_ reader: BufferReader) -> InputEncryptedChat? { var _1: Int32? _1 = reader.readInt32() @@ -10064,9 +9748,10 @@ public struct Api { } } + } - public enum DraftMessage { + public enum DraftMessage : RedactingCustomStringConvertible { case draftMessageEmpty case draftMessage(flags: Int32, replyToMsgId: Int32?, message: String, entities: [Api.MessageEntity]?, date: Int32) @@ -10094,7 +9779,6 @@ public struct Api { break } } - fileprivate static func parse_draftMessageEmpty(_ reader: BufferReader) -> DraftMessage? { return Api.DraftMessage.draftMessageEmpty } @@ -10124,6 +9808,15 @@ public struct Api { } } + public func redactingDescription(_ redact: Swift.Bool) -> String { + switch self { + case .draftMessageEmpty: + return "(draftMessageEmpty)" + case .draftMessage(let flags, let replyToMsgId, let message, let entities, let date): + return "(draftMessage flags: \(flags), replyToMsgId: \(replyToMsgId), message: \(!redact ? message : "~redacted~"), entities: \(entities), date: \(date))" + } + } + } public enum ChannelAdminRights { @@ -10139,7 +9832,6 @@ public struct Api { break } } - fileprivate static func parse_channelAdminRights(_ reader: BufferReader) -> ChannelAdminRights? { var _1: Int32? _1 = reader.readInt32() @@ -10152,6 +9844,7 @@ public struct Api { } } + } public enum EncryptedFile { @@ -10178,7 +9871,6 @@ public struct Api { break } } - fileprivate static func parse_encryptedFileEmpty(_ reader: BufferReader) -> EncryptedFile? { return Api.EncryptedFile.encryptedFileEmpty } @@ -10206,6 +9898,7 @@ public struct Api { } } + } public enum ChannelBannedRights { @@ -10222,7 +9915,6 @@ public struct Api { break } } - fileprivate static func parse_channelBannedRights(_ reader: BufferReader) -> ChannelBannedRights? { var _1: Int32? _1 = reader.readInt32() @@ -10238,6 +9930,7 @@ public struct Api { } } + } public enum NotifyPeer { @@ -10274,7 +9967,6 @@ public struct Api { break } } - fileprivate static func parse_notifyPeer(_ reader: BufferReader) -> NotifyPeer? { var _1: Api.Peer? if let signature = reader.readInt32() { @@ -10298,6 +9990,7 @@ public struct Api { return Api.NotifyPeer.notifyAll } + } public enum InputPrivacyKey { @@ -10327,7 +10020,6 @@ public struct Api { break } } - fileprivate static func parse_inputPrivacyKeyStatusTimestamp(_ reader: BufferReader) -> InputPrivacyKey? { return Api.InputPrivacyKey.inputPrivacyKeyStatusTimestamp } @@ -10338,6 +10030,7 @@ public struct Api { return Api.InputPrivacyKey.inputPrivacyKeyPhoneCall } + } public enum ReplyMarkup { @@ -10383,7 +10076,6 @@ public struct Api { break } } - fileprivate static func parse_replyKeyboardHide(_ reader: BufferReader) -> ReplyMarkup? { var _1: Int32? _1 = reader.readInt32() @@ -10436,6 +10128,7 @@ public struct Api { } } + } public enum HighScore { @@ -10453,7 +10146,6 @@ public struct Api { break } } - fileprivate static func parse_highScore(_ reader: BufferReader) -> HighScore? { var _1: Int32? _1 = reader.readInt32() @@ -10472,6 +10164,7 @@ public struct Api { } } + } public enum TopPeer { @@ -10488,7 +10181,6 @@ public struct Api { break } } - fileprivate static func parse_topPeer(_ reader: BufferReader) -> TopPeer? { var _1: Api.Peer? if let signature = reader.readInt32() { @@ -10506,6 +10198,7 @@ public struct Api { } } + } public enum SecureValue { @@ -10546,7 +10239,6 @@ public struct Api { break } } - fileprivate static func parse_secureValueEmpty(_ reader: BufferReader) -> SecureValue? { var _1: String? _1 = parseString(reader) @@ -10608,6 +10300,7 @@ public struct Api { } } + } public enum ContactBlocked { @@ -10624,7 +10317,6 @@ public struct Api { break } } - fileprivate static func parse_contactBlocked(_ reader: BufferReader) -> ContactBlocked? { var _1: Int32? _1 = reader.readInt32() @@ -10640,6 +10332,7 @@ public struct Api { } } + } public enum InputUser { @@ -10670,7 +10363,6 @@ public struct Api { break } } - fileprivate static func parse_inputUserEmpty(_ reader: BufferReader) -> InputUser? { return Api.InputUser.inputUserEmpty } @@ -10692,6 +10384,7 @@ public struct Api { } } + } public enum Page { @@ -10742,7 +10435,6 @@ public struct Api { break } } - fileprivate static func parse_pagePart(_ reader: BufferReader) -> Page? { var _1: [Api.PageBlock]? if let _ = reader.readInt32() { @@ -10790,6 +10482,7 @@ public struct Api { } } + } public enum MessageRange { @@ -10806,7 +10499,6 @@ public struct Api { break } } - fileprivate static func parse_messageRange(_ reader: BufferReader) -> MessageRange? { var _1: Int32? _1 = reader.readInt32() @@ -10822,6 +10514,7 @@ public struct Api { } } + } public enum Config { @@ -10874,7 +10567,6 @@ public struct Api { break } } - fileprivate static func parse_config(_ reader: BufferReader) -> Config? { var _1: Int32? _1 = reader.readInt32() @@ -10990,6 +10682,7 @@ public struct Api { } } + } public enum TopPeerCategoryPeers { @@ -11011,7 +10704,6 @@ public struct Api { break } } - fileprivate static func parse_topPeerCategoryPeers(_ reader: BufferReader) -> TopPeerCategoryPeers? { var _1: Api.TopPeerCategory? if let signature = reader.readInt32() { @@ -11034,6 +10726,7 @@ public struct Api { } } + } public enum Game { @@ -11056,7 +10749,6 @@ public struct Api { break } } - fileprivate static func parse_game(_ reader: BufferReader) -> Game? { var _1: Int32? _1 = reader.readInt32() @@ -11094,6 +10786,7 @@ public struct Api { } } + } public enum BotCommand { @@ -11110,7 +10803,6 @@ public struct Api { break } } - fileprivate static func parse_botCommand(_ reader: BufferReader) -> BotCommand? { var _1: String? _1 = parseString(reader) @@ -11126,6 +10818,7 @@ public struct Api { } } + } public enum CdnPublicKey { @@ -11142,7 +10835,6 @@ public struct Api { break } } - fileprivate static func parse_cdnPublicKey(_ reader: BufferReader) -> CdnPublicKey? { var _1: Int32? _1 = reader.readInt32() @@ -11158,6 +10850,7 @@ public struct Api { } } + } public enum InputGame { @@ -11182,7 +10875,6 @@ public struct Api { break } } - fileprivate static func parse_inputGameID(_ reader: BufferReader) -> InputGame? { var _1: Int64? _1 = reader.readInt64() @@ -11214,6 +10906,7 @@ public struct Api { } } + } public enum InputMessage { @@ -11243,7 +10936,6 @@ public struct Api { break } } - fileprivate static func parse_inputMessageID(_ reader: BufferReader) -> InputMessage? { var _1: Int32? _1 = reader.readInt32() @@ -11270,6 +10962,7 @@ public struct Api { return Api.InputMessage.inputMessagePinned } + } public enum PhoneCallProtocol { @@ -11287,7 +10980,6 @@ public struct Api { break } } - fileprivate static func parse_phoneCallProtocol(_ reader: BufferReader) -> PhoneCallProtocol? { var _1: Int32? _1 = reader.readInt32() @@ -11306,6 +10998,7 @@ public struct Api { } } + } public enum WallPaper { @@ -11338,7 +11031,6 @@ public struct Api { break } } - fileprivate static func parse_wallPaper(_ reader: BufferReader) -> WallPaper? { var _1: Int32? _1 = reader.readInt32() @@ -11382,6 +11074,7 @@ public struct Api { } } + } public enum Invoice { @@ -11403,7 +11096,6 @@ public struct Api { break } } - fileprivate static func parse_invoice(_ reader: BufferReader) -> Invoice? { var _1: Int32? _1 = reader.readInt32() @@ -11424,6 +11116,7 @@ public struct Api { } } + } public enum PeerSettings { @@ -11439,7 +11132,6 @@ public struct Api { break } } - fileprivate static func parse_peerSettings(_ reader: BufferReader) -> PeerSettings? { var _1: Int32? _1 = reader.readInt32() @@ -11452,6 +11144,7 @@ public struct Api { } } + } public enum InputChatPhoto { @@ -11481,7 +11174,6 @@ public struct Api { break } } - fileprivate static func parse_inputChatPhotoEmpty(_ reader: BufferReader) -> InputChatPhoto? { return Api.InputChatPhoto.inputChatPhotoEmpty } @@ -11512,6 +11204,7 @@ public struct Api { } } + } public enum PaymentCharge { @@ -11528,7 +11221,6 @@ public struct Api { break } } - fileprivate static func parse_paymentCharge(_ reader: BufferReader) -> PaymentCharge? { var _1: String? _1 = parseString(reader) @@ -11544,9 +11236,10 @@ public struct Api { } } + } - public enum Updates { + public enum Updates : RedactingCustomStringConvertible { case updatesTooLong case updateShortMessage(flags: Int32, id: Int32, userId: Int32, message: String, pts: Int32, ptsCount: Int32, date: Int32, fwdFrom: Api.MessageFwdHeader?, viaBotId: Int32?, replyToMsgId: Int32?, entities: [Api.MessageEntity]?) case updateShortChatMessage(flags: Int32, id: Int32, fromId: Int32, chatId: Int32, message: String, pts: Int32, ptsCount: Int32, date: Int32, fwdFrom: Api.MessageFwdHeader?, viaBotId: Int32?, replyToMsgId: Int32?, entities: [Api.MessageEntity]?) @@ -11674,7 +11367,6 @@ public struct Api { break } } - fileprivate static func parse_updatesTooLong(_ reader: BufferReader) -> Updates? { return Api.Updates.updatesTooLong } @@ -11882,6 +11574,25 @@ public struct Api { } } + public func redactingDescription(_ redact: Swift.Bool) -> String { + switch self { + case .updatesTooLong: + return "(updatesTooLong)" + case .updateShortMessage(let flags, let id, let userId, let message, let pts, let ptsCount, let date, let fwdFrom, let viaBotId, let replyToMsgId, let entities): + return "(updateShortMessage flags: \(flags), id: \(id), userId: \(userId), message: \(!redact ? message : "~redacted~"), pts: \(pts), ptsCount: \(ptsCount), date: \(date), fwdFrom: \(fwdFrom), viaBotId: \(viaBotId), replyToMsgId: \(replyToMsgId), entities: \(entities))" + case .updateShortChatMessage(let flags, let id, let fromId, let chatId, let message, let pts, let ptsCount, let date, let fwdFrom, let viaBotId, let replyToMsgId, let entities): + return "(updateShortChatMessage flags: \(flags), id: \(id), fromId: \(fromId), chatId: \(chatId), message: \(!redact ? message : "~redacted~"), pts: \(pts), ptsCount: \(ptsCount), date: \(date), fwdFrom: \(fwdFrom), viaBotId: \(viaBotId), replyToMsgId: \(replyToMsgId), entities: \(entities))" + case .updateShort(let update, let date): + return "(updateShort update: \(update), date: \(date))" + case .updatesCombined(let updates, let users, let chats, let date, let seqStart, let seq): + return "(updatesCombined updates: \(updates), users: \(users), chats: \(chats), date: \(date), seqStart: \(seqStart), seq: \(seq))" + case .updates(let updates, let users, let chats, let date, let seq): + return "(updates updates: \(updates), users: \(users), chats: \(chats), date: \(date), seq: \(seq))" + case .updateShortSentMessage(let flags, let id, let pts, let ptsCount, let date, let media, let entities): + return "(updateShortSentMessage flags: \(flags), id: \(id), pts: \(pts), ptsCount: \(ptsCount), date: \(date), media: \(media), entities: \(entities))" + } + } + } public enum MessageMedia { @@ -11987,7 +11698,6 @@ public struct Api { break } } - fileprivate static func parse_messageMediaEmpty(_ reader: BufferReader) -> MessageMedia? { return Api.MessageMedia.messageMediaEmpty } @@ -12170,6 +11880,7 @@ public struct Api { } } + } public enum PaymentSavedCredentials { @@ -12186,7 +11897,6 @@ public struct Api { break } } - fileprivate static func parse_paymentSavedCredentialsCard(_ reader: BufferReader) -> PaymentSavedCredentials? { var _1: String? _1 = parseString(reader) @@ -12202,6 +11912,7 @@ public struct Api { } } + } public enum Null { @@ -12217,11 +11928,11 @@ public struct Api { break } } - fileprivate static func parse_null(_ reader: BufferReader) -> Null? { return Api.Null.null } + } public enum DocumentAttribute { @@ -12290,7 +12001,6 @@ public struct Api { break } } - fileprivate static func parse_documentAttributeImageSize(_ reader: BufferReader) -> DocumentAttribute? { var _1: Int32? _1 = reader.readInt32() @@ -12390,6 +12100,7 @@ public struct Api { return Api.DocumentAttribute.documentAttributeHasStickers } + } public enum ChatPhoto { @@ -12413,7 +12124,6 @@ public struct Api { break } } - fileprivate static func parse_chatPhotoEmpty(_ reader: BufferReader) -> ChatPhoto? { return Api.ChatPhoto.chatPhotoEmpty } @@ -12436,6 +12146,7 @@ public struct Api { } } + } public enum InputStickerSet { @@ -12466,7 +12177,6 @@ public struct Api { break } } - fileprivate static func parse_inputStickerSetEmpty(_ reader: BufferReader) -> InputStickerSet? { return Api.InputStickerSet.inputStickerSetEmpty } @@ -12496,6 +12206,7 @@ public struct Api { } } + } public enum BotInfo { @@ -12517,7 +12228,6 @@ public struct Api { break } } - fileprivate static func parse_botInfo(_ reader: BufferReader) -> BotInfo? { var _1: Int32? _1 = reader.readInt32() @@ -12538,6 +12248,7 @@ public struct Api { } } + } public enum FoundGif { @@ -12567,7 +12278,6 @@ public struct Api { break } } - fileprivate static func parse_foundGif(_ reader: BufferReader) -> FoundGif? { var _1: String? _1 = parseString(reader) @@ -12616,6 +12326,7 @@ public struct Api { } } + } public enum User { @@ -12650,7 +12361,6 @@ public struct Api { break } } - fileprivate static func parse_userEmpty(_ reader: BufferReader) -> User? { var _1: Int32? _1 = reader.readInt32() @@ -12714,9 +12424,10 @@ public struct Api { } } + } - public enum Message { + public enum Message : RedactingCustomStringConvertible { case messageEmpty(id: Int32) case messageService(flags: Int32, id: Int32, fromId: Int32?, toId: Api.Peer, replyToMsgId: Int32?, date: Int32, action: Api.MessageAction) case message(flags: Int32, id: Int32, fromId: Int32?, toId: Api.Peer, fwdFrom: Api.MessageFwdHeader?, viaBotId: Int32?, replyToMsgId: Int32?, date: Int32, message: String, media: Api.MessageMedia?, replyMarkup: Api.ReplyMarkup?, entities: [Api.MessageEntity]?, views: Int32?, editDate: Int32?, postAuthor: String?, groupedId: Int64?) @@ -12768,7 +12479,6 @@ public struct Api { break } } - fileprivate static func parse_messageEmpty(_ reader: BufferReader) -> Message? { var _1: Int32? _1 = reader.readInt32() @@ -12880,6 +12590,17 @@ public struct Api { } } + public func redactingDescription(_ redact: Swift.Bool) -> String { + switch self { + case .messageEmpty(let id): + return "(messageEmpty id: \(id))" + case .messageService(let flags, let id, let fromId, let toId, let replyToMsgId, let date, let action): + return "(messageService flags: \(flags), id: \(id), fromId: \(fromId), toId: \(toId), replyToMsgId: \(replyToMsgId), date: \(date), action: \(action))" + case .message(let flags, let id, let fromId, let toId, let fwdFrom, let viaBotId, let replyToMsgId, let date, let message, let media, let replyMarkup, let entities, let views, let editDate, let postAuthor, let groupedId): + return "(message flags: \(flags), id: \(id), fromId: \(fromId), toId: \(toId), fwdFrom: \(fwdFrom), viaBotId: \(viaBotId), replyToMsgId: \(replyToMsgId), date: \(date), message: \(!redact ? message : "~redacted~"), media: \(media), replyMarkup: \(replyMarkup), entities: \(entities), views: \(views), editDate: \(editDate), postAuthor: \(postAuthor), groupedId: \(groupedId))" + } + } + } public enum InputFileLocation { @@ -12922,7 +12643,6 @@ public struct Api { break } } - fileprivate static func parse_inputFileLocation(_ reader: BufferReader) -> InputFileLocation? { var _1: Int64? _1 = reader.readInt64() @@ -12986,6 +12706,7 @@ public struct Api { } } + } public enum GeoPoint { @@ -13009,7 +12730,6 @@ public struct Api { break } } - fileprivate static func parse_geoPointEmpty(_ reader: BufferReader) -> GeoPoint? { return Api.GeoPoint.geoPointEmpty } @@ -13028,6 +12748,7 @@ public struct Api { } } + } public enum InputPhoneCall { @@ -13044,7 +12765,6 @@ public struct Api { break } } - fileprivate static func parse_inputPhoneCall(_ reader: BufferReader) -> InputPhoneCall? { var _1: Int64? _1 = reader.readInt64() @@ -13060,6 +12780,7 @@ public struct Api { } } + } public enum ReceivedNotifyMessage { @@ -13076,7 +12797,6 @@ public struct Api { break } } - fileprivate static func parse_receivedNotifyMessage(_ reader: BufferReader) -> ReceivedNotifyMessage? { var _1: Int32? _1 = reader.readInt32() @@ -13092,6 +12812,7 @@ public struct Api { } } + } public enum ChatParticipants { @@ -13122,7 +12843,6 @@ public struct Api { break } } - fileprivate static func parse_chatParticipantsForbidden(_ reader: BufferReader) -> ChatParticipants? { var _1: Int32? _1 = reader.readInt32() @@ -13162,6 +12882,7 @@ public struct Api { } } + } public enum InputPaymentCredentials { @@ -13201,7 +12922,6 @@ public struct Api { break } } - fileprivate static func parse_inputPaymentCredentialsSaved(_ reader: BufferReader) -> InputPaymentCredentials? { var _1: String? _1 = parseString(reader) @@ -13262,6 +12982,7 @@ public struct Api { } } + } public enum ShippingOption { @@ -13283,7 +13004,6 @@ public struct Api { break } } - fileprivate static func parse_shippingOption(_ reader: BufferReader) -> ShippingOption? { var _1: String? _1 = parseString(reader) @@ -13304,6 +13024,7 @@ public struct Api { } } + } public enum InputSecureFile { @@ -13322,7 +13043,6 @@ public struct Api { break } } - fileprivate static func parse_inputSecureFileUploaded(_ reader: BufferReader) -> InputSecureFile? { var _1: Int64? _1 = reader.readInt64() @@ -13344,6 +13064,7 @@ public struct Api { } } + } public enum PostAddress { @@ -13364,7 +13085,6 @@ public struct Api { break } } - fileprivate static func parse_postAddress(_ reader: BufferReader) -> PostAddress? { var _1: String? _1 = parseString(reader) @@ -13392,6 +13112,7 @@ public struct Api { } } + } public enum DataJSON { @@ -13407,7 +13128,6 @@ public struct Api { break } } - fileprivate static func parse_dataJSON(_ reader: BufferReader) -> DataJSON? { var _1: String? _1 = parseString(reader) @@ -13420,6 +13140,7 @@ public struct Api { } } + } public enum InputStickeredMedia { @@ -13442,7 +13163,6 @@ public struct Api { break } } - fileprivate static func parse_inputStickeredMediaPhoto(_ reader: BufferReader) -> InputStickeredMedia? { var _1: Api.InputPhoto? if let signature = reader.readInt32() { @@ -13470,6 +13190,7 @@ public struct Api { } } + } public enum PhoneCallDiscardReason { @@ -13506,7 +13227,6 @@ public struct Api { break } } - fileprivate static func parse_phoneCallDiscardReasonMissed(_ reader: BufferReader) -> PhoneCallDiscardReason? { return Api.PhoneCallDiscardReason.phoneCallDiscardReasonMissed } @@ -13520,6 +13240,7 @@ public struct Api { return Api.PhoneCallDiscardReason.phoneCallDiscardReasonBusy } + } public enum NearestDc { @@ -13537,7 +13258,6 @@ public struct Api { break } } - fileprivate static func parse_nearestDc(_ reader: BufferReader) -> NearestDc? { var _1: String? _1 = parseString(reader) @@ -13556,6 +13276,7 @@ public struct Api { } } + } public enum InputWebDocument { @@ -13578,7 +13299,6 @@ public struct Api { break } } - fileprivate static func parse_inputWebDocument(_ reader: BufferReader) -> InputWebDocument? { var _1: String? _1 = parseString(reader) @@ -13602,6 +13322,7 @@ public struct Api { } } + } public enum ChannelAdminLogEvent { @@ -13620,7 +13341,6 @@ public struct Api { break } } - fileprivate static func parse_channelAdminLogEvent(_ reader: BufferReader) -> ChannelAdminLogEvent? { var _1: Int64? _1 = reader.readInt64() @@ -13644,6 +13364,7 @@ public struct Api { } } + } public enum Bool { @@ -13666,7 +13387,6 @@ public struct Api { break } } - fileprivate static func parse_boolFalse(_ reader: BufferReader) -> Bool? { return Api.Bool.boolFalse } @@ -13674,6 +13394,7 @@ public struct Api { return Api.Bool.boolTrue } + } public enum LangPackString { @@ -13711,7 +13432,6 @@ public struct Api { break } } - fileprivate static func parse_langPackString(_ reader: BufferReader) -> LangPackString? { var _1: String? _1 = parseString(reader) @@ -13770,6 +13490,7 @@ public struct Api { } } + } public enum InputWebFileLocation { @@ -13786,7 +13507,6 @@ public struct Api { break } } - fileprivate static func parse_inputWebFileLocation(_ reader: BufferReader) -> InputWebFileLocation? { var _1: String? _1 = parseString(reader) @@ -13802,6 +13522,7 @@ public struct Api { } } + } public enum MessageFwdHeader { @@ -13824,7 +13545,6 @@ public struct Api { break } } - fileprivate static func parse_messageFwdHeader(_ reader: BufferReader) -> MessageFwdHeader? { var _1: Int32? _1 = reader.readInt32() @@ -13860,6 +13580,7 @@ public struct Api { } } + } public enum MessagesFilter { @@ -13994,7 +13715,6 @@ public struct Api { break } } - fileprivate static func parse_inputMessagesFilterEmpty(_ reader: BufferReader) -> MessagesFilter? { return Api.MessagesFilter.inputMessagesFilterEmpty } @@ -14058,6 +13778,7 @@ public struct Api { return Api.MessagesFilter.inputMessagesFilterContacts } + } public enum BotInlineMessage { @@ -14127,7 +13848,6 @@ public struct Api { break } } - fileprivate static func parse_botInlineMessageText(_ reader: BufferReader) -> BotInlineMessage? { var _1: Int32? _1 = reader.readInt32() @@ -14256,6 +13976,7 @@ public struct Api { } } + } public enum InputPeerNotifySettings { @@ -14273,7 +13994,6 @@ public struct Api { break } } - fileprivate static func parse_inputPeerNotifySettings(_ reader: BufferReader) -> InputPeerNotifySettings? { var _1: Int32? _1 = reader.readInt32() @@ -14292,6 +14012,7 @@ public struct Api { } } + } public enum ExportedChatInvite { @@ -14314,7 +14035,6 @@ public struct Api { break } } - fileprivate static func parse_chatInviteEmpty(_ reader: BufferReader) -> ExportedChatInvite? { return Api.ExportedChatInvite.chatInviteEmpty } @@ -14330,6 +14050,7 @@ public struct Api { } } + } public enum Authorization { @@ -14357,7 +14078,6 @@ public struct Api { break } } - fileprivate static func parse_authorization(_ reader: BufferReader) -> Authorization? { var _1: Int64? _1 = reader.readInt64() @@ -14406,6 +14126,7 @@ public struct Api { } } + } public enum MaskCoords { @@ -14424,7 +14145,6 @@ public struct Api { break } } - fileprivate static func parse_maskCoords(_ reader: BufferReader) -> MaskCoords? { var _1: Int32? _1 = reader.readInt32() @@ -14446,6 +14166,7 @@ public struct Api { } } + } public enum PhoneConnection { @@ -14465,7 +14186,6 @@ public struct Api { break } } - fileprivate static func parse_phoneConnection(_ reader: BufferReader) -> PhoneConnection? { var _1: Int64? _1 = reader.readInt64() @@ -14490,6 +14210,7 @@ public struct Api { } } + } public enum AccountDaysTTL { @@ -14505,7 +14226,6 @@ public struct Api { break } } - fileprivate static func parse_accountDaysTTL(_ reader: BufferReader) -> AccountDaysTTL? { var _1: Int32? _1 = reader.readInt32() @@ -14518,6 +14238,7 @@ public struct Api { } } + } public enum InputBotInlineResult { @@ -14573,7 +14294,6 @@ public struct Api { break } } - fileprivate static func parse_inputBotInlineResultPhoto(_ reader: BufferReader) -> InputBotInlineResult? { var _1: String? _1 = parseString(reader) @@ -14692,6 +14412,7 @@ public struct Api { } } + } public enum AuthorizationField { @@ -14727,7 +14448,6 @@ public struct Api { break } } - fileprivate static func parse_authorizationFieldText(_ reader: BufferReader) -> AuthorizationField? { var _1: Int32? _1 = reader.readInt32() @@ -14786,6 +14506,7 @@ public struct Api { } } + } public enum PrivacyRule { @@ -14844,7 +14565,6 @@ public struct Api { break } } - fileprivate static func parse_privacyValueAllowContacts(_ reader: BufferReader) -> PrivacyRule? { return Api.PrivacyRule.privacyValueAllowContacts } @@ -14884,6 +14604,7 @@ public struct Api { } } + } public enum MessageAction { @@ -15053,7 +14774,6 @@ public struct Api { break } } - fileprivate static func parse_messageActionEmpty(_ reader: BufferReader) -> MessageAction? { return Api.MessageAction.messageActionEmpty } @@ -15286,6 +15006,7 @@ public struct Api { } } + } public enum PhoneCall { @@ -15372,7 +15093,6 @@ public struct Api { break } } - fileprivate static func parse_phoneCallEmpty(_ reader: BufferReader) -> PhoneCall? { var _1: Int64? _1 = reader.readInt64() @@ -15550,6 +15270,7 @@ public struct Api { } } + } public enum PeerNotifyEvents { @@ -15572,7 +15293,6 @@ public struct Api { break } } - fileprivate static func parse_peerNotifyEventsEmpty(_ reader: BufferReader) -> PeerNotifyEvents? { return Api.PeerNotifyEvents.peerNotifyEventsEmpty } @@ -15580,11 +15300,11 @@ public struct Api { return Api.PeerNotifyEvents.peerNotifyEventsAll } + } public enum DialogPeer { case dialogPeer(peer: Api.Peer) - case dialogPeerFeed(feedId: Int32) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { @@ -15594,15 +15314,8 @@ public struct Api { } peer.serialize(buffer, true) break - case .dialogPeerFeed(let feedId): - if boxed { - buffer.appendInt32(-633170927) - } - serializeInt32(feedId, buffer: buffer, boxed: false) - break } } - fileprivate static func parse_dialogPeer(_ reader: BufferReader) -> DialogPeer? { var _1: Api.Peer? if let signature = reader.readInt32() { @@ -15616,17 +15329,7 @@ public struct Api { return nil } } - fileprivate static func parse_dialogPeerFeed(_ reader: BufferReader) -> DialogPeer? { - var _1: Int32? - _1 = reader.readInt32() - let _c1 = _1 != nil - if _c1 { - return Api.DialogPeer.dialogPeerFeed(feedId: _1!) - } - else { - return nil - } - } + } @@ -15664,7 +15367,6 @@ public struct Api { break } } - fileprivate static func parse_contactLinkUnknown(_ reader: BufferReader) -> ContactLink? { return Api.ContactLink.contactLinkUnknown } @@ -15678,6 +15380,7 @@ public struct Api { return Api.ContactLink.contactLinkContact } + } public enum WebDocument { @@ -15716,7 +15419,6 @@ public struct Api { break } } - fileprivate static func parse_webDocument(_ reader: BufferReader) -> WebDocument? { var _1: String? _1 = parseString(reader) @@ -15768,6 +15470,7 @@ public struct Api { } } + } public enum ChannelAdminLogEventsFilter { @@ -15783,7 +15486,6 @@ public struct Api { break } } - fileprivate static func parse_channelAdminLogEventsFilter(_ reader: BufferReader) -> ChannelAdminLogEventsFilter? { var _1: Int32? _1 = reader.readInt32() @@ -15796,6 +15498,7 @@ public struct Api { } } + } public enum PeerNotifySettings { @@ -15820,7 +15523,6 @@ public struct Api { break } } - fileprivate static func parse_peerNotifySettingsEmpty(_ reader: BufferReader) -> PeerNotifySettings? { return Api.PeerNotifySettings.peerNotifySettingsEmpty } @@ -15842,6 +15544,7 @@ public struct Api { } } + } public enum InputBotInlineMessageID { @@ -15859,7 +15562,6 @@ public struct Api { break } } - fileprivate static func parse_inputBotInlineMessageID(_ reader: BufferReader) -> InputBotInlineMessageID? { var _1: Int32? _1 = reader.readInt32() @@ -15878,6 +15580,7 @@ public struct Api { } } + } public enum StickerPack { @@ -15898,7 +15601,6 @@ public struct Api { break } } - fileprivate static func parse_stickerPack(_ reader: BufferReader) -> StickerPack? { var _1: String? _1 = parseString(reader) @@ -15916,6 +15618,7 @@ public struct Api { } } + } public enum UserProfilePhoto { @@ -15940,7 +15643,6 @@ public struct Api { break } } - fileprivate static func parse_userProfilePhotoEmpty(_ reader: BufferReader) -> UserProfilePhoto? { return Api.UserProfilePhoto.userProfilePhotoEmpty } @@ -15966,6 +15668,7 @@ public struct Api { } } + } public enum InputAppEvent { @@ -15984,7 +15687,6 @@ public struct Api { break } } - fileprivate static func parse_inputAppEvent(_ reader: BufferReader) -> InputAppEvent? { var _1: Double? _1 = reader.readDouble() @@ -16006,6 +15708,7 @@ public struct Api { } } + } public enum MessageEntity { @@ -16138,7 +15841,6 @@ public struct Api { break } } - fileprivate static func parse_messageEntityUnknown(_ reader: BufferReader) -> MessageEntity? { var _1: Int32? _1 = reader.readInt32() @@ -16364,6 +16066,7 @@ public struct Api { } } + } public enum InputPhoto { @@ -16387,7 +16090,6 @@ public struct Api { break } } - fileprivate static func parse_inputPhotoEmpty(_ reader: BufferReader) -> InputPhoto? { return Api.InputPhoto.inputPhotoEmpty } @@ -16406,6 +16108,7 @@ public struct Api { } } + } public enum EncryptedChat { @@ -16464,7 +16167,6 @@ public struct Api { break } } - fileprivate static func parse_encryptedChatEmpty(_ reader: BufferReader) -> EncryptedChat? { var _1: Int32? _1 = reader.readInt32() @@ -16566,6 +16268,7 @@ public struct Api { } } + } public enum Document { @@ -16600,7 +16303,6 @@ public struct Api { break } } - fileprivate static func parse_documentEmpty(_ reader: BufferReader) -> Document? { var _1: Int64? _1 = reader.readInt64() @@ -16652,6 +16354,7 @@ public struct Api { } } + } public enum WebAuthorization { @@ -16675,7 +16378,6 @@ public struct Api { break } } - fileprivate static func parse_webAuthorization(_ reader: BufferReader) -> WebAuthorization? { var _1: Int64? _1 = reader.readInt64() @@ -16712,6 +16414,7 @@ public struct Api { } } + } public enum ImportedContact { @@ -16728,7 +16431,6 @@ public struct Api { break } } - fileprivate static func parse_importedContact(_ reader: BufferReader) -> ImportedContact? { var _1: Int32? _1 = reader.readInt32() @@ -16744,6 +16446,7 @@ public struct Api { } } + } public struct channels { @@ -16777,7 +16480,6 @@ public struct Api { break } } - fileprivate static func parse_channelParticipants(_ reader: BufferReader) -> ChannelParticipants? { var _1: Int32? _1 = reader.readInt32() @@ -16803,6 +16505,7 @@ public struct Api { return Api.channels.ChannelParticipants.channelParticipantsNotModified } + } public enum ChannelParticipant { @@ -16823,7 +16526,6 @@ public struct Api { break } } - fileprivate static func parse_channelParticipant(_ reader: BufferReader) -> ChannelParticipant? { var _1: Api.ChannelParticipant? if let signature = reader.readInt32() { @@ -16843,77 +16545,6 @@ public struct Api { } } - } - - public enum FeedSources { - case feedSourcesNotModified - case feedSources(flags: Int32, newlyJoinedFeed: Int32?, feeds: [Api.FeedBroadcasts], chats: [Api.Chat], users: [Api.User]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .feedSourcesNotModified: - if boxed { - buffer.appendInt32(-2001655273) - } - - break - case .feedSources(let flags, let newlyJoinedFeed, let feeds, let chats, let users): - if boxed { - buffer.appendInt32(-1903441347) - } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeInt32(newlyJoinedFeed!, buffer: buffer, boxed: false)} - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(feeds.count)) - for item in feeds { - 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 - } - } - - fileprivate static func parse_feedSourcesNotModified(_ reader: BufferReader) -> FeedSources? { - return Api.channels.FeedSources.feedSourcesNotModified - } - fileprivate static func parse_feedSources(_ reader: BufferReader) -> FeedSources? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - if Int(_1!) & Int(1 << 0) != 0 {_2 = reader.readInt32() } - var _3: [Api.FeedBroadcasts]? - if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.FeedBroadcasts.self) - } - var _4: [Api.Chat]? - if let _ = reader.readInt32() { - _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) - } - var _5: [Api.User]? - if let _ = reader.readInt32() { - _5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) - } - let _c1 = _1 != nil - let _c2 = (Int(_1!) & Int(1 << 0) == 0) || _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.channels.FeedSources.feedSources(flags: _1!, newlyJoinedFeed: _2, feeds: _3!, chats: _4!, users: _5!) - } - else { - return nil - } - } } @@ -16944,7 +16575,6 @@ public struct Api { break } } - fileprivate static func parse_adminLogResults(_ reader: BufferReader) -> AdminLogResults? { var _1: [Api.ChannelAdminLogEvent]? if let _ = reader.readInt32() { @@ -16969,6 +16599,7 @@ public struct Api { } } + } } @@ -16992,7 +16623,6 @@ public struct Api { break } } - fileprivate static func parse_validatedRequestedInfo(_ reader: BufferReader) -> ValidatedRequestedInfo? { var _1: Int32? _1 = reader.readInt32() @@ -17013,6 +16643,7 @@ public struct Api { } } + } public enum PaymentResult { @@ -17035,7 +16666,6 @@ public struct Api { break } } - fileprivate static func parse_paymentResult(_ reader: BufferReader) -> PaymentResult? { var _1: Api.Updates? if let signature = reader.readInt32() { @@ -17061,6 +16691,7 @@ public struct Api { } } + } public enum PaymentForm { @@ -17089,7 +16720,6 @@ public struct Api { break } } - fileprivate static func parse_paymentForm(_ reader: BufferReader) -> PaymentForm? { var _1: Int32? _1 = reader.readInt32() @@ -17139,6 +16769,7 @@ public struct Api { } } + } public enum PaymentReceipt { @@ -17168,7 +16799,6 @@ public struct Api { break } } - fileprivate static func parse_paymentReceipt(_ reader: BufferReader) -> PaymentReceipt? { var _1: Int32? _1 = reader.readInt32() @@ -17219,6 +16849,7 @@ public struct Api { } } + } public enum SavedInfo { @@ -17235,7 +16866,6 @@ public struct Api { break } } - fileprivate static func parse_savedInfo(_ reader: BufferReader) -> SavedInfo? { var _1: Int32? _1 = reader.readInt32() @@ -17253,6 +16883,7 @@ public struct Api { } } + } } @@ -17272,7 +16903,6 @@ public struct Api { break } } - fileprivate static func parse_authorization(_ reader: BufferReader) -> Authorization? { var _1: Int32? _1 = reader.readInt32() @@ -17293,6 +16923,7 @@ public struct Api { } } + } public enum PasswordRecovery { @@ -17308,7 +16939,6 @@ public struct Api { break } } - fileprivate static func parse_passwordRecovery(_ reader: BufferReader) -> PasswordRecovery? { var _1: String? _1 = parseString(reader) @@ -17321,6 +16951,7 @@ public struct Api { } } + } public enum ExportedAuthorization { @@ -17337,7 +16968,6 @@ public struct Api { break } } - fileprivate static func parse_exportedAuthorization(_ reader: BufferReader) -> ExportedAuthorization? { var _1: Int32? _1 = reader.readInt32() @@ -17353,6 +16983,7 @@ public struct Api { } } + } public enum CheckedPhone { @@ -17368,7 +16999,6 @@ public struct Api { break } } - fileprivate static func parse_checkedPhone(_ reader: BufferReader) -> CheckedPhone? { var _1: Api.Bool? if let signature = reader.readInt32() { @@ -17383,6 +17013,7 @@ public struct Api { } } + } public enum SentCode { @@ -17402,7 +17033,6 @@ public struct Api { break } } - fileprivate static func parse_sentCode(_ reader: BufferReader) -> SentCode? { var _1: Int32? _1 = reader.readInt32() @@ -17431,6 +17061,7 @@ public struct Api { } } + } public enum CodeType { @@ -17460,7 +17091,6 @@ public struct Api { break } } - fileprivate static func parse_codeTypeSms(_ reader: BufferReader) -> CodeType? { return Api.auth.CodeType.codeTypeSms } @@ -17471,6 +17101,7 @@ public struct Api { return Api.auth.CodeType.codeTypeFlashCall } + } public enum SentCodeType { @@ -17507,7 +17138,6 @@ public struct Api { break } } - fileprivate static func parse_sentCodeTypeApp(_ reader: BufferReader) -> SentCodeType? { var _1: Int32? _1 = reader.readInt32() @@ -17553,6 +17183,7 @@ public struct Api { } } + } } @@ -17596,7 +17227,6 @@ public struct Api { break } } - fileprivate static func parse_blocked(_ reader: BufferReader) -> Blocked? { var _1: [Api.ContactBlocked]? if let _ = reader.readInt32() { @@ -17637,6 +17267,7 @@ public struct Api { } } + } public enum Contacts { @@ -17669,7 +17300,6 @@ public struct Api { break } } - fileprivate static func parse_contactsNotModified(_ reader: BufferReader) -> Contacts? { return Api.contacts.Contacts.contactsNotModified } @@ -17695,6 +17325,7 @@ public struct Api { } } + } public enum ResolvedPeer { @@ -17720,7 +17351,6 @@ public struct Api { break } } - fileprivate static func parse_resolvedPeer(_ reader: BufferReader) -> ResolvedPeer? { var _1: Api.Peer? if let signature = reader.readInt32() { @@ -17745,6 +17375,7 @@ public struct Api { } } + } public enum Link { @@ -17762,7 +17393,6 @@ public struct Api { break } } - fileprivate static func parse_link(_ reader: BufferReader) -> Link? { var _1: Api.ContactLink? if let signature = reader.readInt32() { @@ -17787,6 +17417,7 @@ public struct Api { } } + } public enum ImportedContacts { @@ -17821,7 +17452,6 @@ public struct Api { break } } - fileprivate static func parse_importedContacts(_ reader: BufferReader) -> ImportedContacts? { var _1: [Api.ImportedContact]? if let _ = reader.readInt32() { @@ -17851,6 +17481,7 @@ public struct Api { } } + } public enum Found { @@ -17885,7 +17516,6 @@ public struct Api { break } } - fileprivate static func parse_found(_ reader: BufferReader) -> Found? { var _1: [Api.Peer]? if let _ = reader.readInt32() { @@ -17915,6 +17545,7 @@ public struct Api { } } + } public enum TopPeers { @@ -17951,7 +17582,6 @@ public struct Api { break } } - fileprivate static func parse_topPeersNotModified(_ reader: BufferReader) -> TopPeers? { return Api.contacts.TopPeers.topPeersNotModified } @@ -17979,6 +17609,7 @@ public struct Api { } } + } } @@ -18006,7 +17637,6 @@ public struct Api { break } } - fileprivate static func parse_appUpdate(_ reader: BufferReader) -> AppUpdate? { var _1: Int32? _1 = reader.readInt32() @@ -18033,6 +17663,7 @@ public struct Api { return Api.help.AppUpdate.noAppUpdate } + } public enum TermsOfService { @@ -18048,7 +17679,6 @@ public struct Api { break } } - fileprivate static func parse_termsOfService(_ reader: BufferReader) -> TermsOfService? { var _1: String? _1 = parseString(reader) @@ -18061,6 +17691,7 @@ public struct Api { } } + } public enum RecentMeUrls { @@ -18090,7 +17721,6 @@ public struct Api { break } } - fileprivate static func parse_recentMeUrls(_ reader: BufferReader) -> RecentMeUrls? { var _1: [Api.RecentMeUrl]? if let _ = reader.readInt32() { @@ -18115,6 +17745,7 @@ public struct Api { } } + } public enum Support { @@ -18131,7 +17762,6 @@ public struct Api { break } } - fileprivate static func parse_support(_ reader: BufferReader) -> Support? { var _1: String? _1 = parseString(reader) @@ -18149,6 +17779,7 @@ public struct Api { } } + } public enum InviteText { @@ -18164,7 +17795,6 @@ public struct Api { break } } - fileprivate static func parse_inviteText(_ reader: BufferReader) -> InviteText? { var _1: String? _1 = parseString(reader) @@ -18177,6 +17807,7 @@ public struct Api { } } + } } @@ -18266,7 +17897,6 @@ public struct Api { break } } - fileprivate static func parse_differenceEmpty(_ reader: BufferReader) -> Difference? { var _1: Int32? _1 = reader.readInt32() @@ -18369,6 +17999,7 @@ public struct Api { } } + } public enum State { @@ -18388,7 +18019,6 @@ public struct Api { break } } - fileprivate static func parse_state(_ reader: BufferReader) -> State? { var _1: Int32? _1 = reader.readInt32() @@ -18413,6 +18043,7 @@ public struct Api { } } + } public enum ChannelDifference { @@ -18488,7 +18119,6 @@ public struct Api { break } } - fileprivate static func parse_channelDifferenceEmpty(_ reader: BufferReader) -> ChannelDifference? { var _1: Int32? _1 = reader.readInt32() @@ -18591,6 +18221,7 @@ public struct Api { } } + } } @@ -18612,7 +18243,6 @@ public struct Api { break } } - fileprivate static func parse_webFile(_ reader: BufferReader) -> WebFile? { var _1: Int32? _1 = reader.readInt32() @@ -18639,6 +18269,7 @@ public struct Api { } } + } public enum File { @@ -18671,7 +18302,6 @@ public struct Api { break } } - fileprivate static func parse_file(_ reader: BufferReader) -> File? { var _1: Api.storage.FileType? if let signature = reader.readInt32() { @@ -18717,6 +18347,7 @@ public struct Api { } } + } public enum CdnFile { @@ -18739,7 +18370,6 @@ public struct Api { break } } - fileprivate static func parse_cdnFileReuploadNeeded(_ reader: BufferReader) -> CdnFile? { var _1: Buffer? _1 = parseBytes(reader) @@ -18763,6 +18393,7 @@ public struct Api { } } + } } @@ -18843,7 +18474,6 @@ public struct Api { break } } - fileprivate static func parse_fileUnknown(_ reader: BufferReader) -> FileType? { return Api.storage.FileType.fileUnknown } @@ -18875,6 +18505,7 @@ public struct Api { return Api.storage.FileType.fileWebp } + } } @@ -18893,7 +18524,6 @@ public struct Api { break } } - fileprivate static func parse_tmpPassword(_ reader: BufferReader) -> TmpPassword? { var _1: Buffer? _1 = parseBytes(reader) @@ -18909,6 +18539,7 @@ public struct Api { } } + } public enum PasswordSettings { @@ -18924,7 +18555,6 @@ public struct Api { break } } - fileprivate static func parse_passwordSettings(_ reader: BufferReader) -> PasswordSettings? { var _1: String? _1 = parseString(reader) @@ -18937,6 +18567,7 @@ public struct Api { } } + } public enum AuthorizationResult { @@ -18954,7 +18585,6 @@ public struct Api { break } } - fileprivate static func parse_authorizationResult(_ reader: BufferReader) -> AuthorizationResult? { var _1: Int32? _1 = reader.readInt32() @@ -18975,6 +18605,7 @@ public struct Api { } } + } public enum PasswordInputSettings { @@ -18994,7 +18625,6 @@ public struct Api { break } } - fileprivate static func parse_passwordInputSettings(_ reader: BufferReader) -> PasswordInputSettings? { var _1: Int32? _1 = reader.readInt32() @@ -19019,6 +18649,7 @@ public struct Api { } } + } public enum WebAuthorizations { @@ -19043,7 +18674,6 @@ public struct Api { break } } - fileprivate static func parse_webAuthorizations(_ reader: BufferReader) -> WebAuthorizations? { var _1: [Api.WebAuthorization]? if let _ = reader.readInt32() { @@ -19063,6 +18693,7 @@ public struct Api { } } + } public enum Authorizations { @@ -19082,7 +18713,6 @@ public struct Api { break } } - fileprivate static func parse_authorizations(_ reader: BufferReader) -> Authorizations? { var _1: [Api.Authorization]? if let _ = reader.readInt32() { @@ -19097,6 +18727,7 @@ public struct Api { } } + } public enum AuthorizationForm { @@ -19123,7 +18754,6 @@ public struct Api { break } } - fileprivate static func parse_authorizationForm(_ reader: BufferReader) -> AuthorizationForm? { var _1: Int32? _1 = reader.readInt32() @@ -19149,6 +18779,7 @@ public struct Api { } } + } public enum Password { @@ -19176,7 +18807,6 @@ public struct Api { break } } - fileprivate static func parse_noPassword(_ reader: BufferReader) -> Password? { var _1: Buffer? _1 = parseBytes(reader) @@ -19217,6 +18847,7 @@ public struct Api { } } + } public enum PrivacyRules { @@ -19241,7 +18872,6 @@ public struct Api { break } } - fileprivate static func parse_privacyRules(_ reader: BufferReader) -> PrivacyRules? { var _1: [Api.PrivacyRule]? if let _ = reader.readInt32() { @@ -19261,6 +18891,7 @@ public struct Api { } } + } } @@ -19283,7 +18914,6 @@ public struct Api { break } } - fileprivate static func parse_photo(_ reader: BufferReader) -> Photo? { var _1: Api.Photo? if let signature = reader.readInt32() { @@ -19303,6 +18933,7 @@ public struct Api { } } + } public enum Photos { @@ -19344,7 +18975,6 @@ public struct Api { break } } - fileprivate static func parse_photos(_ reader: BufferReader) -> Photos? { var _1: [Api.Photo]? if let _ = reader.readInt32() { @@ -19385,6 +19015,7 @@ public struct Api { } } + } } @@ -19407,7 +19038,6 @@ public struct Api { break } } - fileprivate static func parse_phoneCall(_ reader: BufferReader) -> PhoneCall? { var _1: Api.PhoneCall? if let signature = reader.readInt32() { @@ -19427,11 +19057,30 @@ public struct Api { } } + } } public struct functions { public struct messages { + public static func getDialogs(flags: Int32, offsetDate: Int32, offsetId: Int32, offsetPeer: Api.InputPeer, limit: Int32) -> (CustomStringConvertible, Buffer, (Buffer) -> Api.messages.Dialogs?) { + let buffer = Buffer() + buffer.appendInt32(421243333) + serializeInt32(flags, buffer: buffer, boxed: false) + serializeInt32(offsetDate, buffer: buffer, boxed: false) + serializeInt32(offsetId, buffer: buffer, boxed: false) + offsetPeer.serialize(buffer, true) + serializeInt32(limit, buffer: buffer, boxed: false) + return (FunctionDescription({return "(messages.getDialogs flags: \(flags), offsetDate: \(offsetDate), offsetId: \(offsetId), offsetPeer: \(offsetPeer), limit: \(limit))"}), buffer, { (buffer: Buffer) -> Api.messages.Dialogs? in + let reader = BufferReader(buffer) + var result: Api.messages.Dialogs? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.Dialogs + } + return result + }) + } + public static func getHistory(peer: Api.InputPeer, offsetId: Int32, offsetDate: Int32, addOffset: Int32, limit: Int32, maxId: Int32, minId: Int32, hash: Int32) -> (CustomStringConvertible, Buffer, (Buffer) -> Api.messages.Messages?) { let buffer = Buffer() buffer.appendInt32(-591691168) @@ -20999,22 +20648,6 @@ public struct Api { }) } - public static func getStickers(flags: Int32, emoticon: String, hash: String) -> (CustomStringConvertible, Buffer, (Buffer) -> Api.messages.Stickers?) { - let buffer = Buffer() - buffer.appendInt32(-2050272894) - serializeInt32(flags, buffer: buffer, boxed: false) - serializeString(emoticon, buffer: buffer, boxed: false) - serializeString(hash, buffer: buffer, boxed: false) - return (FunctionDescription({return "(messages.getStickers flags: \(flags), emoticon: \(emoticon), hash: \(hash))"}), buffer, { (buffer: Buffer) -> Api.messages.Stickers? in - let reader = BufferReader(buffer) - var result: Api.messages.Stickers? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.Stickers - } - return result - }) - } - public static func searchStickerSets(flags: Int32, q: String, hash: Int32) -> (CustomStringConvertible, Buffer, (Buffer) -> Api.messages.FoundStickerSets?) { let buffer = Buffer() buffer.appendInt32(-1028140917) @@ -21031,20 +20664,17 @@ public struct Api { }) } - public static func getDialogs(flags: Int32, feedId: Int32?, offsetDate: Int32, offsetId: Int32, offsetPeer: Api.InputPeer, limit: Int32) -> (CustomStringConvertible, Buffer, (Buffer) -> Api.messages.Dialogs?) { + public static func getStickers(flags: Int32, emoticon: String, hash: Int32) -> (CustomStringConvertible, Buffer, (Buffer) -> Api.messages.Stickers?) { let buffer = Buffer() - buffer.appendInt32(96533218) + buffer.appendInt32(-1728024005) serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 1) != 0 {serializeInt32(feedId!, buffer: buffer, boxed: false)} - serializeInt32(offsetDate, buffer: buffer, boxed: false) - serializeInt32(offsetId, buffer: buffer, boxed: false) - offsetPeer.serialize(buffer, true) - serializeInt32(limit, buffer: buffer, boxed: false) - return (FunctionDescription({return "(messages.getDialogs flags: \(flags), feedId: \(String(describing: feedId)), offsetDate: \(offsetDate), offsetId: \(offsetId), offsetPeer: \(offsetPeer), limit: \(limit))"}), buffer, { (buffer: Buffer) -> Api.messages.Dialogs? in + serializeString(emoticon, buffer: buffer, boxed: false) + serializeInt32(hash, buffer: buffer, boxed: false) + return (FunctionDescription({return "(messages.getStickers flags: \(flags), emoticon: \(emoticon), hash: \(hash))"}), buffer, { (buffer: Buffer) -> Api.messages.Stickers? in let reader = BufferReader(buffer) - var result: Api.messages.Dialogs? + var result: Api.messages.Stickers? if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.Dialogs + result = Api.parse(reader, signature: signature) as? Api.messages.Stickers } return result }) @@ -21582,114 +21212,6 @@ public struct Api { return result }) } - - public static func getFeed(flags: Int32, feedId: Int32, offsetPosition: Api.FeedPosition?, addOffset: Int32, limit: Int32, maxPosition: Api.FeedPosition?, minPosition: Api.FeedPosition?, hash: Int32) -> (CustomStringConvertible, Buffer, (Buffer) -> Api.messages.FeedMessages?) { - let buffer = Buffer() - buffer.appendInt32(194049104) - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt32(feedId, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {offsetPosition!.serialize(buffer, true)} - serializeInt32(addOffset, buffer: buffer, boxed: false) - serializeInt32(limit, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 1) != 0 {maxPosition!.serialize(buffer, true)} - if Int(flags) & Int(1 << 2) != 0 {minPosition!.serialize(buffer, true)} - serializeInt32(hash, buffer: buffer, boxed: false) - return (FunctionDescription({return "(channels.getFeed flags: \(flags), feedId: \(feedId), offsetPosition: \(String(describing: offsetPosition)), addOffset: \(addOffset), limit: \(limit), maxPosition: \(String(describing: maxPosition)), minPosition: \(String(describing: minPosition)), hash: \(hash))"}), buffer, { (buffer: Buffer) -> Api.messages.FeedMessages? in - let reader = BufferReader(buffer) - var result: Api.messages.FeedMessages? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.FeedMessages - } - return result - }) - } - - public static func searchFeed(feedId: Int32, q: String, offsetDate: Int32, offsetPeer: Api.InputPeer, offsetId: Int32, limit: Int32) -> (CustomStringConvertible, Buffer, (Buffer) -> Api.messages.Messages?) { - let buffer = Buffer() - buffer.appendInt32(-2009967767) - serializeInt32(feedId, buffer: buffer, boxed: false) - serializeString(q, buffer: buffer, boxed: false) - serializeInt32(offsetDate, buffer: buffer, boxed: false) - offsetPeer.serialize(buffer, true) - serializeInt32(offsetId, buffer: buffer, boxed: false) - serializeInt32(limit, buffer: buffer, boxed: false) - return (FunctionDescription({return "(channels.searchFeed feedId: \(feedId), q: \(q), offsetDate: \(offsetDate), offsetPeer: \(offsetPeer), offsetId: \(offsetId), limit: \(limit))"}), buffer, { (buffer: Buffer) -> Api.messages.Messages? in - let reader = BufferReader(buffer) - var result: Api.messages.Messages? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.Messages - } - return result - }) - } - - public static func getFeedSources(flags: Int32, feedId: Int32?, hash: Int32) -> (CustomStringConvertible, Buffer, (Buffer) -> Api.channels.FeedSources?) { - let buffer = Buffer() - buffer.appendInt32(-657579154) - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeInt32(feedId!, buffer: buffer, boxed: false)} - serializeInt32(hash, buffer: buffer, boxed: false) - return (FunctionDescription({return "(channels.getFeedSources flags: \(flags), feedId: \(String(describing: feedId)), hash: \(hash))"}), buffer, { (buffer: Buffer) -> Api.channels.FeedSources? in - let reader = BufferReader(buffer) - var result: Api.channels.FeedSources? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.channels.FeedSources - } - return result - }) - } - - public static func changeFeedBroadcast(flags: Int32, channel: Api.InputChannel, feedId: Int32?) -> (CustomStringConvertible, Buffer, (Buffer) -> Api.Updates?) { - let buffer = Buffer() - buffer.appendInt32(-5016303) - serializeInt32(flags, buffer: buffer, boxed: false) - channel.serialize(buffer, true) - if Int(flags) & Int(1 << 0) != 0 {serializeInt32(feedId!, buffer: buffer, boxed: false)} - return (FunctionDescription({return "(channels.changeFeedBroadcast flags: \(flags), channel: \(channel), feedId: \(String(describing: feedId)))"}), buffer, { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } - - public static func setFeedBroadcasts(flags: Int32, feedId: Int32, channels: [Api.InputChannel]?, alsoNewlyJoined: Api.Bool?) -> (CustomStringConvertible, Buffer, (Buffer) -> Api.Updates?) { - let buffer = Buffer() - buffer.appendInt32(-360661074) - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt32(feedId, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(channels!.count)) - for item in channels! { - item.serialize(buffer, true) - }} - if Int(flags) & Int(1 << 1) != 0 {alsoNewlyJoined!.serialize(buffer, true)} - return (FunctionDescription({return "(channels.setFeedBroadcasts flags: \(flags), feedId: \(feedId), channels: \(String(describing: channels)), alsoNewlyJoined: \(String(describing: alsoNewlyJoined)))"}), buffer, { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } - - public static func readFeed(feedId: Int32, maxPosition: Api.FeedPosition) -> (CustomStringConvertible, Buffer, (Buffer) -> Api.Updates?) { - let buffer = Buffer() - buffer.appendInt32(163774749) - serializeInt32(feedId, buffer: buffer, boxed: false) - maxPosition.serialize(buffer, true) - return (FunctionDescription({return "(channels.readFeed feedId: \(feedId), maxPosition: \(maxPosition))"}), buffer, { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } } public struct payments { public static func getPaymentForm(msgId: Int32) -> (CustomStringConvertible, Buffer, (Buffer) -> Api.payments.PaymentForm?) { diff --git a/TelegramCore/ApiGroupOrChannel.swift b/TelegramCore/ApiGroupOrChannel.swift index 2bdb6db61a..3e51d4d013 100644 --- a/TelegramCore/ApiGroupOrChannel.swift +++ b/TelegramCore/ApiGroupOrChannel.swift @@ -50,7 +50,7 @@ public func parseTelegramGroupOrChannel(chat: Api.Chat) -> Peer? { return TelegramGroup(id: PeerId(namespace: Namespaces.Peer.CloudGroup, id: id), title: "", photo: [], participantCount: 0, role: .member, membership: .Removed, flags: [], migrationReference: nil, creationDate: 0, version: 0) case let .chatForbidden(id, title): return TelegramGroup(id: PeerId(namespace: Namespaces.Peer.CloudGroup, id: id), title: title, photo: [], participantCount: 0, role: .member, membership: .Removed, flags: [], migrationReference: nil, creationDate: 0, version: 0) - case let .channel(flags, id, accessHash, title, username, photo, date, version, restrictionReason, adminRights, bannedRights, _, feedId): + case let .channel(flags, id, accessHash, title, username, photo, date, version, restrictionReason, adminRights, bannedRights, _/*feed*//*, feedId*/): let participationStatus: TelegramChannelParticipationStatus if (flags & Int32(1 << 1)) != 0 { participationStatus = .kicked @@ -90,7 +90,7 @@ public func parseTelegramGroupOrChannel(chat: Api.Chat) -> Peer? { restrictionInfo = nil } - return TelegramChannel(id: PeerId(namespace: Namespaces.Peer.CloudChannel, id: id), accessHash: accessHash, title: title, username: username, photo: imageRepresentationsForApiChatPhoto(photo), creationDate: date, version: version, participationStatus: participationStatus, info: info, flags: channelFlags, restrictionInfo: restrictionInfo, adminRights: adminRights.flatMap(TelegramChannelAdminRights.init), bannedRights: bannedRights.flatMap(TelegramChannelBannedRights.init), peerGroupId: feedId.flatMap { PeerGroupId(rawValue: $0) }) + return TelegramChannel(id: PeerId(namespace: Namespaces.Peer.CloudChannel, id: id), accessHash: accessHash, title: title, username: username, photo: imageRepresentationsForApiChatPhoto(photo), creationDate: date, version: version, participationStatus: participationStatus, info: info, flags: channelFlags, restrictionInfo: restrictionInfo, adminRights: adminRights.flatMap(TelegramChannelAdminRights.init), bannedRights: bannedRights.flatMap(TelegramChannelBannedRights.init), peerGroupId: /*feed*/nil/*feedId.flatMap { PeerGroupId(rawValue: $0) }*/) case let .channelForbidden(flags, id, accessHash, title, untilDate): let info: TelegramChannelInfo if (flags & Int32(1 << 8)) != 0 { @@ -107,7 +107,7 @@ func mergeGroupOrChannel(lhs: Peer?, rhs: Api.Chat) -> Peer? { switch rhs { case .chat, .chatEmpty, .chatForbidden, .channelForbidden: return parseTelegramGroupOrChannel(chat: rhs) - case let .channel(flags, _, accessHash, title, username, photo, date, version, restrictionReason, adminRights, bannedRights, _, feedId): + case let .channel(flags, _, accessHash, title, username, photo, date, version, restrictionReason, adminRights, bannedRights, _/*feed*//*, feedId*/): if accessHash != nil && (flags & (1 << 12)) == 0 { return parseTelegramGroupOrChannel(chat: rhs) } else if let lhs = lhs as? TelegramChannel { diff --git a/TelegramCore/FetchChatList.swift b/TelegramCore/FetchChatList.swift index 337b31237a..84f3373c60 100644 --- a/TelegramCore/FetchChatList.swift +++ b/TelegramCore/FetchChatList.swift @@ -106,9 +106,10 @@ private func parseDialogs(apiDialogs: [Api.Dialog], apiMessages: [Api.Message], } notificationSettings[peerId] = TelegramPeerNotificationSettings(apiSettings: apiNotificationSettings) - case let .dialogFeed(_, _, _, feedId, _, _, _, _): + /*feed*/ + /*case let .dialogFeed(_, _, _, feedId, _, _, _, _): itemIds.append(.group(PeerGroupId(rawValue: feedId))) - referencedFeeds.insert(PeerGroupId(rawValue: feedId)) + referencedFeeds.insert(PeerGroupId(rawValue: feedId))*/ } } @@ -212,10 +213,12 @@ func fetchChatList(postbox: Postbox, network: Network, location: FetchChatListLo case .general: break case let .group(groupId): - requestFeedId = groupId.rawValue - flags |= 1 << 1 + /*feed*/ + /*requestFeedId = groupId.rawValue + flags |= 1 << 1*/ + break } - let requestChats = network.request(Api.functions.messages.getDialogs(flags: flags, feedId: requestFeedId, offsetDate: timestamp, offsetId: id, offsetPeer: peer, limit: 100)) + let requestChats = network.request(Api.functions.messages.getDialogs(flags: flags/*feed*//*, feedId: requestFeedId*/, offsetDate: timestamp, offsetId: id, offsetPeer: peer, limit: 100)) |> retryRequest return combineLatest(requestChats, additionalPinnedChats) @@ -236,7 +239,8 @@ func fetchChatList(postbox: Postbox, network: Network, location: FetchChatListLo var feedSignals: [Signal<(PeerGroupId, ParsedDialogs), NoError>] = [] if case .general = location { - for groupId in combinedReferencedFeeds { + /*feed*/ + /*for groupId in combinedReferencedFeeds { let flags: Int32 = 1 << 1 let requestFeed = network.request(Api.functions.messages.getDialogs(flags: flags, feedId: groupId.rawValue, offsetDate: 0, offsetId: 0, offsetPeer: .inputPeerEmpty, limit: 4)) |> retryRequest @@ -246,7 +250,7 @@ func fetchChatList(postbox: Postbox, network: Network, location: FetchChatListLo return (groupId, parsedChats) } feedSignals.append(requestFeed) - } + }*/ } return combineLatest(feedSignals) diff --git a/TelegramCore/GroupFeedPeers.swift b/TelegramCore/GroupFeedPeers.swift index 34760222e2..5382b4443e 100644 --- a/TelegramCore/GroupFeedPeers.swift +++ b/TelegramCore/GroupFeedPeers.swift @@ -8,7 +8,9 @@ import Foundation #endif public func availableGroupFeedPeers(postbox: Postbox, network: Network, groupId: PeerGroupId) -> Signal<[(Peer, Bool)], NoError> { - return network.request(Api.functions.channels.getFeedSources(flags: 0, feedId: groupId.rawValue, hash: 0)) + /*feed*/ + return .single([]) + /*return network.request(Api.functions.channels.getFeedSources(flags: 0, feedId: groupId.rawValue, hash: 0)) |> retryRequest |> mapToSignal { result -> Signal<[(Peer, Bool)], NoError> in return postbox.modify { modifier -> [(Peer, Bool)] in @@ -46,5 +48,5 @@ public func availableGroupFeedPeers(postbox: Postbox, network: Network, groupId: return peers } } - } + }*/ } diff --git a/TelegramCore/HistoryViewChannelStateValidation.swift b/TelegramCore/HistoryViewChannelStateValidation.swift index 51513c47ce..d64b520c34 100644 --- a/TelegramCore/HistoryViewChannelStateValidation.swift +++ b/TelegramCore/HistoryViewChannelStateValidation.swift @@ -358,7 +358,9 @@ private func validateBatch(postbox: Postbox, network: Network, accountPeerId: Pe return .complete() } case let .group(groupId, _): - let hash = hashForMessages(previousMessages, withChannelIds: true) + /*feed*/ + signal = .single(.notModified) + /*let hash = hashForMessages(previousMessages, withChannelIds: true) let upperIndex = MessageIndex(previousMessages[previousMessages.count - 1]) let minIndex = MessageIndex(previousMessages[0]).predecessor() @@ -383,7 +385,7 @@ private func validateBatch(postbox: Postbox, network: Network, accountPeerId: Pe case .feedMessagesNotModified: return .notModified } - } + }*/ } return signal diff --git a/TelegramCore/Holes.swift b/TelegramCore/Holes.swift index 70e907df73..e1149dda08 100644 --- a/TelegramCore/Holes.swift +++ b/TelegramCore/Holes.swift @@ -282,7 +282,9 @@ func groupBoundaryPeer(_ peerId: PeerId, accountPeerId: PeerId) -> Api.Peer { } func fetchGroupFeedHole(source: FetchMessageHistoryHoleSource, accountPeerId: PeerId, postbox: Postbox, groupId: PeerGroupId, minIndex: MessageIndex, maxIndex: MessageIndex, direction: MessageHistoryViewRelativeHoleDirection, limit: Int = 100) -> Signal { - return postbox.modify { modifier -> (Peer?, Peer?) in + /*feed*/ + return .complete() + /*return postbox.modify { modifier -> (Peer?, Peer?) in return (modifier.getPeer(minIndex.id.peerId), modifier.getPeer(maxIndex.id.peerId)) } |> mapToSignal { lowerPeer, upperPeer in @@ -454,7 +456,7 @@ func fetchGroupFeedHole(source: FetchMessageHistoryHoleSource, accountPeerId: Pe return } } - } + }*/ } func fetchChatListHole(postbox: Postbox, network: Network, groupId: PeerGroupId?, hole: ChatListHole) -> Signal { diff --git a/TelegramCore/ManagedConsumePersonalMessagesActions.swift b/TelegramCore/ManagedConsumePersonalMessagesActions.swift index a4765a0494..7c31a64fc7 100644 --- a/TelegramCore/ManagedConsumePersonalMessagesActions.swift +++ b/TelegramCore/ManagedConsumePersonalMessagesActions.swift @@ -242,9 +242,10 @@ private func synchronizeUnseenPersonalMentionsTag(postbox: Postbox, network: Net case let .dialog(_, _, topMessage, _, _, _, unreadMentionsCount, _, _, _): apiTopMessage = topMessage apiUnreadMentionsCount = unreadMentionsCount - case .dialogFeed: + /*feed*/ + /*case .dialogFeed: assertionFailure() - return .complete() + return .complete()*/ } return postbox.modify { modifier -> Void in diff --git a/TelegramCore/ManagedGroupFeedReadStateSyncOperations.swift b/TelegramCore/ManagedGroupFeedReadStateSyncOperations.swift index 677b411feb..996f3990a2 100644 --- a/TelegramCore/ManagedGroupFeedReadStateSyncOperations.swift +++ b/TelegramCore/ManagedGroupFeedReadStateSyncOperations.swift @@ -94,7 +94,9 @@ func managedGroupFeedReadStateSyncOperations(postbox: Postbox, network: Network, } private func fetchReadStateNext(network: Network, groupId: PeerGroupId) -> Signal { - return network.request(Api.functions.messages.getPeerDialogs(peers: [.inputDialogPeerFeed(feedId: groupId.rawValue)])) + /*feed*/ + return .single(nil) + /*return network.request(Api.functions.messages.getPeerDialogs(peers: [.inputDialogPeerFeed(feedId: groupId.rawValue)])) |> retryRequest |> map { result -> GroupFeedReadState? in switch result { @@ -120,11 +122,13 @@ private func fetchReadStateNext(network: Network, groupId: PeerGroupId) -> Signa } return nil } - } + }*/ } private func fetchReadState(network: Network, groupId: PeerGroupId) -> Signal { - return network.request(Api.functions.channels.getFeed(flags: 0, feedId: groupId.rawValue, offsetPosition: nil, addOffset: 0, limit: 1, maxPosition: nil, minPosition: nil, hash: 0)) + /*feed*/ + return .single(nil) + /*return network.request(Api.functions.channels.getFeed(flags: 0, feedId: groupId.rawValue, offsetPosition: nil, addOffset: 0, limit: 1, maxPosition: nil, minPosition: nil, hash: 0)) |> retryRequest |> map { result -> GroupFeedReadState? in switch result { @@ -153,18 +157,20 @@ private func fetchReadState(network: Network, groupId: PeerGroupId) -> Signal Signal { - let position: Api.FeedPosition = .feedPosition(date: state.maxReadIndex.timestamp, peer: groupBoundaryPeer(state.maxReadIndex.id.peerId, accountPeerId: accountPeerId), id: state.maxReadIndex.id.id) + /*feed*/ + return .single(nil) + /*let position: Api.FeedPosition = .feedPosition(date: state.maxReadIndex.timestamp, peer: groupBoundaryPeer(state.maxReadIndex.id.peerId, accountPeerId: accountPeerId), id: state.maxReadIndex.id.id) if GlobalTelegramCoreConfiguration.readMessages { return network.request(Api.functions.channels.readFeed(feedId: groupId.rawValue, maxPosition: position)) |> retryRequest |> map(Optional.init) } else { return .single(nil) - } + }*/ } private func performSyncOperation(postbox: Postbox, network: Network, accountPeerId: PeerId, stateManager: AccountStateManager, groupId: PeerGroupId, operation: GroupFeedReadStateSyncOperation) -> Signal { diff --git a/TelegramCore/ManagedSynchronizeGroupedPeersOperations.swift b/TelegramCore/ManagedSynchronizeGroupedPeersOperations.swift index 03cd70a059..cfbbb3cfbc 100644 --- a/TelegramCore/ManagedSynchronizeGroupedPeersOperations.swift +++ b/TelegramCore/ManagedSynchronizeGroupedPeersOperations.swift @@ -126,7 +126,9 @@ private func hashForIds(_ ids: [Int32]) -> Int32 { } private func synchronizeGroupedPeers(modifier: Modifier, postbox: Postbox, network: Network, operation: SynchronizeGroupedPeersOperation) -> Signal { - let initialRemotePeerIds = operation.initialPeerIds + /*feed*/ + return .complete() + /*let initialRemotePeerIds = operation.initialPeerIds let localPeerIds = modifier.getPeerIdsInGroup(operation.groupId) return network.request(Api.functions.channels.getFeedSources(flags: 1 << 0, feedId: operation.groupId.rawValue, hash: hashForIds(localPeerIds.map({ $0.id }).sorted()))) @@ -206,6 +208,6 @@ private func synchronizeGroupedPeers(modifier: Modifier, postbox: Postbox, netwo } } |> switchToLatest } - } + }*/ } diff --git a/TelegramCore/ManagedSynchronizePinnedChatsOperations.swift b/TelegramCore/ManagedSynchronizePinnedChatsOperations.swift index 74f81cbf23..3e5539bf0b 100644 --- a/TelegramCore/ManagedSynchronizePinnedChatsOperations.swift +++ b/TelegramCore/ManagedSynchronizePinnedChatsOperations.swift @@ -185,9 +185,10 @@ private func synchronizePinnedChats(modifier: Modifier, postbox: Postbox, networ apiUnreadCount = unreadCount apiNotificationSettings = peerNotificationSettings apiChannelPts = pts - case let .dialogFeed(_, _, _, feedId, _, _, _, _): + /*feed*/ + /*case let .dialogFeed(_, _, _, feedId, _, _, _, _): remoteItemIds.append(.group(PeerGroupId(rawValue: feedId))) - continue loop + continue loop*/ } let peerId: PeerId @@ -271,7 +272,9 @@ private func synchronizePinnedChats(modifier: Modifier, postbox: Postbox, networ inputDialogPeers.append(Api.InputDialogPeer.inputDialogPeer(peer: inputPeer)) } case let .group(groupId): - inputDialogPeers.append(.inputDialogPeerFeed(feedId: groupId.rawValue)) + /*feed*/ + /*inputDialogPeers.append(.inputDialogPeerFeed(feedId: groupId.rawValue))*/ + break } } diff --git a/TelegramCore/SearchMessages.swift b/TelegramCore/SearchMessages.swift index 23682a64de..fb81066497 100644 --- a/TelegramCore/SearchMessages.swift +++ b/TelegramCore/SearchMessages.swift @@ -89,8 +89,10 @@ public func searchMessages(account: Account, location: SearchMessagesLocation, q } } case let .group(groupId): - remoteSearchResult = account.network.request(Api.functions.channels.searchFeed(feedId: groupId.rawValue, q: query, offsetDate: 0, offsetPeer: Api.InputPeer.inputPeerEmpty, offsetId: 0, limit: 64), automaticFloodWait: false) - |> mapError { _ in } |> map(Optional.init) + /*feed*/ + remoteSearchResult = .single(nil) + /*remoteSearchResult = account.network.request(Api.functions.channels.searchFeed(feedId: groupId.rawValue, q: query, offsetDate: 0, offsetPeer: Api.InputPeer.inputPeerEmpty, offsetId: 0, limit: 64), automaticFloodWait: false) + |> mapError { _ in } |> map(Optional.init)*/ case .general: remoteSearchResult = account.network.request(Api.functions.messages.searchGlobal(q: query, offsetDate: 0, offsetPeer: Api.InputPeer.inputPeerEmpty, offsetId: 0, limit: 64), automaticFloodWait: false) |> mapError { _ in } |> map(Optional.init) diff --git a/TelegramCore/SearchPeers.swift b/TelegramCore/SearchPeers.swift index c9d589fbfb..b292324c7c 100644 --- a/TelegramCore/SearchPeers.swift +++ b/TelegramCore/SearchPeers.swift @@ -47,7 +47,8 @@ public func searchPeers(account: Account, query: String) -> Signal<([FoundPeer], if let groupOrChannel = parseTelegramGroupOrChannel(chat: chat) { peers[groupOrChannel.id] = groupOrChannel switch chat { - case let .channel(_, _, _, _, _, _, _, _, _, _, _, participantsCount, _): + /*feed*/ + case let .channel(_, _, _, _, _, _, _, _, _, _, _, participantsCount/*, _*/): if let participantsCount = participantsCount { subscribers[groupOrChannel.id] = participantsCount } diff --git a/TelegramCore/SynchronizePeerReadState.swift b/TelegramCore/SynchronizePeerReadState.swift index bf6657f340..5bc0454888 100644 --- a/TelegramCore/SynchronizePeerReadState.swift +++ b/TelegramCore/SynchronizePeerReadState.swift @@ -81,9 +81,10 @@ func fetchPeerCloudReadState(network: Network, postbox: Postbox, peerId: PeerId, apiReadInboxMaxId = readInboxMaxId apiReadOutboxMaxId = readOutboxMaxId apiUnreadCount = unreadCount - case .dialogFeed: + /*feed*/ + /*case .dialogFeed: assertionFailure() - return nil + return nil*/ } return .idBased(maxIncomingReadId: apiReadInboxMaxId, maxOutgoingReadId: apiReadOutboxMaxId, maxKnownId: apiTopMessage, count: apiUnreadCount) @@ -122,9 +123,10 @@ private func dialogReadState(network: Network, postbox: Postbox, peerId: PeerId) if let pts = pts { apiChannelPts = pts } - case .dialogFeed: + /*feed*/ + /*case .dialogFeed: assertionFailure() - return .fail(.Abort) + return .fail(.Abort)*/ } let marker: PeerReadStateMarker diff --git a/TelegramCore/UpdatesApiUtils.swift b/TelegramCore/UpdatesApiUtils.swift index bda93aa795..77e3944ebe 100644 --- a/TelegramCore/UpdatesApiUtils.swift +++ b/TelegramCore/UpdatesApiUtils.swift @@ -122,7 +122,7 @@ extension Api.Chat { return PeerId(namespace: Namespaces.Peer.CloudGroup, id: id) case let .chatForbidden(id, _): return PeerId(namespace: Namespaces.Peer.CloudGroup, id: id) - case let .channel(_, id, _, _, _, _, _, _, _, _, _, _, _): + case let .channel(_, id, _, _, _, _, _, _, _, _, _, _/*feed*//*, _*/): return PeerId(namespace: Namespaces.Peer.CloudChannel, id: id) case let .channelForbidden(_, id, _, _, _): return PeerId(namespace: Namespaces.Peer.CloudChannel, id: id) @@ -159,8 +159,9 @@ extension Api.Dialog { switch self { case let .dialog(_, peer, _, _, _, _, _, _, _, _): return peer.peerId - case .dialogFeed: - return nil + /*feed*/ + /*case .dialogFeed: + return nil*/ } } }