mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-08-17 02:49:57 +00:00
no message
This commit is contained in:
parent
075d965857
commit
c265e81118
@ -350,6 +350,8 @@
|
||||
D0642EFA1F3E05D700792790 /* EarliestUnseenPersonalMentionMessage.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0642EF81F3E05D700792790 /* EarliestUnseenPersonalMentionMessage.swift */; };
|
||||
D067066C1D512ADB00DED3E3 /* Postbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D06706671D512ADB00DED3E3 /* Postbox.framework */; };
|
||||
D067066D1D512ADB00DED3E3 /* SwiftSignalKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D06706681D512ADB00DED3E3 /* SwiftSignalKit.framework */; };
|
||||
D06ECFC220B77B8300C576C2 /* TermsOfService.swift in Sources */ = {isa = PBXBuildFile; fileRef = D06ECFC120B77B8300C576C2 /* TermsOfService.swift */; };
|
||||
D06ECFC320B77B8300C576C2 /* TermsOfService.swift in Sources */ = {isa = PBXBuildFile; fileRef = D06ECFC120B77B8300C576C2 /* TermsOfService.swift */; };
|
||||
D07047B41F3DF1FE00F6A8D4 /* ConsumablePersonalMentionMessageAttribute.swift in Sources */ = {isa = PBXBuildFile; fileRef = D07047B31F3DF1FE00F6A8D4 /* ConsumablePersonalMentionMessageAttribute.swift */; };
|
||||
D07047B51F3DF1FE00F6A8D4 /* ConsumablePersonalMentionMessageAttribute.swift in Sources */ = {isa = PBXBuildFile; fileRef = D07047B31F3DF1FE00F6A8D4 /* ConsumablePersonalMentionMessageAttribute.swift */; };
|
||||
D07047B71F3DF2CD00F6A8D4 /* ManagedConsumePersonalMessagesActions.swift in Sources */ = {isa = PBXBuildFile; fileRef = D07047B61F3DF2CD00F6A8D4 /* ManagedConsumePersonalMessagesActions.swift */; };
|
||||
@ -903,6 +905,7 @@
|
||||
D06706671D512ADB00DED3E3 /* Postbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Postbox.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
D06706681D512ADB00DED3E3 /* SwiftSignalKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = SwiftSignalKit.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
D067066E1D512AEB00DED3E3 /* MtProtoKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = MtProtoKit.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
D06ECFC120B77B8300C576C2 /* TermsOfService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TermsOfService.swift; sourceTree = "<group>"; };
|
||||
D07047B31F3DF1FE00F6A8D4 /* ConsumablePersonalMentionMessageAttribute.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConsumablePersonalMentionMessageAttribute.swift; sourceTree = "<group>"; };
|
||||
D07047B61F3DF2CD00F6A8D4 /* ManagedConsumePersonalMessagesActions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ManagedConsumePersonalMessagesActions.swift; sourceTree = "<group>"; };
|
||||
D07047B91F3DF75500F6A8D4 /* ConsumePersonalMessageAction.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConsumePersonalMessageAction.swift; sourceTree = "<group>"; };
|
||||
@ -1468,6 +1471,7 @@
|
||||
D0528E591E658B3600E2FEF5 /* ManagedLocalInputActivities.swift */,
|
||||
D099D7481EEF418D00A3128C /* HistoryViewChannelStateValidation.swift */,
|
||||
D0B1671C1F9EA2C300976B40 /* ChatHistoryPreloadManager.swift */,
|
||||
D06ECFC120B77B8300C576C2 /* TermsOfService.swift */,
|
||||
);
|
||||
name = Account;
|
||||
sourceTree = "<group>";
|
||||
@ -2036,6 +2040,7 @@
|
||||
D03B0CF71D62250800955575 /* TelegramMediaImage.swift in Sources */,
|
||||
D054648E20738626002ECC1E /* SecureIdDriversLicenseValue.swift in Sources */,
|
||||
C210DD621FBDB90800F673D8 /* SourceReferenceMessageAttribute.swift in Sources */,
|
||||
D06ECFC220B77B8300C576C2 /* TermsOfService.swift in Sources */,
|
||||
D0E23DDF1E8082A400B9B6D2 /* ArchivedStickerPacks.swift in Sources */,
|
||||
D0546494207386D7002ECC1E /* SecureIdUtilityBillValue.swift in Sources */,
|
||||
D0BC386E1E3FDAB70044D6FE /* CreateGroup.swift in Sources */,
|
||||
@ -2524,6 +2529,7 @@
|
||||
D001F3E91E128A1C007A8C60 /* SecretChatState.swift in Sources */,
|
||||
D08F4A6A1E79CECB00A2AA15 /* ManagedSynchronizeInstalledStickerPacksOperations.swift in Sources */,
|
||||
D0B8444B1DAB91FD005F29E1 /* ManagedSynchronizePeerReadStates.swift in Sources */,
|
||||
D06ECFC320B77B8300C576C2 /* TermsOfService.swift in Sources */,
|
||||
D0F8C39E20178B9B00236FC5 /* GroupFeedPeers.swift in Sources */,
|
||||
D073CE6C1DCBCF17007511FD /* TextEntitiesMessageAttribute.swift in Sources */,
|
||||
D03C53751DAD5CA9004C17B3 /* TelegramUserPresence.swift in Sources */,
|
||||
|
@ -358,10 +358,10 @@ public func twoStepAuthData(_ network: Network) -> Signal<TwoStepAuthData, MTRpc
|
||||
return network.request(Api.functions.account.getPassword())
|
||||
|> map { config -> TwoStepAuthData in
|
||||
switch config {
|
||||
case let .noPassword(newSalt, newSecureSalt, secretRandom, emailUnconfirmedPattern):
|
||||
return TwoStepAuthData(nextSalt: newSalt.makeData(), currentSalt: nil, hasRecovery: false, hasSecretValues: false, currentHint: nil, unconfirmedEmailPattern: emailUnconfirmedPattern, secretRandom: secretRandom.makeData(), nextSecureSalt: newSecureSalt.makeData())
|
||||
case let .password(flags, currentSalt, newSalt, newSecureSalt, secretRandom, hint, emailUnconfirmedPattern):
|
||||
return TwoStepAuthData(nextSalt: newSalt.makeData(), currentSalt: currentSalt.makeData(), hasRecovery: (flags & (1 << 0)) != 0, hasSecretValues: (flags & (1 << 1)) != 0, currentHint: hint, unconfirmedEmailPattern: emailUnconfirmedPattern, secretRandom: secretRandom.makeData(), nextSecureSalt: newSecureSalt.makeData())
|
||||
case let .noPassword(newSalt, emailUnconfirmedPattern):
|
||||
return TwoStepAuthData(nextSalt: newSalt.makeData(), currentSalt: nil, hasRecovery: false, hasSecretValues: false, currentHint: nil, unconfirmedEmailPattern: emailUnconfirmedPattern, secretRandom: Data(), nextSecureSalt: Data())
|
||||
case let .password(currentSalt, newSalt, hint, hasRecovery, emailUnconfirmedPattern):
|
||||
return TwoStepAuthData(nextSalt: newSalt.makeData(), currentSalt: currentSalt.makeData(), hasRecovery: hasRecovery == .boolTrue, hasSecretValues: false, currentHint: hint, unconfirmedEmailPattern: emailUnconfirmedPattern, secretRandom: Data(), nextSecureSalt: Data())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -75,7 +75,7 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
|
||||
dict[-292807034] = { return Api.InputChannel.parse_inputChannelEmpty($0) }
|
||||
dict[-1343524562] = { return Api.InputChannel.parse_inputChannel($0) }
|
||||
dict[414687501] = { return Api.DcOption.parse_dcOption($0) }
|
||||
dict[2077869041] = { return Api.account.PasswordSettings.parse_passwordSettings($0) }
|
||||
dict[-1212732749] = { return Api.account.PasswordSettings.parse_passwordSettings($0) }
|
||||
dict[292985073] = { return Api.LangPackLanguage.parse_langPackLanguage($0) }
|
||||
dict[-1987579119] = { return Api.help.AppUpdate.parse_appUpdate($0) }
|
||||
dict[-1000708810] = { return Api.help.AppUpdate.parse_noAppUpdate($0) }
|
||||
@ -214,8 +214,6 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
|
||||
dict[1358175439] = { return Api.KeyboardButton.parse_keyboardButtonGame($0) }
|
||||
dict[-1344716869] = { return Api.KeyboardButton.parse_keyboardButtonBuy($0) }
|
||||
dict[-748155807] = { return Api.ContactStatus.parse_contactStatus($0) }
|
||||
dict[1679398724] = { return Api.SecureFile.parse_secureFileEmpty($0) }
|
||||
dict[-534283678] = { return Api.SecureFile.parse_secureFile($0) }
|
||||
dict[236446268] = { return Api.PhotoSize.parse_photoSizeEmpty($0) }
|
||||
dict[2009052699] = { return Api.PhotoSize.parse_photoSize($0) }
|
||||
dict[-374917894] = { return Api.PhotoSize.parse_photoCachedSize($0) }
|
||||
@ -267,7 +265,6 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
|
||||
dict[1928391342] = { return Api.InputDocument.parse_inputDocumentEmpty($0) }
|
||||
dict[410618194] = { return Api.InputDocument.parse_inputDocument($0) }
|
||||
dict[2131196633] = { return Api.contacts.ResolvedPeer.parse_resolvedPeer($0) }
|
||||
dict[-1964327229] = { return Api.SecureData.parse_secureData($0) }
|
||||
dict[-1771768449] = { return Api.InputMedia.parse_inputMediaEmpty($0) }
|
||||
dict[-104578748] = { return Api.InputMedia.parse_inputMediaGeoPoint($0) }
|
||||
dict[-1494984313] = { return Api.InputMedia.parse_inputMediaContact($0) }
|
||||
@ -325,16 +322,11 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
|
||||
dict[-526508104] = { return Api.help.ProxyData.parse_proxyDataEmpty($0) }
|
||||
dict[737668643] = { return Api.help.ProxyData.parse_proxyDataPromo($0) }
|
||||
dict[-543777747] = { return Api.auth.ExportedAuthorization.parse_exportedAuthorization($0) }
|
||||
dict[2103482845] = { return Api.SecurePlainData.parse_securePlainPhone($0) }
|
||||
dict[569137759] = { return Api.SecurePlainData.parse_securePlainEmail($0) }
|
||||
dict[-1269012015] = { return Api.messages.AffectedHistory.parse_affectedHistory($0) }
|
||||
dict[570402317] = { return Api.account.PasswordInputSettings.parse_passwordInputSettings($0) }
|
||||
dict[-2037289493] = { return Api.account.PasswordInputSettings.parse_passwordInputSettings($0) }
|
||||
dict[649453030] = { return Api.messages.MessageEditData.parse_messageEditData($0) }
|
||||
dict[-886477832] = { return Api.LabeledPrice.parse_labeledPrice($0) }
|
||||
dict[-438840932] = { return Api.messages.ChatFull.parse_chatFull($0) }
|
||||
dict[108557032] = { return Api.InputSecureValue.parse_inputSecureValue($0) }
|
||||
dict[1722786150] = { return Api.help.DeepLinkInfo.parse_deepLinkInfoEmpty($0) }
|
||||
dict[1783556146] = { return Api.help.DeepLinkInfo.parse_deepLinkInfo($0) }
|
||||
dict[-313079300] = { return Api.account.WebAuthorizations.parse_webAuthorizations($0) }
|
||||
dict[-236044656] = { return Api.help.TermsOfService.parse_termsOfService($0) }
|
||||
dict[1490799288] = { return Api.ReportReason.parse_inputReportReasonSpam($0) }
|
||||
@ -345,15 +337,8 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
|
||||
dict[-1169445179] = { return Api.DraftMessage.parse_draftMessageEmpty($0) }
|
||||
dict[-40996577] = { return Api.DraftMessage.parse_draftMessage($0) }
|
||||
dict[1568467877] = { return Api.ChannelAdminRights.parse_channelAdminRights($0) }
|
||||
dict[-2128640689] = { return Api.account.SentEmailCode.parse_sentEmailCode($0) }
|
||||
dict[-1038136962] = { return Api.EncryptedFile.parse_encryptedFileEmpty($0) }
|
||||
dict[1248893260] = { return Api.EncryptedFile.parse_encryptedFile($0) }
|
||||
dict[-391902247] = { return Api.SecureValueError.parse_secureValueErrorData($0) }
|
||||
dict[12467706] = { return Api.SecureValueError.parse_secureValueErrorFrontSide($0) }
|
||||
dict[-2037765467] = { return Api.SecureValueError.parse_secureValueErrorReverseSide($0) }
|
||||
dict[-449327402] = { return Api.SecureValueError.parse_secureValueErrorSelfie($0) }
|
||||
dict[2054162547] = { return Api.SecureValueError.parse_secureValueErrorFile($0) }
|
||||
dict[1717706985] = { return Api.SecureValueError.parse_secureValueErrorFiles($0) }
|
||||
dict[1489977929] = { return Api.ChannelBannedRights.parse_channelBannedRights($0) }
|
||||
dict[-1613493288] = { return Api.NotifyPeer.parse_notifyPeer($0) }
|
||||
dict[-1261946036] = { return Api.NotifyPeer.parse_notifyUsers($0) }
|
||||
@ -369,8 +354,6 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
|
||||
dict[1493171408] = { return Api.HighScore.parse_highScore($0) }
|
||||
dict[-305282981] = { return Api.TopPeer.parse_topPeer($0) }
|
||||
dict[986597452] = { return Api.contacts.Link.parse_link($0) }
|
||||
dict[-1263225191] = { return Api.SecureValue.parse_secureValue($0) }
|
||||
dict[-316748368] = { return Api.SecureValueHash.parse_secureValueHash($0) }
|
||||
dict[1444661369] = { return Api.ContactBlocked.parse_contactBlocked($0) }
|
||||
dict[-2128698738] = { return Api.auth.CheckedPhone.parse_checkedPhone($0) }
|
||||
dict[-1182234929] = { return Api.InputUser.parse_inputUserEmpty($0) }
|
||||
@ -378,7 +361,6 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
|
||||
dict[-668391402] = { return Api.InputUser.parse_inputUser($0) }
|
||||
dict[-1908433218] = { return Api.Page.parse_pagePart($0) }
|
||||
dict[1433323434] = { return Api.Page.parse_pageFull($0) }
|
||||
dict[871426631] = { return Api.SecureCredentialsEncrypted.parse_secureCredentialsEncrypted($0) }
|
||||
dict[157948117] = { return Api.upload.File.parse_file($0) }
|
||||
dict[-242427324] = { return Api.upload.File.parse_fileCdnRedirect($0) }
|
||||
dict[182649427] = { return Api.MessageRange.parse_messageRange($0) }
|
||||
@ -464,7 +446,6 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
|
||||
dict[342061462] = { return Api.InputFileLocation.parse_inputFileLocation($0) }
|
||||
dict[-182231723] = { return Api.InputFileLocation.parse_inputEncryptedFileLocation($0) }
|
||||
dict[1125058340] = { return Api.InputFileLocation.parse_inputDocumentFileLocation($0) }
|
||||
dict[-876089816] = { return Api.InputFileLocation.parse_inputSecureFileLocation($0) }
|
||||
dict[286776671] = { return Api.GeoPoint.parse_geoPointEmpty($0) }
|
||||
dict[541710092] = { return Api.GeoPoint.parse_geoPoint($0) }
|
||||
dict[506920429] = { return Api.InputPhoneCall.parse_inputPhoneCall($0) }
|
||||
@ -476,8 +457,6 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
|
||||
dict[178373535] = { return Api.InputPaymentCredentials.parse_inputPaymentCredentialsApplePay($0) }
|
||||
dict[-905587442] = { return Api.InputPaymentCredentials.parse_inputPaymentCredentialsAndroidPay($0) }
|
||||
dict[-1239335713] = { return Api.ShippingOption.parse_shippingOption($0) }
|
||||
dict[859091184] = { return Api.InputSecureFile.parse_inputSecureFileUploaded($0) }
|
||||
dict[1399317950] = { return Api.InputSecureFile.parse_inputSecureFile($0) }
|
||||
dict[512535275] = { return Api.PostAddress.parse_postAddress($0) }
|
||||
dict[2104790276] = { return Api.DataJSON.parse_dataJSON($0) }
|
||||
dict[1251549527] = { return Api.InputStickeredMedia.parse_inputStickeredMediaPhoto($0) }
|
||||
@ -501,6 +480,8 @@ 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[1713855074] = { return Api.InputWebFileLocation.parse_inputWebFileGeoPointLocation($0) }
|
||||
dict[1430205163] = { return Api.InputWebFileLocation.parse_inputWebFileGeoMessageLocation($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) }
|
||||
@ -536,28 +517,14 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
|
||||
dict[-209768682] = { return Api.messages.FavedStickers.parse_favedStickers($0) }
|
||||
dict[1776236393] = { return Api.ExportedChatInvite.parse_chatInviteEmpty($0) }
|
||||
dict[-64092740] = { return Api.ExportedChatInvite.parse_chatInviteExported($0) }
|
||||
dict[-879268525] = { return Api.account.AuthorizationForm.parse_authorizationForm($0) }
|
||||
dict[2079516406] = { return Api.Authorization.parse_authorization($0) }
|
||||
dict[-1361650766] = { return Api.MaskCoords.parse_maskCoords($0) }
|
||||
dict[-395967805] = { return Api.messages.AllStickers.parse_allStickersNotModified($0) }
|
||||
dict[-302170017] = { return Api.messages.AllStickers.parse_allStickers($0) }
|
||||
dict[-1655957568] = { return Api.PhoneConnection.parse_phoneConnection($0) }
|
||||
dict[-1194283041] = { return Api.AccountDaysTTL.parse_accountDaysTTL($0) }
|
||||
dict[-1658158621] = { return Api.SecureValueType.parse_secureValueTypePersonalDetails($0) }
|
||||
dict[1034709504] = { return Api.SecureValueType.parse_secureValueTypePassport($0) }
|
||||
dict[115615172] = { return Api.SecureValueType.parse_secureValueTypeDriverLicense($0) }
|
||||
dict[-1596951477] = { return Api.SecureValueType.parse_secureValueTypeIdentityCard($0) }
|
||||
dict[-1717268701] = { return Api.SecureValueType.parse_secureValueTypeInternalPassport($0) }
|
||||
dict[-874308058] = { return Api.SecureValueType.parse_secureValueTypeAddress($0) }
|
||||
dict[-63531698] = { return Api.SecureValueType.parse_secureValueTypeUtilityBill($0) }
|
||||
dict[-1995211763] = { return Api.SecureValueType.parse_secureValueTypeBankStatement($0) }
|
||||
dict[-1954007928] = { return Api.SecureValueType.parse_secureValueTypeRentalAgreement($0) }
|
||||
dict[-1713143702] = { return Api.SecureValueType.parse_secureValueTypePassportRegistration($0) }
|
||||
dict[-368907213] = { return Api.SecureValueType.parse_secureValueTypeTemporaryRegistration($0) }
|
||||
dict[-1289704741] = { return Api.SecureValueType.parse_secureValueTypePhone($0) }
|
||||
dict[-1908627474] = { return Api.SecureValueType.parse_secureValueTypeEmail($0) }
|
||||
dict[1587643126] = { return Api.account.Password.parse_noPassword($0) }
|
||||
dict[-902187961] = { return Api.account.Password.parse_password($0) }
|
||||
dict[-1764049896] = { return Api.account.Password.parse_noPassword($0) }
|
||||
dict[2081952796] = { return Api.account.Password.parse_password($0) }
|
||||
dict[-1462213465] = { return Api.InputBotInlineResult.parse_inputBotInlineResultPhoto($0) }
|
||||
dict[-459324] = { return Api.InputBotInlineResult.parse_inputBotInlineResultDocument($0) }
|
||||
dict[1336154098] = { return Api.InputBotInlineResult.parse_inputBotInlineResultGame($0) }
|
||||
@ -589,8 +556,6 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
|
||||
dict[1200788123] = { return Api.MessageAction.parse_messageActionScreenshotTaken($0) }
|
||||
dict[-85549226] = { return Api.MessageAction.parse_messageActionCustomAction($0) }
|
||||
dict[-1410748418] = { return Api.MessageAction.parse_messageActionBotAllowed($0) }
|
||||
dict[455635795] = { return Api.MessageAction.parse_messageActionSecureValuesSentMe($0) }
|
||||
dict[-648257196] = { return Api.MessageAction.parse_messageActionSecureValuesSent($0) }
|
||||
dict[1399245077] = { return Api.PhoneCall.parse_phoneCallEmpty($0) }
|
||||
dict[462375633] = { return Api.PhoneCall.parse_phoneCallWaiting($0) }
|
||||
dict[-2089411356] = { return Api.PhoneCall.parse_phoneCallRequested($0) }
|
||||
@ -800,8 +765,6 @@ public struct Api {
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.ContactStatus:
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.SecureFile:
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.PhotoSize:
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.messages.Stickers:
|
||||
@ -846,8 +809,6 @@ public struct Api {
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.contacts.ResolvedPeer:
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.SecureData:
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.InputMedia:
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.InputPeer:
|
||||
@ -878,8 +839,6 @@ public struct Api {
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.auth.ExportedAuthorization:
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.SecurePlainData:
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.messages.AffectedHistory:
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.account.PasswordInputSettings:
|
||||
@ -890,10 +849,6 @@ public struct Api {
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.messages.ChatFull:
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.InputSecureValue:
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.help.DeepLinkInfo:
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.account.WebAuthorizations:
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.help.TermsOfService:
|
||||
@ -906,12 +861,8 @@ public struct Api {
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.ChannelAdminRights:
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.account.SentEmailCode:
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.EncryptedFile:
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.SecureValueError:
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.ChannelBannedRights:
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.NotifyPeer:
|
||||
@ -928,10 +879,6 @@ public struct Api {
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.contacts.Link:
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.SecureValue:
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.SecureValueHash:
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.ContactBlocked:
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.auth.CheckedPhone:
|
||||
@ -940,8 +887,6 @@ public struct Api {
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.Page:
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.SecureCredentialsEncrypted:
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.upload.File:
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.MessageRange:
|
||||
@ -1032,8 +977,6 @@ public struct Api {
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.ShippingOption:
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.InputSecureFile:
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.PostAddress:
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.DataJSON:
|
||||
@ -1082,8 +1025,6 @@ public struct Api {
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.ExportedChatInvite:
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.account.AuthorizationForm:
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.Authorization:
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.MaskCoords:
|
||||
@ -1094,8 +1035,6 @@ public struct Api {
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.AccountDaysTTL:
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.SecureValueType:
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.account.Password:
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.InputBotInlineResult:
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1271,57 +1271,6 @@ public struct help {
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
public enum DeepLinkInfo {
|
||||
case deepLinkInfoEmpty
|
||||
case deepLinkInfo(flags: Int32, message: String, entities: [Api.MessageEntity]?)
|
||||
|
||||
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
||||
switch self {
|
||||
case .deepLinkInfoEmpty:
|
||||
if boxed {
|
||||
buffer.appendInt32(1722786150)
|
||||
}
|
||||
|
||||
break
|
||||
case .deepLinkInfo(let flags, let message, let entities):
|
||||
if boxed {
|
||||
buffer.appendInt32(1783556146)
|
||||
}
|
||||
serializeInt32(flags, buffer: buffer, boxed: false)
|
||||
serializeString(message, buffer: buffer, boxed: false)
|
||||
if Int(flags) & Int(1 << 1) != 0 {buffer.appendInt32(481674261)
|
||||
buffer.appendInt32(Int32(entities!.count))
|
||||
for item in entities! {
|
||||
item.serialize(buffer, true)
|
||||
}}
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
static func parse_deepLinkInfoEmpty(_ reader: BufferReader) -> DeepLinkInfo? {
|
||||
return Api.help.DeepLinkInfo.deepLinkInfoEmpty
|
||||
}
|
||||
static func parse_deepLinkInfo(_ reader: BufferReader) -> DeepLinkInfo? {
|
||||
var _1: Int32?
|
||||
_1 = reader.readInt32()
|
||||
var _2: String?
|
||||
_2 = parseString(reader)
|
||||
var _3: [Api.MessageEntity]?
|
||||
if Int(_1!) & Int(1 << 1) != 0 {if let _ = reader.readInt32() {
|
||||
_3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self)
|
||||
} }
|
||||
let _c1 = _1 != nil
|
||||
let _c2 = _2 != nil
|
||||
let _c3 = (Int(_1!) & Int(1 << 1) == 0) || _3 != nil
|
||||
if _c1 && _c2 && _c3 {
|
||||
return Api.help.DeepLinkInfo.deepLinkInfo(flags: _1!, message: _2!, entities: _3)
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
public enum TermsOfService {
|
||||
case termsOfService(text: String)
|
||||
@ -2196,18 +2145,15 @@ public struct account {
|
||||
|
||||
}
|
||||
public enum PasswordSettings {
|
||||
case passwordSettings(email: String, secureSalt: Buffer, secureSecret: Buffer, secureSecretId: Int64)
|
||||
case passwordSettings(email: String)
|
||||
|
||||
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
||||
switch self {
|
||||
case .passwordSettings(let email, let secureSalt, let secureSecret, let secureSecretId):
|
||||
case .passwordSettings(let email):
|
||||
if boxed {
|
||||
buffer.appendInt32(2077869041)
|
||||
buffer.appendInt32(-1212732749)
|
||||
}
|
||||
serializeString(email, buffer: buffer, boxed: false)
|
||||
serializeBytes(secureSalt, buffer: buffer, boxed: false)
|
||||
serializeBytes(secureSecret, buffer: buffer, boxed: false)
|
||||
serializeInt64(secureSecretId, buffer: buffer, boxed: false)
|
||||
break
|
||||
}
|
||||
}
|
||||
@ -2215,18 +2161,9 @@ public struct account {
|
||||
static func parse_passwordSettings(_ reader: BufferReader) -> PasswordSettings? {
|
||||
var _1: String?
|
||||
_1 = parseString(reader)
|
||||
var _2: Buffer?
|
||||
_2 = parseBytes(reader)
|
||||
var _3: Buffer?
|
||||
_3 = parseBytes(reader)
|
||||
var _4: Int64?
|
||||
_4 = reader.readInt64()
|
||||
let _c1 = _1 != nil
|
||||
let _c2 = _2 != nil
|
||||
let _c3 = _3 != nil
|
||||
let _c4 = _4 != nil
|
||||
if _c1 && _c2 && _c3 && _c4 {
|
||||
return Api.account.PasswordSettings.passwordSettings(email: _1!, secureSalt: _2!, secureSecret: _3!, secureSecretId: _4!)
|
||||
if _c1 {
|
||||
return Api.account.PasswordSettings.passwordSettings(email: _1!)
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
@ -2235,22 +2172,19 @@ public struct account {
|
||||
|
||||
}
|
||||
public enum PasswordInputSettings {
|
||||
case passwordInputSettings(flags: Int32, newSalt: Buffer?, newPasswordHash: Buffer?, hint: String?, email: String?, newSecureSalt: Buffer?, newSecureSecret: Buffer?, newSecureSecretId: Int64?)
|
||||
case passwordInputSettings(flags: Int32, newSalt: Buffer?, newPasswordHash: Buffer?, hint: String?, email: String?)
|
||||
|
||||
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
||||
switch self {
|
||||
case .passwordInputSettings(let flags, let newSalt, let newPasswordHash, let hint, let email, let newSecureSalt, let newSecureSecret, let newSecureSecretId):
|
||||
case .passwordInputSettings(let flags, let newSalt, let newPasswordHash, let hint, let email):
|
||||
if boxed {
|
||||
buffer.appendInt32(570402317)
|
||||
buffer.appendInt32(-2037289493)
|
||||
}
|
||||
serializeInt32(flags, buffer: buffer, boxed: false)
|
||||
if Int(flags) & Int(1 << 0) != 0 {serializeBytes(newSalt!, buffer: buffer, boxed: false)}
|
||||
if Int(flags) & Int(1 << 0) != 0 {serializeBytes(newPasswordHash!, buffer: buffer, boxed: false)}
|
||||
if Int(flags) & Int(1 << 0) != 0 {serializeString(hint!, buffer: buffer, boxed: false)}
|
||||
if Int(flags) & Int(1 << 1) != 0 {serializeString(email!, buffer: buffer, boxed: false)}
|
||||
if Int(flags) & Int(1 << 2) != 0 {serializeBytes(newSecureSalt!, buffer: buffer, boxed: false)}
|
||||
if Int(flags) & Int(1 << 2) != 0 {serializeBytes(newSecureSecret!, buffer: buffer, boxed: false)}
|
||||
if Int(flags) & Int(1 << 2) != 0 {serializeInt64(newSecureSecretId!, buffer: buffer, boxed: false)}
|
||||
break
|
||||
}
|
||||
}
|
||||
@ -2266,22 +2200,13 @@ public struct account {
|
||||
if Int(_1!) & Int(1 << 0) != 0 {_4 = parseString(reader) }
|
||||
var _5: String?
|
||||
if Int(_1!) & Int(1 << 1) != 0 {_5 = parseString(reader) }
|
||||
var _6: Buffer?
|
||||
if Int(_1!) & Int(1 << 2) != 0 {_6 = parseBytes(reader) }
|
||||
var _7: Buffer?
|
||||
if Int(_1!) & Int(1 << 2) != 0 {_7 = parseBytes(reader) }
|
||||
var _8: Int64?
|
||||
if Int(_1!) & Int(1 << 2) != 0 {_8 = reader.readInt64() }
|
||||
let _c1 = _1 != nil
|
||||
let _c2 = (Int(_1!) & Int(1 << 0) == 0) || _2 != nil
|
||||
let _c3 = (Int(_1!) & Int(1 << 0) == 0) || _3 != nil
|
||||
let _c4 = (Int(_1!) & Int(1 << 0) == 0) || _4 != nil
|
||||
let _c5 = (Int(_1!) & Int(1 << 1) == 0) || _5 != nil
|
||||
let _c6 = (Int(_1!) & Int(1 << 2) == 0) || _6 != nil
|
||||
let _c7 = (Int(_1!) & Int(1 << 2) == 0) || _7 != nil
|
||||
let _c8 = (Int(_1!) & Int(1 << 2) == 0) || _8 != nil
|
||||
if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 {
|
||||
return Api.account.PasswordInputSettings.passwordInputSettings(flags: _1!, newSalt: _2, newPasswordHash: _3, hint: _4, email: _5, newSecureSalt: _6, newSecureSecret: _7, newSecureSecretId: _8)
|
||||
if _c1 && _c2 && _c3 && _c4 && _c5 {
|
||||
return Api.account.PasswordInputSettings.passwordInputSettings(flags: _1!, newSalt: _2, newPasswordHash: _3, hint: _4, email: _5)
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
@ -2331,37 +2256,6 @@ public struct account {
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
public enum SentEmailCode {
|
||||
case sentEmailCode(emailPattern: String, length: Int32)
|
||||
|
||||
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
||||
switch self {
|
||||
case .sentEmailCode(let emailPattern, let length):
|
||||
if boxed {
|
||||
buffer.appendInt32(-2128640689)
|
||||
}
|
||||
serializeString(emailPattern, buffer: buffer, boxed: false)
|
||||
serializeInt32(length, buffer: buffer, boxed: false)
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
static func parse_sentEmailCode(_ reader: BufferReader) -> SentEmailCode? {
|
||||
var _1: String?
|
||||
_1 = parseString(reader)
|
||||
var _2: Int32?
|
||||
_2 = reader.readInt32()
|
||||
let _c1 = _1 != nil
|
||||
let _c2 = _2 != nil
|
||||
if _c1 && _c2 {
|
||||
return Api.account.SentEmailCode.sentEmailCode(emailPattern: _1!, length: _2!)
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
public enum Authorizations {
|
||||
case authorizations(authorizations: [Api.Authorization])
|
||||
@ -2395,103 +2289,28 @@ public struct account {
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
public enum AuthorizationForm {
|
||||
case authorizationForm(flags: Int32, requiredTypes: [Api.SecureValueType], values: [Api.SecureValue], errors: [Api.SecureValueError], users: [Api.User], privacyPolicyUrl: String?)
|
||||
|
||||
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
||||
switch self {
|
||||
case .authorizationForm(let flags, let requiredTypes, let values, let errors, let users, let privacyPolicyUrl):
|
||||
if boxed {
|
||||
buffer.appendInt32(-879268525)
|
||||
}
|
||||
serializeInt32(flags, buffer: buffer, boxed: false)
|
||||
buffer.appendInt32(481674261)
|
||||
buffer.appendInt32(Int32(requiredTypes.count))
|
||||
for item in requiredTypes {
|
||||
item.serialize(buffer, true)
|
||||
}
|
||||
buffer.appendInt32(481674261)
|
||||
buffer.appendInt32(Int32(values.count))
|
||||
for item in values {
|
||||
item.serialize(buffer, true)
|
||||
}
|
||||
buffer.appendInt32(481674261)
|
||||
buffer.appendInt32(Int32(errors.count))
|
||||
for item in errors {
|
||||
item.serialize(buffer, true)
|
||||
}
|
||||
buffer.appendInt32(481674261)
|
||||
buffer.appendInt32(Int32(users.count))
|
||||
for item in users {
|
||||
item.serialize(buffer, true)
|
||||
}
|
||||
if Int(flags) & Int(1 << 0) != 0 {serializeString(privacyPolicyUrl!, buffer: buffer, boxed: false)}
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
static func parse_authorizationForm(_ reader: BufferReader) -> AuthorizationForm? {
|
||||
var _1: Int32?
|
||||
_1 = reader.readInt32()
|
||||
var _2: [Api.SecureValueType]?
|
||||
if let _ = reader.readInt32() {
|
||||
_2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.SecureValueType.self)
|
||||
}
|
||||
var _3: [Api.SecureValue]?
|
||||
if let _ = reader.readInt32() {
|
||||
_3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.SecureValue.self)
|
||||
}
|
||||
var _4: [Api.SecureValueError]?
|
||||
if let _ = reader.readInt32() {
|
||||
_4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.SecureValueError.self)
|
||||
}
|
||||
var _5: [Api.User]?
|
||||
if let _ = reader.readInt32() {
|
||||
_5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self)
|
||||
}
|
||||
var _6: String?
|
||||
if Int(_1!) & Int(1 << 0) != 0 {_6 = parseString(reader) }
|
||||
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 << 0) == 0) || _6 != nil
|
||||
if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 {
|
||||
return Api.account.AuthorizationForm.authorizationForm(flags: _1!, requiredTypes: _2!, values: _3!, errors: _4!, users: _5!, privacyPolicyUrl: _6)
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
public enum Password {
|
||||
case noPassword(newSalt: Buffer, newSecureSalt: Buffer, secureRandom: Buffer, emailUnconfirmedPattern: String)
|
||||
case password(flags: Int32, currentSalt: Buffer, newSalt: Buffer, newSecureSalt: Buffer, secureRandom: Buffer, hint: String, emailUnconfirmedPattern: String)
|
||||
case noPassword(newSalt: Buffer, emailUnconfirmedPattern: String)
|
||||
case password(currentSalt: Buffer, newSalt: Buffer, hint: String, hasRecovery: Api.Bool, emailUnconfirmedPattern: String)
|
||||
|
||||
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
||||
switch self {
|
||||
case .noPassword(let newSalt, let newSecureSalt, let secureRandom, let emailUnconfirmedPattern):
|
||||
case .noPassword(let newSalt, let emailUnconfirmedPattern):
|
||||
if boxed {
|
||||
buffer.appendInt32(1587643126)
|
||||
buffer.appendInt32(-1764049896)
|
||||
}
|
||||
serializeBytes(newSalt, buffer: buffer, boxed: false)
|
||||
serializeBytes(newSecureSalt, buffer: buffer, boxed: false)
|
||||
serializeBytes(secureRandom, buffer: buffer, boxed: false)
|
||||
serializeString(emailUnconfirmedPattern, buffer: buffer, boxed: false)
|
||||
break
|
||||
case .password(let flags, let currentSalt, let newSalt, let newSecureSalt, let secureRandom, let hint, let emailUnconfirmedPattern):
|
||||
case .password(let currentSalt, let newSalt, let hint, let hasRecovery, let emailUnconfirmedPattern):
|
||||
if boxed {
|
||||
buffer.appendInt32(-902187961)
|
||||
buffer.appendInt32(2081952796)
|
||||
}
|
||||
serializeInt32(flags, buffer: buffer, boxed: false)
|
||||
serializeBytes(currentSalt, buffer: buffer, boxed: false)
|
||||
serializeBytes(newSalt, buffer: buffer, boxed: false)
|
||||
serializeBytes(newSecureSalt, buffer: buffer, boxed: false)
|
||||
serializeBytes(secureRandom, buffer: buffer, boxed: false)
|
||||
serializeString(hint, buffer: buffer, boxed: false)
|
||||
hasRecovery.serialize(buffer, true)
|
||||
serializeString(emailUnconfirmedPattern, buffer: buffer, boxed: false)
|
||||
break
|
||||
}
|
||||
@ -2500,47 +2319,37 @@ public struct account {
|
||||
static func parse_noPassword(_ reader: BufferReader) -> Password? {
|
||||
var _1: Buffer?
|
||||
_1 = parseBytes(reader)
|
||||
var _2: Buffer?
|
||||
_2 = parseBytes(reader)
|
||||
var _3: Buffer?
|
||||
_3 = parseBytes(reader)
|
||||
var _4: String?
|
||||
_4 = parseString(reader)
|
||||
var _2: String?
|
||||
_2 = parseString(reader)
|
||||
let _c1 = _1 != nil
|
||||
let _c2 = _2 != nil
|
||||
let _c3 = _3 != nil
|
||||
let _c4 = _4 != nil
|
||||
if _c1 && _c2 && _c3 && _c4 {
|
||||
return Api.account.Password.noPassword(newSalt: _1!, newSecureSalt: _2!, secureRandom: _3!, emailUnconfirmedPattern: _4!)
|
||||
if _c1 && _c2 {
|
||||
return Api.account.Password.noPassword(newSalt: _1!, emailUnconfirmedPattern: _2!)
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
static func parse_password(_ reader: BufferReader) -> Password? {
|
||||
var _1: Int32?
|
||||
_1 = reader.readInt32()
|
||||
var _1: Buffer?
|
||||
_1 = parseBytes(reader)
|
||||
var _2: Buffer?
|
||||
_2 = parseBytes(reader)
|
||||
var _3: Buffer?
|
||||
_3 = parseBytes(reader)
|
||||
var _4: Buffer?
|
||||
_4 = parseBytes(reader)
|
||||
var _5: Buffer?
|
||||
_5 = parseBytes(reader)
|
||||
var _6: String?
|
||||
_6 = parseString(reader)
|
||||
var _7: String?
|
||||
_7 = parseString(reader)
|
||||
var _3: String?
|
||||
_3 = parseString(reader)
|
||||
var _4: Api.Bool?
|
||||
if let signature = reader.readInt32() {
|
||||
_4 = Api.parse(reader, signature: signature) as? Api.Bool
|
||||
}
|
||||
var _5: String?
|
||||
_5 = parseString(reader)
|
||||
let _c1 = _1 != nil
|
||||
let _c2 = _2 != nil
|
||||
let _c3 = _3 != nil
|
||||
let _c4 = _4 != nil
|
||||
let _c5 = _5 != nil
|
||||
let _c6 = _6 != nil
|
||||
let _c7 = _7 != nil
|
||||
if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 {
|
||||
return Api.account.Password.password(flags: _1!, currentSalt: _2!, newSalt: _3!, newSecureSalt: _4!, secureRandom: _5!, hint: _6!, emailUnconfirmedPattern: _7!)
|
||||
if _c1 && _c2 && _c3 && _c4 && _c5 {
|
||||
return Api.account.Password.password(currentSalt: _1!, newSalt: _2!, hint: _3!, hasRecovery: _4!, emailUnconfirmedPattern: _5!)
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
|
@ -1031,28 +1031,6 @@ public extension Api {
|
||||
})
|
||||
}
|
||||
|
||||
public static func editInlineBotMessage(flags: Int32, id: Api.InputBotInlineMessageID, message: String?, replyMarkup: Api.ReplyMarkup?, entities: [Api.MessageEntity]?) -> (CustomStringConvertible, Buffer, (Buffer) -> Api.Bool?) {
|
||||
let buffer = Buffer()
|
||||
buffer.appendInt32(319564933)
|
||||
serializeInt32(flags, buffer: buffer, boxed: false)
|
||||
id.serialize(buffer, true)
|
||||
if Int(flags) & Int(1 << 11) != 0 {serializeString(message!, buffer: buffer, boxed: false)}
|
||||
if Int(flags) & Int(1 << 2) != 0 {replyMarkup!.serialize(buffer, true)}
|
||||
if Int(flags) & Int(1 << 3) != 0 {buffer.appendInt32(481674261)
|
||||
buffer.appendInt32(Int32(entities!.count))
|
||||
for item in entities! {
|
||||
item.serialize(buffer, true)
|
||||
}}
|
||||
return (FunctionDescription({return "(messages.editInlineBotMessage flags: \(flags), id: \(id), message: \(String(describing: message)), replyMarkup: \(String(describing: replyMarkup)), entities: \(String(describing: entities)))"}), buffer, { (buffer: Buffer) -> Api.Bool? in
|
||||
let reader = BufferReader(buffer)
|
||||
var result: Api.Bool?
|
||||
if let signature = reader.readInt32() {
|
||||
result = Api.parse(reader, signature: signature) as? Api.Bool
|
||||
}
|
||||
return result
|
||||
})
|
||||
}
|
||||
|
||||
public static func getBotCallbackAnswer(flags: Int32, peer: Api.InputPeer, msgId: Int32, data: Buffer?) -> (CustomStringConvertible, Buffer, (Buffer) -> Api.messages.BotCallbackAnswer?) {
|
||||
let buffer = Buffer()
|
||||
buffer.appendInt32(-2130010132)
|
||||
@ -1801,6 +1779,30 @@ public extension Api {
|
||||
})
|
||||
}
|
||||
|
||||
public static func editInlineBotMessage(flags: Int32, id: Api.InputBotInlineMessageID, message: String?, media: Api.InputMedia?, replyMarkup: Api.ReplyMarkup?, entities: [Api.MessageEntity]?, geoPoint: Api.InputGeoPoint?) -> (CustomStringConvertible, Buffer, (Buffer) -> Api.Bool?) {
|
||||
let buffer = Buffer()
|
||||
buffer.appendInt32(-1379669976)
|
||||
serializeInt32(flags, buffer: buffer, boxed: false)
|
||||
id.serialize(buffer, true)
|
||||
if Int(flags) & Int(1 << 11) != 0 {serializeString(message!, buffer: buffer, boxed: false)}
|
||||
if Int(flags) & Int(1 << 14) != 0 {media!.serialize(buffer, true)}
|
||||
if Int(flags) & Int(1 << 2) != 0 {replyMarkup!.serialize(buffer, true)}
|
||||
if Int(flags) & Int(1 << 3) != 0 {buffer.appendInt32(481674261)
|
||||
buffer.appendInt32(Int32(entities!.count))
|
||||
for item in entities! {
|
||||
item.serialize(buffer, true)
|
||||
}}
|
||||
if Int(flags) & Int(1 << 13) != 0 {geoPoint!.serialize(buffer, true)}
|
||||
return (FunctionDescription({return "(messages.editInlineBotMessage flags: \(flags), id: \(id), message: \(String(describing: message)), media: \(String(describing: media)), replyMarkup: \(String(describing: replyMarkup)), entities: \(String(describing: entities)), geoPoint: \(String(describing: geoPoint)))"}), buffer, { (buffer: Buffer) -> Api.Bool? in
|
||||
let reader = BufferReader(buffer)
|
||||
var result: Api.Bool?
|
||||
if let signature = reader.readInt32() {
|
||||
result = Api.parse(reader, signature: signature) as? Api.Bool
|
||||
}
|
||||
return result
|
||||
})
|
||||
}
|
||||
|
||||
public static func getStickers(emoticon: String, hash: Int32) -> (CustomStringConvertible, Buffer, (Buffer) -> Api.messages.Stickers?) {
|
||||
let buffer = Buffer()
|
||||
buffer.appendInt32(71126828)
|
||||
@ -2770,25 +2772,6 @@ public extension Api {
|
||||
return result
|
||||
})
|
||||
}
|
||||
|
||||
public static func setSecureValueErrors(id: Api.InputUser, errors: [Api.SecureValueError]) -> (CustomStringConvertible, Buffer, (Buffer) -> Api.Bool?) {
|
||||
let buffer = Buffer()
|
||||
buffer.appendInt32(-1865902923)
|
||||
id.serialize(buffer, true)
|
||||
buffer.appendInt32(481674261)
|
||||
buffer.appendInt32(Int32(errors.count))
|
||||
for item in errors {
|
||||
item.serialize(buffer, true)
|
||||
}
|
||||
return (FunctionDescription({return "(users.setSecureValueErrors id: \(id), errors: \(errors))"}), buffer, { (buffer: Buffer) -> Api.Bool? in
|
||||
let reader = BufferReader(buffer)
|
||||
var result: Api.Bool?
|
||||
if let signature = reader.readInt32() {
|
||||
result = Api.parse(reader, signature: signature) as? Api.Bool
|
||||
}
|
||||
return result
|
||||
})
|
||||
}
|
||||
}
|
||||
public struct contacts {
|
||||
public static func getStatuses() -> (CustomStringConvertible, Buffer, (Buffer) -> [Api.ContactStatus]?) {
|
||||
@ -3122,20 +3105,6 @@ public extension Api {
|
||||
})
|
||||
}
|
||||
|
||||
public static func getTermsOfService() -> (CustomStringConvertible, Buffer, (Buffer) -> Api.help.TermsOfService?) {
|
||||
let buffer = Buffer()
|
||||
buffer.appendInt32(889286899)
|
||||
|
||||
return (FunctionDescription({return "(help.getTermsOfService )"}), buffer, { (buffer: Buffer) -> Api.help.TermsOfService? in
|
||||
let reader = BufferReader(buffer)
|
||||
var result: Api.help.TermsOfService?
|
||||
if let signature = reader.readInt32() {
|
||||
result = Api.parse(reader, signature: signature) as? Api.help.TermsOfService
|
||||
}
|
||||
return result
|
||||
})
|
||||
}
|
||||
|
||||
public static func setBotUpdatesStatus(pendingUpdatesCount: Int32, message: String) -> (CustomStringConvertible, Buffer, (Buffer) -> Api.Bool?) {
|
||||
let buffer = Buffer()
|
||||
buffer.appendInt32(-333262899)
|
||||
@ -3207,15 +3176,16 @@ public extension Api {
|
||||
})
|
||||
}
|
||||
|
||||
public static func getDeepLinkInfo(path: String) -> (CustomStringConvertible, Buffer, (Buffer) -> Api.help.DeepLinkInfo?) {
|
||||
public static func getTermsOfService(countryIso2: String, langCode: String) -> (CustomStringConvertible, Buffer, (Buffer) -> Api.help.TermsOfService?) {
|
||||
let buffer = Buffer()
|
||||
buffer.appendInt32(1072547679)
|
||||
serializeString(path, buffer: buffer, boxed: false)
|
||||
return (FunctionDescription({return "(help.getDeepLinkInfo path: \(path))"}), buffer, { (buffer: Buffer) -> Api.help.DeepLinkInfo? in
|
||||
buffer.appendInt32(-92706236)
|
||||
serializeString(countryIso2, buffer: buffer, boxed: false)
|
||||
serializeString(langCode, buffer: buffer, boxed: false)
|
||||
return (FunctionDescription({return "(help.getTermsOfService countryIso2: \(countryIso2), langCode: \(langCode))"}), buffer, { (buffer: Buffer) -> Api.help.TermsOfService? in
|
||||
let reader = BufferReader(buffer)
|
||||
var result: Api.help.DeepLinkInfo?
|
||||
var result: Api.help.TermsOfService?
|
||||
if let signature = reader.readInt32() {
|
||||
result = Api.parse(reader, signature: signature) as? Api.help.DeepLinkInfo
|
||||
result = Api.parse(reader, signature: signature) as? Api.help.TermsOfService
|
||||
}
|
||||
return result
|
||||
})
|
||||
@ -3852,170 +3822,6 @@ public extension Api {
|
||||
return result
|
||||
})
|
||||
}
|
||||
|
||||
public static func getAllSecureValues() -> (CustomStringConvertible, Buffer, (Buffer) -> [Api.SecureValue]?) {
|
||||
let buffer = Buffer()
|
||||
buffer.appendInt32(-1299661699)
|
||||
|
||||
return (FunctionDescription({return "(account.getAllSecureValues )"}), buffer, { (buffer: Buffer) -> [Api.SecureValue]? in
|
||||
let reader = BufferReader(buffer)
|
||||
var result: [Api.SecureValue]?
|
||||
if let _ = reader.readInt32() {
|
||||
result = Api.parseVector(reader, elementSignature: 0, elementType: Api.SecureValue.self)
|
||||
}
|
||||
return result
|
||||
})
|
||||
}
|
||||
|
||||
public static func getSecureValue(types: [Api.SecureValueType]) -> (CustomStringConvertible, Buffer, (Buffer) -> [Api.SecureValue]?) {
|
||||
let buffer = Buffer()
|
||||
buffer.appendInt32(1936088002)
|
||||
buffer.appendInt32(481674261)
|
||||
buffer.appendInt32(Int32(types.count))
|
||||
for item in types {
|
||||
item.serialize(buffer, true)
|
||||
}
|
||||
return (FunctionDescription({return "(account.getSecureValue types: \(types))"}), buffer, { (buffer: Buffer) -> [Api.SecureValue]? in
|
||||
let reader = BufferReader(buffer)
|
||||
var result: [Api.SecureValue]?
|
||||
if let _ = reader.readInt32() {
|
||||
result = Api.parseVector(reader, elementSignature: 0, elementType: Api.SecureValue.self)
|
||||
}
|
||||
return result
|
||||
})
|
||||
}
|
||||
|
||||
public static func saveSecureValue(value: Api.InputSecureValue, secureSecretId: Int64) -> (CustomStringConvertible, Buffer, (Buffer) -> Api.SecureValue?) {
|
||||
let buffer = Buffer()
|
||||
buffer.appendInt32(-1986010339)
|
||||
value.serialize(buffer, true)
|
||||
serializeInt64(secureSecretId, buffer: buffer, boxed: false)
|
||||
return (FunctionDescription({return "(account.saveSecureValue value: \(value), secureSecretId: \(secureSecretId))"}), buffer, { (buffer: Buffer) -> Api.SecureValue? in
|
||||
let reader = BufferReader(buffer)
|
||||
var result: Api.SecureValue?
|
||||
if let signature = reader.readInt32() {
|
||||
result = Api.parse(reader, signature: signature) as? Api.SecureValue
|
||||
}
|
||||
return result
|
||||
})
|
||||
}
|
||||
|
||||
public static func deleteSecureValue(types: [Api.SecureValueType]) -> (CustomStringConvertible, Buffer, (Buffer) -> Api.Bool?) {
|
||||
let buffer = Buffer()
|
||||
buffer.appendInt32(-1199522741)
|
||||
buffer.appendInt32(481674261)
|
||||
buffer.appendInt32(Int32(types.count))
|
||||
for item in types {
|
||||
item.serialize(buffer, true)
|
||||
}
|
||||
return (FunctionDescription({return "(account.deleteSecureValue types: \(types))"}), buffer, { (buffer: Buffer) -> Api.Bool? in
|
||||
let reader = BufferReader(buffer)
|
||||
var result: Api.Bool?
|
||||
if let signature = reader.readInt32() {
|
||||
result = Api.parse(reader, signature: signature) as? Api.Bool
|
||||
}
|
||||
return result
|
||||
})
|
||||
}
|
||||
|
||||
public static func getAuthorizationForm(botId: Int32, scope: String, publicKey: String) -> (CustomStringConvertible, Buffer, (Buffer) -> Api.account.AuthorizationForm?) {
|
||||
let buffer = Buffer()
|
||||
buffer.appendInt32(-1200903967)
|
||||
serializeInt32(botId, buffer: buffer, boxed: false)
|
||||
serializeString(scope, buffer: buffer, boxed: false)
|
||||
serializeString(publicKey, buffer: buffer, boxed: false)
|
||||
return (FunctionDescription({return "(account.getAuthorizationForm botId: \(botId), scope: \(scope), publicKey: \(publicKey))"}), buffer, { (buffer: Buffer) -> Api.account.AuthorizationForm? in
|
||||
let reader = BufferReader(buffer)
|
||||
var result: Api.account.AuthorizationForm?
|
||||
if let signature = reader.readInt32() {
|
||||
result = Api.parse(reader, signature: signature) as? Api.account.AuthorizationForm
|
||||
}
|
||||
return result
|
||||
})
|
||||
}
|
||||
|
||||
public static func acceptAuthorization(botId: Int32, scope: String, publicKey: String, valueHashes: [Api.SecureValueHash], credentials: Api.SecureCredentialsEncrypted) -> (CustomStringConvertible, Buffer, (Buffer) -> Api.Bool?) {
|
||||
let buffer = Buffer()
|
||||
buffer.appendInt32(-419267436)
|
||||
serializeInt32(botId, buffer: buffer, boxed: false)
|
||||
serializeString(scope, buffer: buffer, boxed: false)
|
||||
serializeString(publicKey, buffer: buffer, boxed: false)
|
||||
buffer.appendInt32(481674261)
|
||||
buffer.appendInt32(Int32(valueHashes.count))
|
||||
for item in valueHashes {
|
||||
item.serialize(buffer, true)
|
||||
}
|
||||
credentials.serialize(buffer, true)
|
||||
return (FunctionDescription({return "(account.acceptAuthorization botId: \(botId), scope: \(scope), publicKey: \(publicKey), valueHashes: \(valueHashes), credentials: \(credentials))"}), buffer, { (buffer: Buffer) -> Api.Bool? in
|
||||
let reader = BufferReader(buffer)
|
||||
var result: Api.Bool?
|
||||
if let signature = reader.readInt32() {
|
||||
result = Api.parse(reader, signature: signature) as? Api.Bool
|
||||
}
|
||||
return result
|
||||
})
|
||||
}
|
||||
|
||||
public static func sendVerifyPhoneCode(flags: Int32, phoneNumber: String, currentNumber: Api.Bool?) -> (CustomStringConvertible, Buffer, (Buffer) -> Api.auth.SentCode?) {
|
||||
let buffer = Buffer()
|
||||
buffer.appendInt32(-2110553932)
|
||||
serializeInt32(flags, buffer: buffer, boxed: false)
|
||||
serializeString(phoneNumber, buffer: buffer, boxed: false)
|
||||
if Int(flags) & Int(1 << 0) != 0 {currentNumber!.serialize(buffer, true)}
|
||||
return (FunctionDescription({return "(account.sendVerifyPhoneCode flags: \(flags), phoneNumber: \(phoneNumber), currentNumber: \(String(describing: currentNumber)))"}), buffer, { (buffer: Buffer) -> Api.auth.SentCode? in
|
||||
let reader = BufferReader(buffer)
|
||||
var result: Api.auth.SentCode?
|
||||
if let signature = reader.readInt32() {
|
||||
result = Api.parse(reader, signature: signature) as? Api.auth.SentCode
|
||||
}
|
||||
return result
|
||||
})
|
||||
}
|
||||
|
||||
public static func verifyPhone(phoneNumber: String, phoneCodeHash: String, phoneCode: String) -> (CustomStringConvertible, Buffer, (Buffer) -> Api.Bool?) {
|
||||
let buffer = Buffer()
|
||||
buffer.appendInt32(1305716726)
|
||||
serializeString(phoneNumber, buffer: buffer, boxed: false)
|
||||
serializeString(phoneCodeHash, buffer: buffer, boxed: false)
|
||||
serializeString(phoneCode, buffer: buffer, boxed: false)
|
||||
return (FunctionDescription({return "(account.verifyPhone phoneNumber: \(phoneNumber), phoneCodeHash: \(phoneCodeHash), phoneCode: \(phoneCode))"}), buffer, { (buffer: Buffer) -> Api.Bool? in
|
||||
let reader = BufferReader(buffer)
|
||||
var result: Api.Bool?
|
||||
if let signature = reader.readInt32() {
|
||||
result = Api.parse(reader, signature: signature) as? Api.Bool
|
||||
}
|
||||
return result
|
||||
})
|
||||
}
|
||||
|
||||
public static func sendVerifyEmailCode(email: String) -> (CustomStringConvertible, Buffer, (Buffer) -> Api.account.SentEmailCode?) {
|
||||
let buffer = Buffer()
|
||||
buffer.appendInt32(1880182943)
|
||||
serializeString(email, buffer: buffer, boxed: false)
|
||||
return (FunctionDescription({return "(account.sendVerifyEmailCode email: \(email))"}), buffer, { (buffer: Buffer) -> Api.account.SentEmailCode? in
|
||||
let reader = BufferReader(buffer)
|
||||
var result: Api.account.SentEmailCode?
|
||||
if let signature = reader.readInt32() {
|
||||
result = Api.parse(reader, signature: signature) as? Api.account.SentEmailCode
|
||||
}
|
||||
return result
|
||||
})
|
||||
}
|
||||
|
||||
public static func verifyEmail(email: String, code: String) -> (CustomStringConvertible, Buffer, (Buffer) -> Api.Bool?) {
|
||||
let buffer = Buffer()
|
||||
buffer.appendInt32(-323339813)
|
||||
serializeString(email, buffer: buffer, boxed: false)
|
||||
serializeString(code, buffer: buffer, boxed: false)
|
||||
return (FunctionDescription({return "(account.verifyEmail email: \(email), code: \(code))"}), buffer, { (buffer: Buffer) -> Api.Bool? in
|
||||
let reader = BufferReader(buffer)
|
||||
var result: Api.Bool?
|
||||
if let signature = reader.readInt32() {
|
||||
result = Api.parse(reader, signature: signature) as? Api.Bool
|
||||
}
|
||||
return result
|
||||
})
|
||||
}
|
||||
}
|
||||
public struct langpack {
|
||||
public static func getLangPack(langCode: String) -> (CustomStringConvertible, Buffer, (Buffer) -> Api.LangPackDifference?) {
|
||||
|
@ -156,7 +156,7 @@ public func authorizeWithCode(account: UnauthorizedAccount, code: String) -> Sig
|
||||
switch result {
|
||||
case .noPassword:
|
||||
return .fail(.generic)
|
||||
case let .password(_, _, _, _, _, hint, _):
|
||||
case let .password(_, _, hint, _, _):
|
||||
return .single(.password(hint: hint))
|
||||
}
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ class Download: NSObject, MTRequestMessageServiceDelegate {
|
||||
|
||||
self.mtProto = MTProto(context: self.context, datacenterId: datacenterId, usageCalculationInfo: usageInfo)
|
||||
self.mtProto.cdn = isCdn
|
||||
self.mtProto.useTempAuthKeys = !isCdn
|
||||
self.mtProto.useTempAuthKeys = self.context.useTempAuthKeys && !isCdn
|
||||
self.mtProto.media = true;
|
||||
if !isCdn && datacenterId != masterDatacenterId {
|
||||
self.mtProto.authTokenMasterDatacenterId = masterDatacenterId
|
||||
|
@ -9,7 +9,7 @@ import Foundation
|
||||
import SwiftSignalKit
|
||||
#endif
|
||||
|
||||
func apiSecureValueType(value: SecureIdValue) -> Api.SecureValueType {
|
||||
/*func apiSecureValueType(value: SecureIdValue) -> Api.SecureValueType {
|
||||
let type: Api.SecureValueType
|
||||
switch value {
|
||||
case .personalDetails:
|
||||
@ -173,14 +173,15 @@ private func encryptedCredentialsData(data: Data, secretData: Data) -> (data: Da
|
||||
return nil
|
||||
}
|
||||
return (encryptedData, hash)
|
||||
}
|
||||
}*/
|
||||
|
||||
public enum GrantSecureIdAccessError {
|
||||
case generic
|
||||
}
|
||||
|
||||
public func grantSecureIdAccess(network: Network, peerId: PeerId, publicKey: String, scope: String, opaquePayload: Data, values: [SecureIdValueWithContext]) -> Signal<Void, GrantSecureIdAccessError> {
|
||||
guard peerId.namespace == Namespaces.Peer.CloudUser else {
|
||||
return .never()
|
||||
/*guard peerId.namespace == Namespaces.Peer.CloudUser else {
|
||||
return .fail(.generic)
|
||||
}
|
||||
guard let credentialsSecretData = generateSecureSecretData() else {
|
||||
@ -207,5 +208,5 @@ public func grantSecureIdAccess(network: Network, peerId: PeerId, publicKey: Str
|
||||
}
|
||||
|> mapToSignal { _ -> Signal<Void, GrantSecureIdAccessError> in
|
||||
return .complete()
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
@ -342,7 +342,7 @@ func initializedNetwork(arguments: NetworkInitializationArguments, supplementary
|
||||
|
||||
apiEnvironment = apiEnvironment.withUpdatedNetworkSettings((networkSettings ?? NetworkSettings.defaultSettings).mtNetworkSettings)
|
||||
|
||||
let context = MTContext(serialization: serialization, apiEnvironment: apiEnvironment, useTempAuthKeys: true)!
|
||||
let context = MTContext(serialization: serialization, apiEnvironment: apiEnvironment, useTempAuthKeys: false)!
|
||||
|
||||
let seedAddressList: [Int: [String]]
|
||||
|
||||
@ -373,7 +373,7 @@ func initializedNetwork(arguments: NetworkInitializationArguments, supplementary
|
||||
#endif
|
||||
|
||||
let mtProto = MTProto(context: context, datacenterId: datacenterId, usageCalculationInfo: usageCalculationInfo(basePath: basePath, category: nil))!
|
||||
mtProto.useTempAuthKeys = true
|
||||
mtProto.useTempAuthKeys = context.useTempAuthKeys
|
||||
|
||||
let connectionStatus = Promise<ConnectionStatus>(.waitingForNetwork)
|
||||
|
||||
|
@ -14,7 +14,7 @@ public enum RequestSecureIdFormError {
|
||||
case serverError(String)
|
||||
}
|
||||
|
||||
private func parseSecureValueType(_ type: Api.SecureValueType, selfie: Bool) -> SecureIdRequestedFormField {
|
||||
/*private func parseSecureValueType(_ type: Api.SecureValueType, selfie: Bool) -> SecureIdRequestedFormField {
|
||||
switch type {
|
||||
case .secureValueTypePersonalDetails:
|
||||
return .personalDetails
|
||||
@ -50,13 +50,13 @@ private func parseSecureData(_ value: Api.SecureData) -> (data: Data, hash: Data
|
||||
case let .secureData(data, dataHash, secret):
|
||||
return (data.makeData(), dataHash.makeData(), secret.makeData())
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
struct ParsedSecureValue {
|
||||
let valueWithContext: SecureIdValueWithContext
|
||||
}
|
||||
|
||||
func parseSecureValue(context: SecureIdAccessContext, value: Api.SecureValue, errors: [Api.SecureValueError]) -> ParsedSecureValue? {
|
||||
/*func parseSecureValue(context: SecureIdAccessContext, value: Api.SecureValue, errors: [Api.SecureValueError]) -> ParsedSecureValue? {
|
||||
switch value {
|
||||
case let .secureValue(_, type, data, frontSide, reverseSide, selfie, files, plainData, hash):
|
||||
let parsedFileReferences = files.flatMap { $0.compactMap(SecureIdFileReference.init) } ?? []
|
||||
@ -221,19 +221,20 @@ func parseSecureValue(context: SecureIdAccessContext, value: Api.SecureValue, er
|
||||
|
||||
private func parseSecureValues(context: SecureIdAccessContext, values: [Api.SecureValue], errors: [Api.SecureValueError]) -> [SecureIdValueWithContext] {
|
||||
return values.map({ parseSecureValue(context: context, value: $0, errors: errors) }).compactMap({ $0?.valueWithContext })
|
||||
}
|
||||
}*/
|
||||
|
||||
public struct EncryptedSecureIdForm {
|
||||
public let peerId: PeerId
|
||||
public let requestedFields: [SecureIdRequestedFormField]
|
||||
public let termsUrl: String?
|
||||
|
||||
let encryptedValues: [Api.SecureValue]
|
||||
let errors: [Api.SecureValueError]
|
||||
/*let encryptedValues: [Api.SecureValue]
|
||||
let errors: [Api.SecureValueError]*/
|
||||
}
|
||||
|
||||
public func requestSecureIdForm(postbox: Postbox, network: Network, peerId: PeerId, scope: String, publicKey: String) -> Signal<EncryptedSecureIdForm, RequestSecureIdFormError> {
|
||||
if peerId.namespace != Namespaces.Peer.CloudUser {
|
||||
return .never()
|
||||
/*if peerId.namespace != Namespaces.Peer.CloudUser {
|
||||
return .fail(.serverError("PEER IS NOT A BOT"))
|
||||
}
|
||||
return network.request(Api.functions.account.getAuthorizationForm(botId: peerId.id, scope: scope, publicKey: publicKey))
|
||||
@ -258,9 +259,10 @@ public func requestSecureIdForm(postbox: Postbox, network: Network, peerId: Peer
|
||||
}, termsUrl: termsUrl, encryptedValues: values, errors: errors)
|
||||
}
|
||||
} |> mapError { _ in return RequestSecureIdFormError.generic }
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
public func decryptedSecureIdForm(context: SecureIdAccessContext, form: EncryptedSecureIdForm) -> SecureIdForm? {
|
||||
return SecureIdForm(peerId: form.peerId, requestedFields: form.requestedFields, values: parseSecureValues(context: context, values: form.encryptedValues, errors: form.errors))
|
||||
return nil
|
||||
//return SecureIdForm(peerId: form.peerId, requestedFields: form.requestedFields, values: parseSecureValues(context: context, values: form.encryptedValues, errors: form.errors))
|
||||
}
|
||||
|
@ -87,7 +87,7 @@ func decryptedSecureValueData(context: SecureIdValueAccessContext, encryptedData
|
||||
return unpaddedValueData
|
||||
}
|
||||
|
||||
private func apiInputSecretFile(_ file: SecureIdVerificationDocumentReference) -> Api.InputSecureFile {
|
||||
/*private func apiInputSecretFile(_ file: SecureIdVerificationDocumentReference) -> Api.InputSecureFile {
|
||||
switch file {
|
||||
case let .remote(file):
|
||||
return Api.InputSecureFile.inputSecureFile(id: file.id, accessHash: file.accessHash)
|
||||
@ -202,10 +202,11 @@ private func makeInputSecureValue(context: SecureIdAccessContext, value: SecureI
|
||||
}
|
||||
|
||||
return Api.InputSecureValue.inputSecureValue(flags: flags, type: inputData.type, data: secureData, frontSide: inputData.frontSideReference.flatMap(apiInputSecretFile), reverseSide: inputData.backSideReference.flatMap(apiInputSecretFile), selfie: inputData.selfieReference.flatMap(apiInputSecretFile), files: files, plainData: inputData.publicData)
|
||||
}
|
||||
}*/
|
||||
|
||||
public func saveSecureIdValue(postbox: Postbox, network: Network, context: SecureIdAccessContext, value: SecureIdValue, uploadedFiles: [Data: Data]) -> Signal<SecureIdValueWithContext, SaveSecureIdValueError> {
|
||||
let delete = deleteSecureIdValues(network: network, keys: Set([value.key]))
|
||||
return .never()
|
||||
/*let delete = deleteSecureIdValues(network: network, keys: Set([value.key]))
|
||||
|> mapError { _ -> SaveSecureIdValueError in
|
||||
return .generic
|
||||
}
|
||||
@ -245,7 +246,7 @@ public func saveSecureIdValue(postbox: Postbox, network: Network, context: Secur
|
||||
return .single(parsedValue.valueWithContext)
|
||||
}
|
||||
|
||||
return delete |> then(save)
|
||||
return delete |> then(save)*/
|
||||
}
|
||||
|
||||
public enum DeleteSecureIdValueError {
|
||||
@ -253,17 +254,19 @@ public enum DeleteSecureIdValueError {
|
||||
}
|
||||
|
||||
public func deleteSecureIdValues(network: Network, keys: Set<SecureIdValueKey>) -> Signal<Void, DeleteSecureIdValueError> {
|
||||
return network.request(Api.functions.account.deleteSecureValue(types: keys.map(apiSecureValueType(key:))))
|
||||
return .never()
|
||||
/*return network.request(Api.functions.account.deleteSecureValue(types: keys.map(apiSecureValueType(key:))))
|
||||
|> mapError { _ -> DeleteSecureIdValueError in
|
||||
return .generic
|
||||
}
|
||||
|> mapToSignal { _ -> Signal<Void, DeleteSecureIdValueError> in
|
||||
return .complete()
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
public func dropSecureId(network: Network, currentPassword: String) -> Signal<Void, AuthorizationPasswordVerificationError> {
|
||||
return twoStepAuthData(network)
|
||||
return .never()
|
||||
/*return twoStepAuthData(network)
|
||||
|> mapError { _ -> AuthorizationPasswordVerificationError in
|
||||
return .generic
|
||||
}
|
||||
@ -292,5 +295,5 @@ public func dropSecureId(network: Network, currentPassword: String) -> Signal<Vo
|
||||
return network.request(Api.functions.account.updatePasswordSettings(currentPasswordHash: currentPasswordHash, newSettings: Api.account.PasswordInputSettings.passwordInputSettings(flags: flags, newSalt: secureSalt, newPasswordHash: currentPasswordHash, hint: nil, email: email, newSecureSalt: secureSalt, newSecureSecret: nil, newSecureSecretId: nil)), automaticFloodWait: false) |> map {_ in} |> mapError {_ in return AuthorizationPasswordVerificationError.generic}
|
||||
}
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
@ -45,7 +45,8 @@ public class SecureFileMediaResource: TelegramCloudMediaResource, TelegramMultip
|
||||
}
|
||||
|
||||
var apiInputLocation: Api.InputFileLocation {
|
||||
return Api.InputFileLocation.inputSecureFileLocation(id: self.file.id, accessHash: self.file.accessHash)
|
||||
preconditionFailure()
|
||||
//return Api.InputFileLocation.inputSecureFileLocation(id: self.file.id, accessHash: self.file.accessHash)
|
||||
}
|
||||
|
||||
public init(file: SecureIdFileReference) {
|
||||
|
@ -27,7 +27,7 @@ public struct SecureIdFileReference: Equatable {
|
||||
let encryptedSecret: Data
|
||||
}
|
||||
|
||||
extension SecureIdFileReference {
|
||||
/*extension SecureIdFileReference {
|
||||
init?(apiFile: Api.SecureFile) {
|
||||
switch apiFile {
|
||||
case let .secureFile(id, accessHash, size, dcId, date, fileHash, secret):
|
||||
@ -36,7 +36,7 @@ extension SecureIdFileReference {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
extension SecureIdGender {
|
||||
init?(serializedString: String) {
|
||||
|
@ -57,7 +57,7 @@ public enum SecureIdValueContentErrorAddressField: String, Hashable {
|
||||
|
||||
public typealias SecureIdValueContentError = String
|
||||
|
||||
func parseSecureIdValueContentErrors(dataHash: Data?, fileHashes: Set<Data>, selfieHash: Data?, frontSideHash: Data?, backSideHash: Data?, errors: [Api.SecureValueError]) -> [SecureIdValueContentErrorKey: SecureIdValueContentError] {
|
||||
/*func parseSecureIdValueContentErrors(dataHash: Data?, fileHashes: Set<Data>, selfieHash: Data?, frontSideHash: Data?, backSideHash: Data?, errors: [Api.SecureValueError]) -> [SecureIdValueContentErrorKey: SecureIdValueContentError] {
|
||||
var result: [SecureIdValueContentErrorKey: SecureIdValueContentError] = [:]
|
||||
for error in errors {
|
||||
switch error {
|
||||
@ -122,4 +122,4 @@ func parseSecureIdValueContentErrors(dataHash: Data?, fileHashes: Set<Data>, sel
|
||||
}
|
||||
}
|
||||
return result
|
||||
}
|
||||
}*/
|
||||
|
@ -93,7 +93,7 @@ public class BoxedMessage: NSObject {
|
||||
|
||||
public class Serialization: NSObject, MTSerialization {
|
||||
public func currentLayer() -> UInt {
|
||||
return 80
|
||||
return 79
|
||||
}
|
||||
|
||||
public func parseMessage(_ data: Data!) -> Any! {
|
||||
|
@ -204,7 +204,7 @@ func apiMessagePeerIds(_ message: Api.Message) -> [PeerId] {
|
||||
}
|
||||
|
||||
switch action {
|
||||
case .messageActionChannelCreate, .messageActionChatDeletePhoto, .messageActionChatEditPhoto, .messageActionChatEditTitle, .messageActionEmpty, .messageActionPinMessage, .messageActionHistoryClear, .messageActionGameScore, .messageActionPaymentSent, .messageActionPaymentSentMe, .messageActionPhoneCall, .messageActionScreenshotTaken, .messageActionCustomAction, .messageActionBotAllowed, .messageActionSecureValuesSent, .messageActionSecureValuesSentMe:
|
||||
case .messageActionChannelCreate, .messageActionChatDeletePhoto, .messageActionChatEditPhoto, .messageActionChatEditTitle, .messageActionEmpty, .messageActionPinMessage, .messageActionHistoryClear, .messageActionGameScore, .messageActionPaymentSent, .messageActionPaymentSentMe, .messageActionPhoneCall, .messageActionScreenshotTaken, .messageActionCustomAction, .messageActionBotAllowed/*, .messageActionSecureValuesSent, .messageActionSecureValuesSentMe*/:
|
||||
break
|
||||
case let .messageActionChannelMigrateFrom(_, chatId):
|
||||
result.append(PeerId(namespace: Namespaces.Peer.CloudGroup, id: chatId))
|
||||
|
@ -389,10 +389,10 @@ func telegramMediaActionFromApiAction(_ action: Api.MessageAction) -> TelegramMe
|
||||
return TelegramMediaAction(action: .customText(text: message, entities: []))
|
||||
case let .messageActionBotAllowed(domain):
|
||||
return TelegramMediaAction(action: .botDomainAccessGranted(domain: domain))
|
||||
case .messageActionSecureValuesSentMe:
|
||||
/*case .messageActionSecureValuesSentMe:
|
||||
return nil
|
||||
case let .messageActionSecureValuesSent(types):
|
||||
return TelegramMediaAction(action: .botSentSecureValues(types: types.map(SentSecureValueType.init)))
|
||||
return TelegramMediaAction(action: .botSentSecureValues(types: types.map(SentSecureValueType.init)))*/
|
||||
}
|
||||
}
|
||||
|
||||
@ -411,7 +411,7 @@ extension PhoneCallDiscardReason {
|
||||
}
|
||||
}
|
||||
|
||||
extension SentSecureValueType {
|
||||
/*extension SentSecureValueType {
|
||||
init(apiType: Api.SecureValueType) {
|
||||
switch apiType {
|
||||
case .secureValueTypePersonalDetails:
|
||||
@ -442,4 +442,4 @@ extension SentSecureValueType {
|
||||
self = .temporaryRegistration
|
||||
}
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
29
TelegramCore/TermsOfService.swift
Normal file
29
TelegramCore/TermsOfService.swift
Normal file
@ -0,0 +1,29 @@
|
||||
import Foundation
|
||||
#if os(macOS)
|
||||
import PostboxMac
|
||||
import SwiftSignalKitMac
|
||||
import MtProtoKitMac
|
||||
#else
|
||||
import Postbox
|
||||
import SwiftSignalKit
|
||||
import MtProtoKitDynamic
|
||||
#endif
|
||||
|
||||
public func requestTermsOfService(network: Network, countryCode: String) -> Signal<String, NoError> {
|
||||
let langCode: String
|
||||
if let langPackCode = network.context.apiEnvironment.langPackCode, !langPackCode.isEmpty {
|
||||
langCode = langPackCode
|
||||
} else {
|
||||
langCode = "en"
|
||||
}
|
||||
return network.request(Api.functions.help.getTermsOfService(countryIso2: countryCode, langCode: langCode))
|
||||
|> `catch` { _ -> Signal<Api.help.TermsOfService, NoError> in
|
||||
return .single(.termsOfService(text: ""))
|
||||
}
|
||||
|> map { result -> String in
|
||||
switch result {
|
||||
case let .termsOfService(text):
|
||||
return text
|
||||
}
|
||||
}
|
||||
}
|
@ -19,10 +19,10 @@ public func twoStepVerificationConfiguration(account: Account) -> Signal<TwoStep
|
||||
|> retryRequest
|
||||
|> map { result -> TwoStepVerificationConfiguration in
|
||||
switch result {
|
||||
case let .noPassword(_, _, _, emailUnconfirmedPattern):
|
||||
case let .noPassword(_, emailUnconfirmedPattern):
|
||||
return .notSet(pendingEmailPattern: emailUnconfirmedPattern)
|
||||
case let .password(flags, _, _, _, _, hint, emailUnconfirmedPattern):
|
||||
return .set(hint: hint, hasRecoveryEmail: (flags & (1 << 0)) != 0, pendingEmailPattern: emailUnconfirmedPattern)
|
||||
case let .password(_, _, hint, hasRecovery, emailUnconfirmedPattern):
|
||||
return .set(hint: hint, hasRecoveryEmail: hasRecovery == .boolTrue, pendingEmailPattern: emailUnconfirmedPattern)
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -62,14 +62,14 @@ public func requestTwoStepVerifiationSettings(network: Network, password: String
|
||||
}
|
||||
|> mapToSignal { result -> Signal<TwoStepVerificationSettings, AuthorizationPasswordVerificationError> in
|
||||
switch result {
|
||||
case let .passwordSettings(email, secureSalt, secureSecret, secureSecretId):
|
||||
case let .passwordSettings(email):
|
||||
var parsedSecureSecret: TwoStepVerificationSecureSecret?
|
||||
if secureSalt.size != 0 && secureSecret.size != 0 {
|
||||
/*if secureSalt.size != 0 && secureSecret.size != 0 {
|
||||
if secureSecret.size != 32 {
|
||||
return .fail(.generic)
|
||||
}
|
||||
parsedSecureSecret = TwoStepVerificationSecureSecret(data: secureSecret.makeData(), salt: secureSalt.makeData(), id: secureSecretId)
|
||||
}
|
||||
}*/
|
||||
return .single(TwoStepVerificationSettings(email: email, secureSecret: parsedSecureSecret))
|
||||
}
|
||||
}
|
||||
@ -130,7 +130,7 @@ public func updateTwoStepVerificationPassword(network: Network, currentPassword:
|
||||
flags |= (1 << 0)
|
||||
}
|
||||
|
||||
return network.request(Api.functions.account.updatePasswordSettings(currentPasswordHash: currentPasswordHash, newSettings: .passwordInputSettings(flags: flags, newSalt: Buffer(data: Data()), newPasswordHash: Buffer(data: Data()), hint: "", email: "", newSecureSalt: nil, newSecureSecret: nil, newSecureSecretId: nil)), automaticFloodWait: true)
|
||||
return network.request(Api.functions.account.updatePasswordSettings(currentPasswordHash: currentPasswordHash, newSettings: .passwordInputSettings(flags: flags, newSalt: Buffer(data: Data()), newPasswordHash: Buffer(data: Data()), hint: "", email: "")), automaticFloodWait: true)
|
||||
|> mapError { _ -> UpdateTwoStepVerificationPasswordError in
|
||||
return .generic
|
||||
}
|
||||
@ -157,7 +157,7 @@ public func updateTwoStepVerificationPassword(network: Network, currentPassword:
|
||||
updatedData.append(nextSalt)
|
||||
|
||||
var updatedSecureSecret: TwoStepVerificationSecureSecret?
|
||||
if let encryptedSecret = secureSecret {
|
||||
/*if let encryptedSecret = secureSecret {
|
||||
flags |= 1 << 2
|
||||
if let decryptedSecret = decryptedSecureSecret(encryptedSecretData: encryptedSecret.data, password: currentPassword ?? "", salt: encryptedSecret.salt, id: encryptedSecret.id) {
|
||||
if let (data, salt, id) = encryptedSecureSecret(secretData: decryptedSecret, password: password, inputSalt: authData.nextSecureSalt) {
|
||||
@ -168,10 +168,10 @@ public func updateTwoStepVerificationPassword(network: Network, currentPassword:
|
||||
} else {
|
||||
return .fail(.generic)
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
let updatedPasswordHash = sha256Digest(updatedData)
|
||||
return network.request(Api.functions.account.updatePasswordSettings(currentPasswordHash: currentPasswordHash, newSettings: Api.account.PasswordInputSettings.passwordInputSettings(flags: flags, newSalt: Buffer(data: nextSalt), newPasswordHash: Buffer(data: updatedPasswordHash), hint: hint, email: email, newSecureSalt: (updatedSecureSecret?.salt).flatMap(Buffer.init), newSecureSecret: (updatedSecureSecret?.data).flatMap(Buffer.init), newSecureSecretId: updatedSecureSecret?.id)), automaticFloodWait: false)
|
||||
return network.request(Api.functions.account.updatePasswordSettings(currentPasswordHash: currentPasswordHash, newSettings: Api.account.PasswordInputSettings.passwordInputSettings(flags: flags, newSalt: Buffer(data: nextSalt), newPasswordHash: Buffer(data: updatedPasswordHash), hint: hint, email: email)), automaticFloodWait: false)
|
||||
|> map { _ -> UpdateTwoStepVerificationPasswordResult in
|
||||
return .password(password: password, pendingEmailPattern: nil)
|
||||
}
|
||||
@ -229,7 +229,7 @@ func updateTwoStepVerificationSecureSecret(network: Network, password: String, s
|
||||
}
|
||||
|
||||
let flags: Int32 = (1 << 2)
|
||||
return network.request(Api.functions.account.updatePasswordSettings(currentPasswordHash: currentPasswordHash, newSettings: .passwordInputSettings(flags: flags, newSalt: nil, newPasswordHash: nil, hint: nil, email: nil, newSecureSalt: Buffer(data: secretSalt), newSecureSecret: Buffer(data: encryptedSecret), newSecureSecretId: secretId)), automaticFloodWait: false)
|
||||
return network.request(Api.functions.account.updatePasswordSettings(currentPasswordHash: currentPasswordHash, newSettings: .passwordInputSettings(flags: flags, newSalt: nil, newPasswordHash: nil, hint: nil, email: nil)), automaticFloodWait: false)
|
||||
|> mapError { _ -> UpdateTwoStepVerificationSecureSecretError in
|
||||
return .generic
|
||||
}
|
||||
@ -257,7 +257,7 @@ public func updateTwoStepVerificationEmail(account: Account, currentPassword: St
|
||||
}
|
||||
|
||||
let flags: Int32 = 1 << 1
|
||||
return account.network.request(Api.functions.account.updatePasswordSettings(currentPasswordHash: currentPasswordHash, newSettings: Api.account.PasswordInputSettings.passwordInputSettings(flags: flags, newSalt: nil, newPasswordHash: nil, hint: nil, email: updatedEmail, newSecureSalt: nil, newSecureSecret: nil, newSecureSecretId: nil)), automaticFloodWait: false)
|
||||
return account.network.request(Api.functions.account.updatePasswordSettings(currentPasswordHash: currentPasswordHash, newSettings: Api.account.PasswordInputSettings.passwordInputSettings(flags: flags, newSalt: nil, newPasswordHash: nil, hint: nil, email: updatedEmail)), automaticFloodWait: false)
|
||||
|> map { _ -> UpdateTwoStepVerificationPasswordResult in
|
||||
return .password(password: currentPassword, pendingEmailPattern: nil)
|
||||
}
|
||||
|
@ -24,7 +24,8 @@ public struct SecureIdPreparePhoneVerificationPayload {
|
||||
}
|
||||
|
||||
public func secureIdPreparePhoneVerification(network: Network, value: SecureIdPhoneValue) -> Signal<SecureIdPreparePhoneVerificationPayload, SecureIdPreparePhoneVerificationError> {
|
||||
return network.request(Api.functions.account.sendVerifyPhoneCode(flags: 0, phoneNumber: value.phone, currentNumber: nil), automaticFloodWait: false)
|
||||
return .never()
|
||||
/*return network.request(Api.functions.account.sendVerifyPhoneCode(flags: 0, phoneNumber: value.phone, currentNumber: nil), automaticFloodWait: false)
|
||||
|> mapError { error -> SecureIdPreparePhoneVerificationError in
|
||||
if error.errorDescription.hasPrefix("FLOOD_WAIT") {
|
||||
return .flood
|
||||
@ -38,7 +39,7 @@ public func secureIdPreparePhoneVerification(network: Network, value: SecureIdPh
|
||||
case let .sentCode(_, type, phoneCodeHash, nextType, timeout):
|
||||
return SecureIdPreparePhoneVerificationPayload(type: SentAuthorizationCodeType(apiType: type), nextType: nextType.flatMap(AuthorizationCodeNextType.init), timeout: timeout, phone: value.phone, phoneCodeHash: phoneCodeHash)
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
public enum SecureIdCommitPhoneVerificationError {
|
||||
@ -48,7 +49,8 @@ public enum SecureIdCommitPhoneVerificationError {
|
||||
}
|
||||
|
||||
public func secureIdCommitPhoneVerification(postbox: Postbox, network: Network, context: SecureIdAccessContext, payload: SecureIdPreparePhoneVerificationPayload, code: String) -> Signal<SecureIdValueWithContext, SecureIdCommitPhoneVerificationError> {
|
||||
return network.request(Api.functions.account.verifyPhone(phoneNumber: payload.phone, phoneCodeHash: payload.phoneCodeHash, phoneCode: code))
|
||||
return .never()
|
||||
/*return network.request(Api.functions.account.verifyPhone(phoneNumber: payload.phone, phoneCodeHash: payload.phoneCodeHash, phoneCode: code))
|
||||
|> mapError { error -> SecureIdCommitPhoneVerificationError in
|
||||
if error.errorDescription.hasPrefix("FLOOD_WAIT") {
|
||||
return .flood
|
||||
@ -63,7 +65,7 @@ public func secureIdCommitPhoneVerification(postbox: Postbox, network: Network,
|
||||
|> mapError { _ -> SecureIdCommitPhoneVerificationError in
|
||||
return .generic
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
public enum SecureIdPrepareEmailVerificationError {
|
||||
@ -77,7 +79,8 @@ public struct SecureIdPrepareEmailVerificationPayload {
|
||||
}
|
||||
|
||||
public func secureIdPrepareEmailVerification(network: Network, value: SecureIdEmailValue) -> Signal<SecureIdPrepareEmailVerificationPayload, SecureIdPrepareEmailVerificationError> {
|
||||
return network.request(Api.functions.account.sendVerifyEmailCode(email: value.email), automaticFloodWait: false)
|
||||
return .never()
|
||||
/*return network.request(Api.functions.account.sendVerifyEmailCode(email: value.email), automaticFloodWait: false)
|
||||
|> mapError { error -> SecureIdPrepareEmailVerificationError in
|
||||
if error.errorDescription.hasPrefix("FLOOD_WAIT") {
|
||||
return .flood
|
||||
@ -89,7 +92,7 @@ public func secureIdPrepareEmailVerification(network: Network, value: SecureIdEm
|
||||
case .sentEmailCode(_, let length):
|
||||
return SecureIdPrepareEmailVerificationPayload(email: value.email, length: length)
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
public enum SecureIdCommitEmailVerificationError {
|
||||
@ -99,7 +102,8 @@ public enum SecureIdCommitEmailVerificationError {
|
||||
}
|
||||
|
||||
public func secureIdCommitEmailVerification(postbox: Postbox, network: Network, context: SecureIdAccessContext, payload: SecureIdPrepareEmailVerificationPayload, code: String) -> Signal<SecureIdValueWithContext, SecureIdCommitEmailVerificationError> {
|
||||
return network.request(Api.functions.account.verifyEmail(email: payload.email, code: code), automaticFloodWait: false)
|
||||
return .never()
|
||||
/*return network.request(Api.functions.account.verifyEmail(email: payload.email, code: code), automaticFloodWait: false)
|
||||
|> mapError { error -> SecureIdCommitEmailVerificationError in
|
||||
if error.errorDescription.hasPrefix("FLOOD_WAIT") {
|
||||
return .flood
|
||||
@ -111,5 +115,5 @@ public func secureIdCommitEmailVerification(postbox: Postbox, network: Network,
|
||||
|> mapError { _ -> SecureIdCommitEmailVerificationError in
|
||||
return .generic
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user