From e0556af74265f06010e07663b77f032b029b35b8 Mon Sep 17 00:00:00 2001 From: Wizou Date: Sat, 18 Sep 2021 02:11:23 +0200 Subject: [PATCH] Convert empty type hierarchies to enums --- src/Client.cs | 1 + src/Generator.cs | 33 +++- src/TL.MTProto.cs | 16 +- src/TL.Schema.cs | 432 ++++++++++++++++++++-------------------------- src/TL.Table.cs | 175 ++++++------------- 5 files changed, 281 insertions(+), 376 deletions(-) diff --git a/src/Client.cs b/src/Client.cs index e28dcf2..a89018d 100644 --- a/src/Client.cs +++ b/src/Client.cs @@ -479,6 +479,7 @@ namespace WTelegram if (tcs != null) { result = reader.ReadTLValue(type); + if (type.IsEnum) result = Enum.ToObject(type, result); Log(1, ""); Task.Run(() => tcs.SetResult(result)); // in Task.Run to avoid deadlock, see https://blog.stephencleary.com/2012/12/dont-block-in-asynchronous-code.html } diff --git a/src/Generator.cs b/src/Generator.cs index 339d813..1ae51cd 100644 --- a/src/Generator.cs +++ b/src/Generator.cs @@ -17,6 +17,7 @@ namespace WTelegram readonly Dictionary> typeInfosByLayer = new(); readonly Dictionary knownStyles = new() { ["InitConnection"] = 1, ["Help_GetConfig"] = 0, ["HttpWait"] = -1 }; Dictionary typeInfos; + readonly HashSet enumTypes = new(); int currentLayer; string tabIndent; private string currentJson; @@ -225,7 +226,13 @@ namespace WTelegram sw.WriteLine(); if (currentJson != "TL.MTProto") sw.WriteLine($"{tabIndent}///See "); - sw.WriteLine($"{tabIndent}public abstract partial class {parentClass} : ITLObject {{ }}"); + if (typeInfo.Structs.All(ctor => ctor.@params.Length == 0)) + { + WriteTypeAsEnum(sw, typeInfo); + return; + } + else + sw.WriteLine($"{tabIndent}public abstract partial class {parentClass} : ITLObject {{ }}"); } int skipParams = 0; foreach (var ctor in typeInfo.Structs) @@ -327,6 +334,28 @@ namespace WTelegram } } + private void WriteTypeAsEnum(StreamWriter sw, TypeInfo typeInfo) + { + enumTypes.Add(typeInfo.ReturnName); + sw.WriteLine($"{tabIndent}public enum {typeInfo.ReturnName} : uint"); + sw.WriteLine($"{tabIndent}{{"); + string prefix = ""; + while ((prefix += typeInfo.Structs[0].predicate[prefix.Length]) != null) + if (!typeInfo.Structs.All(ctor => ctor.predicate.StartsWith(prefix))) + break; + int prefixLen = CSharpName(prefix).Length - 1; + foreach (var ctor in typeInfo.Structs) + { + string className = CSharpName(ctor.predicate); + if (!allTypes.Add(className)) continue; + ctorToTypes.Remove(ctor.ID); + sw.WriteLine($"{tabIndent}\t///See "); + sw.WriteLine($"{tabIndent}\t{className[prefixLen..]} = 0x{ctor.ID:X8},"); + } + sw.WriteLine($"{tabIndent}}}"); + } + + private static string MapName(string name) => name switch { "out" => "out_", @@ -509,6 +538,8 @@ namespace WTelegram default: if (parmType.StartsWith("Vector<", StringComparison.OrdinalIgnoreCase)) sw.WriteLine($"{tabIndent}\twriter.WriteTLVector({parmName});"); + else if (enumTypes.Contains(parmType)) + sw.WriteLine($"{tabIndent}\twriter.Write((uint){parmName});"); else sw.WriteLine($"{tabIndent}\twriter.WriteTLObject({parmName});"); break; diff --git a/src/TL.MTProto.cs b/src/TL.MTProto.cs index 3e35aa9..955294d 100644 --- a/src/TL.MTProto.cs +++ b/src/TL.MTProto.cs @@ -89,13 +89,15 @@ namespace TL [TLDef(0xA69DAE02)] //dh_gen_fail#a69dae02 nonce:int128 server_nonce:int128 new_nonce_hash3:int128 = Set_client_DH_params_answer public partial class DhGenFail : SetClientDHParamsAnswer { public Int128 new_nonce_hash3; } - public abstract partial class DestroyAuthKeyRes : ITLObject { } - [TLDef(0xF660E1D4)] //destroy_auth_key_ok#f660e1d4 = DestroyAuthKeyRes - public partial class DestroyAuthKeyOk : DestroyAuthKeyRes { } - [TLDef(0x0A9F2259)] //destroy_auth_key_none#0a9f2259 = DestroyAuthKeyRes - public partial class DestroyAuthKeyNone : DestroyAuthKeyRes { } - [TLDef(0xEA109B13)] //destroy_auth_key_fail#ea109b13 = DestroyAuthKeyRes - public partial class DestroyAuthKeyFail : DestroyAuthKeyRes { } + public enum DestroyAuthKeyRes : uint + { + ///See + Ok = 0xF660E1D4, + ///See + None = 0x0A9F2259, + ///See + Fail = 0xEA109B13, + } [TLDef(0x62D6B459)] //msgs_ack#62d6b459 msg_ids:Vector = MsgsAck public partial class MsgsAck : ITLObject { public long[] msg_ids; } diff --git a/src/TL.Schema.cs b/src/TL.Schema.cs index 511ae4b..b4b0c04 100644 --- a/src/TL.Schema.cs +++ b/src/TL.Schema.cs @@ -8,13 +8,13 @@ namespace TL using Client = WTelegram.Client; ///See - public abstract partial class Bool : ITLObject { } - ///See - [TLDef(0xBC799737)] - public partial class BoolFalse : Bool { } - ///See - [TLDef(0x997275B5)] - public partial class BoolTrue : Bool { } + public enum Bool : uint + { + ///See + False = 0xBC799737, + ///See + True = 0x997275B5, + } ///See [TLDef(0x3FEDD339)] @@ -410,37 +410,29 @@ namespace TL public partial class PeerChannel : Peer { public long channel_id; } ///See - public abstract partial class Storage_FileType : ITLObject { } - ///See - [TLDef(0xAA963B05)] - public partial class Storage_FileUnknown : Storage_FileType { } - ///See - [TLDef(0x40BC6F52)] - public partial class Storage_FilePartial : Storage_FileType { } - ///See - [TLDef(0x007EFE0E)] - public partial class Storage_FileJpeg : Storage_FileType { } - ///See - [TLDef(0xCAE1AADF)] - public partial class Storage_FileGif : Storage_FileType { } - ///See - [TLDef(0x0A4F63C0)] - public partial class Storage_FilePng : Storage_FileType { } - ///See - [TLDef(0xAE1E508D)] - public partial class Storage_FilePdf : Storage_FileType { } - ///See - [TLDef(0x528A0677)] - public partial class Storage_FileMp3 : Storage_FileType { } - ///See - [TLDef(0x4B09EBBC)] - public partial class Storage_FileMov : Storage_FileType { } - ///See - [TLDef(0xB3CEA0E4)] - public partial class Storage_FileMp4 : Storage_FileType { } - ///See - [TLDef(0x1081464C)] - public partial class Storage_FileWebp : Storage_FileType { } + public enum Storage_FileType : uint + { + ///See + Unknown = 0xAA963B05, + ///See + Partial = 0x40BC6F52, + ///See + Jpeg = 0x007EFE0E, + ///See + Gif = 0xCAE1AADF, + ///See + Png = 0x0A4F63C0, + ///See + Pdf = 0xAE1E508D, + ///See + Mp3 = 0x528A0677, + ///See + Mov = 0x4B09EBBC, + ///See + Mp4 = 0xB3CEA0E4, + ///See + Webp = 0x1081464C, + } ///See public abstract partial class UserBase : ITLObject { } @@ -1230,31 +1222,25 @@ namespace TL } ///See - public abstract partial class ReportReason : ITLObject { } - ///See - [TLDef(0x58DBCAB8)] - public partial class InputReportReasonSpam : ReportReason { } - ///See - [TLDef(0x1E22C78D)] - public partial class InputReportReasonViolence : ReportReason { } - ///See - [TLDef(0x2E59D922)] - public partial class InputReportReasonPornography : ReportReason { } - ///See - [TLDef(0xADF44EE3)] - public partial class InputReportReasonChildAbuse : ReportReason { } - ///See - [TLDef(0xC1E4A2B1)] - public partial class InputReportReasonOther : ReportReason { } - ///See - [TLDef(0x9B89F93A)] - public partial class InputReportReasonCopyright : ReportReason { } - ///See - [TLDef(0xDBD4FEED)] - public partial class InputReportReasonGeoIrrelevant : ReportReason { } - ///See - [TLDef(0xF5DDD6E7)] - public partial class InputReportReasonFake : ReportReason { } + public enum ReportReason : uint + { + ///See + Spam = 0x58DBCAB8, + ///See + Violence = 0x1E22C78D, + ///See + Pornography = 0x2E59D922, + ///See + ChildAbuse = 0xADF44EE3, + ///See + Other = 0xC1E4A2B1, + ///See + Copyright = 0x9B89F93A, + ///See + GeoIrrelevant = 0xDBD4FEED, + ///See + Fake = 0xF5DDD6E7, + } ///See [TLDef(0xD697FF05)] @@ -2753,58 +2739,46 @@ namespace TL } ///See - public abstract partial class InputPrivacyKey : ITLObject { } - ///See - [TLDef(0x4F96CB18)] - public partial class InputPrivacyKeyStatusTimestamp : InputPrivacyKey { } - ///See - [TLDef(0xBDFB0426)] - public partial class InputPrivacyKeyChatInvite : InputPrivacyKey { } - ///See - [TLDef(0xFABADC5F)] - public partial class InputPrivacyKeyPhoneCall : InputPrivacyKey { } - ///See - [TLDef(0xDB9E70D2)] - public partial class InputPrivacyKeyPhoneP2P : InputPrivacyKey { } - ///See - [TLDef(0xA4DD4C08)] - public partial class InputPrivacyKeyForwards : InputPrivacyKey { } - ///See - [TLDef(0x5719BACC)] - public partial class InputPrivacyKeyProfilePhoto : InputPrivacyKey { } - ///See - [TLDef(0x0352DAFA)] - public partial class InputPrivacyKeyPhoneNumber : InputPrivacyKey { } - ///See - [TLDef(0xD1219BDD)] - public partial class InputPrivacyKeyAddedByPhone : InputPrivacyKey { } + public enum InputPrivacyKey : uint + { + ///See + StatusTimestamp = 0x4F96CB18, + ///See + ChatInvite = 0xBDFB0426, + ///See + PhoneCall = 0xFABADC5F, + ///See + PhoneP2P = 0xDB9E70D2, + ///See + Forwards = 0xA4DD4C08, + ///See + ProfilePhoto = 0x5719BACC, + ///See + PhoneNumber = 0x0352DAFA, + ///See + AddedByPhone = 0xD1219BDD, + } ///See - public abstract partial class PrivacyKey : ITLObject { } - ///See - [TLDef(0xBC2EAB30)] - public partial class PrivacyKeyStatusTimestamp : PrivacyKey { } - ///See - [TLDef(0x500E6DFA)] - public partial class PrivacyKeyChatInvite : PrivacyKey { } - ///See - [TLDef(0x3D662B7B)] - public partial class PrivacyKeyPhoneCall : PrivacyKey { } - ///See - [TLDef(0x39491CC8)] - public partial class PrivacyKeyPhoneP2P : PrivacyKey { } - ///See - [TLDef(0x69EC56A3)] - public partial class PrivacyKeyForwards : PrivacyKey { } - ///See - [TLDef(0x96151FED)] - public partial class PrivacyKeyProfilePhoto : PrivacyKey { } - ///See - [TLDef(0xD19AE46D)] - public partial class PrivacyKeyPhoneNumber : PrivacyKey { } - ///See - [TLDef(0x42FFD42B)] - public partial class PrivacyKeyAddedByPhone : PrivacyKey { } + public enum PrivacyKey : uint + { + ///See + StatusTimestamp = 0xBC2EAB30, + ///See + ChatInvite = 0x500E6DFA, + ///See + PhoneCall = 0x3D662B7B, + ///See + PhoneP2P = 0x39491CC8, + ///See + Forwards = 0x69EC56A3, + ///See + ProfilePhoto = 0x96151FED, + ///See + PhoneNumber = 0xD19AE46D, + ///See + AddedByPhone = 0x42FFD42B, + } ///See public abstract partial class InputPrivacyRule : ITLObject { } @@ -3864,16 +3838,15 @@ namespace TL } ///See - public abstract partial class Auth_CodeType : ITLObject { } - ///See - [TLDef(0x72A3158C)] - public partial class Auth_CodeTypeSms : Auth_CodeType { } - ///See - [TLDef(0x741CD3E3)] - public partial class Auth_CodeTypeCall : Auth_CodeType { } - ///See - [TLDef(0x226CCEFB)] - public partial class Auth_CodeTypeFlashCall : Auth_CodeType { } + public enum Auth_CodeType : uint + { + ///See + Sms = 0x72A3158C, + ///See + Call = 0x741CD3E3, + ///See + FlashCall = 0x226CCEFB, + } ///See public abstract partial class Auth_SentCodeType : ITLObject { } @@ -3957,31 +3930,25 @@ namespace TL } ///See - public abstract partial class TopPeerCategory : ITLObject { } - ///See - [TLDef(0xAB661B5B)] - public partial class TopPeerCategoryBotsPM : TopPeerCategory { } - ///See - [TLDef(0x148677E2)] - public partial class TopPeerCategoryBotsInline : TopPeerCategory { } - ///See - [TLDef(0x0637B7ED)] - public partial class TopPeerCategoryCorrespondents : TopPeerCategory { } - ///See - [TLDef(0xBD17A14A)] - public partial class TopPeerCategoryGroups : TopPeerCategory { } - ///See - [TLDef(0x161D9628)] - public partial class TopPeerCategoryChannels : TopPeerCategory { } - ///See - [TLDef(0x1E76A78C)] - public partial class TopPeerCategoryPhoneCalls : TopPeerCategory { } - ///See - [TLDef(0xA8406CA9)] - public partial class TopPeerCategoryForwardUsers : TopPeerCategory { } - ///See - [TLDef(0xFBEEC0F0)] - public partial class TopPeerCategoryForwardChats : TopPeerCategory { } + public enum TopPeerCategory : uint + { + ///See + BotsPM = 0xAB661B5B, + ///See + BotsInline = 0x148677E2, + ///See + Correspondents = 0x0637B7ED, + ///See + Groups = 0xBD17A14A, + ///See + Channels = 0x161D9628, + ///See + PhoneCalls = 0x1E76A78C, + ///See + ForwardUsers = 0xA8406CA9, + ///See + ForwardChats = 0xFBEEC0F0, + } ///See [TLDef(0xFB834291)] @@ -4412,19 +4379,17 @@ namespace TL } ///See - public abstract partial class PhoneCallDiscardReason : ITLObject { } - ///See - [TLDef(0x85E42301)] - public partial class PhoneCallDiscardReasonMissed : PhoneCallDiscardReason { } - ///See - [TLDef(0xE095C1A0)] - public partial class PhoneCallDiscardReasonDisconnect : PhoneCallDiscardReason { } - ///See - [TLDef(0x57ADC690)] - public partial class PhoneCallDiscardReasonHangup : PhoneCallDiscardReason { } - ///See - [TLDef(0xFAF7E8C9)] - public partial class PhoneCallDiscardReasonBusy : PhoneCallDiscardReason { } + public enum PhoneCallDiscardReason : uint + { + ///See + Missed = 0x85E42301, + ///See + Disconnect = 0xE095C1A0, + ///See + Hangup = 0x57ADC690, + ///See + Busy = 0xFAF7E8C9, + } ///See [TLDef(0x7D748D04)] @@ -5294,46 +5259,35 @@ namespace TL public partial class SecurePlainEmail : SecurePlainData { public string email; } ///See - public abstract partial class SecureValueType : ITLObject { } - ///See - [TLDef(0x9D2A81E3)] - public partial class SecureValueTypePersonalDetails : SecureValueType { } - ///See - [TLDef(0x3DAC6A00)] - public partial class SecureValueTypePassport : SecureValueType { } - ///See - [TLDef(0x06E425C4)] - public partial class SecureValueTypeDriverLicense : SecureValueType { } - ///See - [TLDef(0xA0D0744B)] - public partial class SecureValueTypeIdentityCard : SecureValueType { } - ///See - [TLDef(0x99A48F23)] - public partial class SecureValueTypeInternalPassport : SecureValueType { } - ///See - [TLDef(0xCBE31E26)] - public partial class SecureValueTypeAddress : SecureValueType { } - ///See - [TLDef(0xFC36954E)] - public partial class SecureValueTypeUtilityBill : SecureValueType { } - ///See - [TLDef(0x89137C0D)] - public partial class SecureValueTypeBankStatement : SecureValueType { } - ///See - [TLDef(0x8B883488)] - public partial class SecureValueTypeRentalAgreement : SecureValueType { } - ///See - [TLDef(0x99E3806A)] - public partial class SecureValueTypePassportRegistration : SecureValueType { } - ///See - [TLDef(0xEA02EC33)] - public partial class SecureValueTypeTemporaryRegistration : SecureValueType { } - ///See - [TLDef(0xB320AADB)] - public partial class SecureValueTypePhone : SecureValueType { } - ///See - [TLDef(0x8E3CA7EE)] - public partial class SecureValueTypeEmail : SecureValueType { } + public enum SecureValueType : uint + { + ///See + PersonalDetails = 0x9D2A81E3, + ///See + Passport = 0x3DAC6A00, + ///See + DriverLicense = 0x06E425C4, + ///See + IdentityCard = 0xA0D0744B, + ///See + InternalPassport = 0x99A48F23, + ///See + Address = 0xCBE31E26, + ///See + UtilityBill = 0xFC36954E, + ///See + BankStatement = 0x89137C0D, + ///See + RentalAgreement = 0x8B883488, + ///See + PassportRegistration = 0x99E3806A, + ///See + TemporaryRegistration = 0xEA02EC33, + ///See + Phone = 0xB320AADB, + ///See + Email = 0x8E3CA7EE, + } ///See [TLDef(0x187FA0CA)] @@ -6071,22 +6025,19 @@ namespace TL } ///See - public abstract partial class BaseTheme : ITLObject { } - ///See - [TLDef(0xC3A12462)] - public partial class BaseThemeClassic : BaseTheme { } - ///See - [TLDef(0xFBD81688)] - public partial class BaseThemeDay : BaseTheme { } - ///See - [TLDef(0xB7B31EA8)] - public partial class BaseThemeNight : BaseTheme { } - ///See - [TLDef(0x6D5F77EE)] - public partial class BaseThemeTinted : BaseTheme { } - ///See - [TLDef(0x5B11125A)] - public partial class BaseThemeArctic : BaseTheme { } + public enum BaseTheme : uint + { + ///See + Classic = 0xC3A12462, + ///See + Day = 0xFBD81688, + ///See + Night = 0xB7B31EA8, + ///See + Tinted = 0x6D5F77EE, + ///See + Arctic = 0x5B11125A, + } ///See [TLDef(0x8FDE504F)] @@ -6558,22 +6509,19 @@ namespace TL } ///See - public abstract partial class InlineQueryPeerType : ITLObject { } - ///See - [TLDef(0x3081ED9D)] - public partial class InlineQueryPeerTypeSameBotPM : InlineQueryPeerType { } - ///See - [TLDef(0x833C0FAC)] - public partial class InlineQueryPeerTypePM : InlineQueryPeerType { } - ///See - [TLDef(0xD766C50A)] - public partial class InlineQueryPeerTypeChat : InlineQueryPeerType { } - ///See - [TLDef(0x5EC4BE43)] - public partial class InlineQueryPeerTypeMegagroup : InlineQueryPeerType { } - ///See - [TLDef(0x6334EE9A)] - public partial class InlineQueryPeerTypeBroadcast : InlineQueryPeerType { } + public enum InlineQueryPeerType : uint + { + ///See + SameBotPM = 0x3081ED9D, + ///See + PM = 0x833C0FAC, + ///See + Chat = 0xD766C50A, + ///See + Megagroup = 0x5EC4BE43, + ///See + Broadcast = 0x6334EE9A, + } ///See [TLDef(0x1662AF0B)] @@ -7125,8 +7073,8 @@ namespace TL }); ///See - public static Task Account_UpdateStatus(this Client client, bool offline) - => client.CallAsync(writer => + public static Task Account_UpdateStatus(this Client client, bool offline) + => client.CallAsync(writer => { writer.Write(0x6628562C); writer.Write(offline ? 0x997275B5 : 0xBC799737); @@ -7148,7 +7096,7 @@ namespace TL { writer.Write(0xC5BA3D86); writer.WriteTLObject(peer); - writer.WriteTLObject(reason); + writer.Write((uint)reason); writer.WriteTLString(message); return "Account_ReportPeer"; }); @@ -7176,7 +7124,7 @@ namespace TL => client.CallAsync(writer => { writer.Write(0xDADBC950); - writer.WriteTLObject(key); + writer.Write((uint)key); return "Account_GetPrivacy"; }); @@ -7185,7 +7133,7 @@ namespace TL => client.CallAsync(writer => { writer.Write(0xC9F81CE8); - writer.WriteTLObject(key); + writer.Write((uint)key); writer.WriteTLVector(rules); return "Account_SetPrivacy"; }); @@ -7727,7 +7675,7 @@ namespace TL writer.Write(0xFA8CC6F5); writer.WriteTLObject(peer); writer.WriteTLObject(photo_id); - writer.WriteTLObject(reason); + writer.Write((uint)reason); writer.WriteTLString(message); return "Account_ReportProfilePhoto"; }); @@ -7902,7 +7850,7 @@ namespace TL => client.CallAsync(writer => { writer.Write(0x1AE373AC); - writer.WriteTLObject(category); + writer.Write((uint)category); writer.WriteTLObject(peer); return "Contacts_ResetTopPeerRating"; }); @@ -8175,7 +8123,7 @@ namespace TL writer.Write(0x8953AB4E); writer.WriteTLObject(peer); writer.WriteTLVector(id); - writer.WriteTLObject(reason); + writer.Write((uint)reason); writer.WriteTLString(message); return "Messages_Report"; }); @@ -10602,7 +10550,7 @@ namespace TL writer.Write(video ? 0x1 : 0); writer.WriteTLObject(peer); writer.Write(duration); - writer.WriteTLObject(reason); + writer.Write((uint)reason); writer.Write(connection_id); return "Phone_DiscardCall"; }); diff --git a/src/TL.Table.cs b/src/TL.Table.cs index cf3ac2a..0b3340e 100644 --- a/src/TL.Table.cs +++ b/src/TL.Table.cs @@ -33,9 +33,7 @@ namespace TL [0x3BCBF734] = typeof(DhGenOk), [0x46DC1FB9] = typeof(DhGenRetry), [0xA69DAE02] = typeof(DhGenFail), - [0xF660E1D4] = typeof(DestroyAuthKeyOk), - [0x0A9F2259] = typeof(DestroyAuthKeyNone), - [0xEA109B13] = typeof(DestroyAuthKeyFail), + [0x7ABE77EC] = typeof(Ping), [0x62D6B459] = typeof(MsgsAck), [0xA7EFF811] = typeof(BadMsgNotification), [0xEDAB447B] = typeof(BadServerSalt), @@ -60,10 +58,7 @@ namespace TL [0x37982646] = typeof(IpPortSecret), [0x4679B65F] = typeof(AccessPointRule), [0x5A592A6C] = typeof(Help_ConfigSimple), - [0x7ABE77EC] = typeof(Ping), // from TL.Schema: - [0xBC799737] = typeof(BoolFalse), - [0x997275B5] = typeof(BoolTrue), [0x3FEDD339] = typeof(True), [0xC4B9F9BB] = typeof(Error), [0x56730BCC] = typeof(Null), @@ -116,16 +111,6 @@ namespace TL [0x59511722] = typeof(PeerUser), [0x36C6019A] = typeof(PeerChat), [0xA2A5371E] = typeof(PeerChannel), - [0xAA963B05] = typeof(Storage_FileUnknown), - [0x40BC6F52] = typeof(Storage_FilePartial), - [0x007EFE0E] = typeof(Storage_FileJpeg), - [0xCAE1AADF] = typeof(Storage_FileGif), - [0x0A4F63C0] = typeof(Storage_FilePng), - [0xAE1E508D] = typeof(Storage_FilePdf), - [0x528A0677] = typeof(Storage_FileMp3), - [0x4B09EBBC] = typeof(Storage_FileMov), - [0xB3CEA0E4] = typeof(Storage_FileMp4), - [0x1081464C] = typeof(Storage_FileWebp), [0xD3BC4B7A] = typeof(UserEmpty), [0x3FF6ECB0] = typeof(User), [0x4F11BAE1] = typeof(UserProfilePhotoEmpty), @@ -220,14 +205,6 @@ namespace TL [0x733F2961] = typeof(PeerSettings), [0xA437C3ED] = typeof(WallPaper), [0xE0804116] = typeof(WallPaperNoFile), - [0x58DBCAB8] = typeof(InputReportReasonSpam), - [0x1E22C78D] = typeof(InputReportReasonViolence), - [0x2E59D922] = typeof(InputReportReasonPornography), - [0xADF44EE3] = typeof(InputReportReasonChildAbuse), - [0xC1E4A2B1] = typeof(InputReportReasonOther), - [0x9B89F93A] = typeof(InputReportReasonCopyright), - [0xDBD4FEED] = typeof(InputReportReasonGeoIrrelevant), - [0xF5DDD6E7] = typeof(InputReportReasonFake), [0xD697FF05] = typeof(UserFull), [0x145ADE0B] = typeof(Contact), [0xC13E3C50] = typeof(ImportedContact), @@ -427,22 +404,6 @@ namespace TL [0x6A3233B6] = typeof(SendMessageEmojiInteraction), [0xB665902E] = typeof(SendMessageEmojiInteractionSeen), [0xB3134D9D] = typeof(Contacts_Found), - [0x4F96CB18] = typeof(InputPrivacyKeyStatusTimestamp), - [0xBDFB0426] = typeof(InputPrivacyKeyChatInvite), - [0xFABADC5F] = typeof(InputPrivacyKeyPhoneCall), - [0xDB9E70D2] = typeof(InputPrivacyKeyPhoneP2P), - [0xA4DD4C08] = typeof(InputPrivacyKeyForwards), - [0x5719BACC] = typeof(InputPrivacyKeyProfilePhoto), - [0x0352DAFA] = typeof(InputPrivacyKeyPhoneNumber), - [0xD1219BDD] = typeof(InputPrivacyKeyAddedByPhone), - [0xBC2EAB30] = typeof(PrivacyKeyStatusTimestamp), - [0x500E6DFA] = typeof(PrivacyKeyChatInvite), - [0x3D662B7B] = typeof(PrivacyKeyPhoneCall), - [0x39491CC8] = typeof(PrivacyKeyPhoneP2P), - [0x69EC56A3] = typeof(PrivacyKeyForwards), - [0x96151FED] = typeof(PrivacyKeyProfilePhoto), - [0xD19AE46D] = typeof(PrivacyKeyPhoneNumber), - [0x42FFD42B] = typeof(PrivacyKeyAddedByPhone), [0x0D09E07B] = typeof(InputPrivacyValueAllowContacts), [0x184B35CE] = typeof(InputPrivacyValueAllowAll), [0x131CC67F] = typeof(InputPrivacyValueAllowUsers), @@ -585,9 +546,6 @@ namespace TL [0x947CA848] = typeof(Messages_BotResults), [0x5DAB1AF4] = typeof(ExportedMessageLink), [0x5F777DCE] = typeof(MessageFwdHeader), - [0x72A3158C] = typeof(Auth_CodeTypeSms), - [0x741CD3E3] = typeof(Auth_CodeTypeCall), - [0x226CCEFB] = typeof(Auth_CodeTypeFlashCall), [0x3DBB5986] = typeof(Auth_SentCodeTypeApp), [0xC000BBA2] = typeof(Auth_SentCodeTypeSms), [0x5353E5A7] = typeof(Auth_SentCodeTypeCall), @@ -599,14 +557,6 @@ namespace TL [0x3C20629F] = typeof(InlineBotSwitchPM), [0x3371C354] = typeof(Messages_PeerDialogs), [0xEDCDC05B] = typeof(TopPeer), - [0xAB661B5B] = typeof(TopPeerCategoryBotsPM), - [0x148677E2] = typeof(TopPeerCategoryBotsInline), - [0x0637B7ED] = typeof(TopPeerCategoryCorrespondents), - [0xBD17A14A] = typeof(TopPeerCategoryGroups), - [0x161D9628] = typeof(TopPeerCategoryChannels), - [0x1E76A78C] = typeof(TopPeerCategoryPhoneCalls), - [0xA8406CA9] = typeof(TopPeerCategoryForwardUsers), - [0xFBEEC0F0] = typeof(TopPeerCategoryForwardChats), [0xFB834291] = typeof(TopPeerCategoryPeers), [0xDE266EF5] = typeof(Contacts_TopPeersNotModified), [0x70B772A8] = typeof(Contacts_TopPeers), @@ -675,10 +625,6 @@ namespace TL [0x76768BED] = typeof(PageBlockDetails), [0x16115A96] = typeof(PageBlockRelatedArticles), [0xA44F3EF6] = typeof(PageBlockMap), - [0x85E42301] = typeof(PhoneCallDiscardReasonMissed), - [0xE095C1A0] = typeof(PhoneCallDiscardReasonDisconnect), - [0x57ADC690] = typeof(PhoneCallDiscardReasonHangup), - [0xFAF7E8C9] = typeof(PhoneCallDiscardReasonBusy), [0x7D748D04] = typeof(DataJSON), [0xCB296BF8] = typeof(LabeledPrice), [0x0CD886E0] = typeof(Invoice), @@ -794,19 +740,6 @@ namespace TL [0x8AEABEC3] = typeof(SecureData), [0x7D6099DD] = typeof(SecurePlainPhone), [0x21EC5A5F] = typeof(SecurePlainEmail), - [0x9D2A81E3] = typeof(SecureValueTypePersonalDetails), - [0x3DAC6A00] = typeof(SecureValueTypePassport), - [0x06E425C4] = typeof(SecureValueTypeDriverLicense), - [0xA0D0744B] = typeof(SecureValueTypeIdentityCard), - [0x99A48F23] = typeof(SecureValueTypeInternalPassport), - [0xCBE31E26] = typeof(SecureValueTypeAddress), - [0xFC36954E] = typeof(SecureValueTypeUtilityBill), - [0x89137C0D] = typeof(SecureValueTypeBankStatement), - [0x8B883488] = typeof(SecureValueTypeRentalAgreement), - [0x99E3806A] = typeof(SecureValueTypePassportRegistration), - [0xEA02EC33] = typeof(SecureValueTypeTemporaryRegistration), - [0xB320AADB] = typeof(SecureValueTypePhone), - [0x8E3CA7EE] = typeof(SecureValueTypeEmail), [0x187FA0CA] = typeof(SecureValue), [0xDB21D0A7] = typeof(InputSecureValue), [0xED1ECDB0] = typeof(SecureValueHash), @@ -902,11 +835,6 @@ namespace TL [0x390D5C5E] = typeof(Auth_LoginTokenSuccess), [0x57E28221] = typeof(Account_ContentSettings), [0xA927FEC5] = typeof(Messages_InactiveChats), - [0xC3A12462] = typeof(BaseThemeClassic), - [0xFBD81688] = typeof(BaseThemeDay), - [0xB7B31EA8] = typeof(BaseThemeNight), - [0x6D5F77EE] = typeof(BaseThemeTinted), - [0x5B11125A] = typeof(BaseThemeArctic), [0x8FDE504F] = typeof(InputThemeSettings), [0xFA58B6D4] = typeof(ThemeSettings), [0x54B56617] = typeof(WebPageAttributeTheme), @@ -951,11 +879,6 @@ namespace TL [0xEBA636FE] = typeof(GroupCallParticipant), [0x9E727AAD] = typeof(Phone_GroupCall), [0xF47751B6] = typeof(Phone_GroupParticipants), - [0x3081ED9D] = typeof(InlineQueryPeerTypeSameBotPM), - [0x833C0FAC] = typeof(InlineQueryPeerTypePM), - [0xD766C50A] = typeof(InlineQueryPeerTypeChat), - [0x5EC4BE43] = typeof(InlineQueryPeerTypeMegagroup), - [0x6334EE9A] = typeof(InlineQueryPeerTypeBroadcast), [0x1662AF0B] = typeof(Messages_HistoryImport), [0x5E0FB7B9] = typeof(Messages_HistoryImportParsed), [0xEF8D3E6C] = typeof(Messages_AffectedFoundMessages), @@ -988,55 +911,55 @@ namespace TL [0x2A3C381F] = typeof(SponsoredMessage), [0x65A4C7D5] = typeof(Messages_SponsoredMessages), // from TL.Secret: - [0x1F814F1F] = typeof(Layer8.DecryptedMessage), - [0xAA48327D] = typeof(Layer8.DecryptedMessageService), - [0x089F5C4A] = typeof(Layer8.DecryptedMessageMediaEmpty), - [0x32798A8C] = typeof(Layer8.DecryptedMessageMediaPhoto), - [0x4CEE6EF3] = typeof(Layer8.DecryptedMessageMediaVideo), - [0x35480A59] = typeof(Layer8.DecryptedMessageMediaGeoPoint), - [0x588A0A97] = typeof(Layer8.DecryptedMessageMediaContact), - [0xA1733AEC] = typeof(Layer8.DecryptedMessageActionSetMessageTTL), - [0xB095434B] = typeof(Layer8.DecryptedMessageMediaDocument), - [0x6080758F] = typeof(Layer8.DecryptedMessageMediaAudio), - [0x0C4F40BE] = typeof(Layer8.DecryptedMessageActionReadMessages), - [0x65614304] = typeof(Layer8.DecryptedMessageActionDeleteMessages), - [0x8AC1F475] = typeof(Layer8.DecryptedMessageActionScreenshotMessages), - [0x6719E45C] = typeof(Layer8.DecryptedMessageActionFlushHistory), - [0x204D3878] = typeof(Layer17.DecryptedMessage), - [0x73164160] = typeof(Layer17.DecryptedMessageService), - [0x524A415D] = typeof(Layer17.DecryptedMessageMediaVideo), - [0x57E0A9CB] = typeof(Layer17.DecryptedMessageMediaAudio), - [0x1BE31789] = typeof(Layer17.DecryptedMessageLayer), - [0x92042FF7] = typeof(Layer17.SendMessageUploadVideoAction), - [0xE6AC8A6F] = typeof(Layer17.SendMessageUploadAudioAction), - [0x990A3C1A] = typeof(Layer17.SendMessageUploadPhotoAction), - [0x8FAEE98E] = typeof(Layer17.SendMessageUploadDocumentAction), - [0x511110B0] = typeof(Layer17.DecryptedMessageActionResend), - [0xF3048883] = typeof(Layer17.DecryptedMessageActionNotifyLayer), - [0xCCB27641] = typeof(Layer17.DecryptedMessageActionTyping), - [0xF3C9611B] = typeof(Layer20.DecryptedMessageActionRequestKey), - [0x6FE1735B] = typeof(Layer20.DecryptedMessageActionAcceptKey), - [0xDD05EC6B] = typeof(Layer20.DecryptedMessageActionAbortKey), - [0xEC2E0B9B] = typeof(Layer20.DecryptedMessageActionCommitKey), - [0xA82FDD63] = typeof(Layer20.DecryptedMessageActionNoop), - [0xFB0A5727] = typeof(Layer23.DocumentAttributeSticker), - [0x5910CCCB] = typeof(Layer23.DocumentAttributeVideo), - [0x051448E5] = typeof(Layer23.DocumentAttributeAudio), - [0x77BFB61B] = typeof(Layer23.PhotoSize), - [0xE9A734FA] = typeof(Layer23.PhotoCachedSize), - [0x7C596B46] = typeof(Layer23.FileLocationUnavailable), - [0x53D69076] = typeof(Layer23.FileLocation), - [0xFA95B0DD] = typeof(Layer23.DecryptedMessageMediaExternalDocument), - [0x36B091DE] = typeof(Layer45.DecryptedMessage), - [0xF1FA8D78] = typeof(Layer45.DecryptedMessageMediaPhoto), - [0x970C8C0E] = typeof(Layer45.DecryptedMessageMediaVideo), - [0x7AFE8AE2] = typeof(Layer45.DecryptedMessageMediaDocument), - [0x3A556302] = typeof(Layer45.DocumentAttributeSticker), - [0xDED218E0] = typeof(Layer45.DocumentAttributeAudio), - [0x8A0DF56F] = typeof(Layer45.DecryptedMessageMediaVenue), - [0xE50511D8] = typeof(Layer45.DecryptedMessageMediaWebPage), - [0xBB718624] = typeof(Layer66.SendMessageUploadRoundAction), [0x91CC4674] = typeof(Layer73.DecryptedMessage), + [0xBB718624] = typeof(Layer66.SendMessageUploadRoundAction), + [0xE50511D8] = typeof(Layer45.DecryptedMessageMediaWebPage), + [0x8A0DF56F] = typeof(Layer45.DecryptedMessageMediaVenue), + [0xDED218E0] = typeof(Layer45.DocumentAttributeAudio), + [0x3A556302] = typeof(Layer45.DocumentAttributeSticker), + [0x7AFE8AE2] = typeof(Layer45.DecryptedMessageMediaDocument), + [0x970C8C0E] = typeof(Layer45.DecryptedMessageMediaVideo), + [0xF1FA8D78] = typeof(Layer45.DecryptedMessageMediaPhoto), + [0x36B091DE] = typeof(Layer45.DecryptedMessage), + [0xFA95B0DD] = typeof(Layer23.DecryptedMessageMediaExternalDocument), + [0x53D69076] = typeof(Layer23.FileLocation), + [0x7C596B46] = typeof(Layer23.FileLocationUnavailable), + [0xE9A734FA] = typeof(Layer23.PhotoCachedSize), + [0x77BFB61B] = typeof(Layer23.PhotoSize), + [0x051448E5] = typeof(Layer23.DocumentAttributeAudio), + [0x5910CCCB] = typeof(Layer23.DocumentAttributeVideo), + [0xFB0A5727] = typeof(Layer23.DocumentAttributeSticker), + [0xA82FDD63] = typeof(Layer20.DecryptedMessageActionNoop), + [0xEC2E0B9B] = typeof(Layer20.DecryptedMessageActionCommitKey), + [0xDD05EC6B] = typeof(Layer20.DecryptedMessageActionAbortKey), + [0x6FE1735B] = typeof(Layer20.DecryptedMessageActionAcceptKey), + [0xF3C9611B] = typeof(Layer20.DecryptedMessageActionRequestKey), + [0xCCB27641] = typeof(Layer17.DecryptedMessageActionTyping), + [0xF3048883] = typeof(Layer17.DecryptedMessageActionNotifyLayer), + [0x511110B0] = typeof(Layer17.DecryptedMessageActionResend), + [0x8FAEE98E] = typeof(Layer17.SendMessageUploadDocumentAction), + [0x990A3C1A] = typeof(Layer17.SendMessageUploadPhotoAction), + [0xE6AC8A6F] = typeof(Layer17.SendMessageUploadAudioAction), + [0x92042FF7] = typeof(Layer17.SendMessageUploadVideoAction), + [0x1BE31789] = typeof(Layer17.DecryptedMessageLayer), + [0x57E0A9CB] = typeof(Layer17.DecryptedMessageMediaAudio), + [0x524A415D] = typeof(Layer17.DecryptedMessageMediaVideo), + [0x73164160] = typeof(Layer17.DecryptedMessageService), + [0x204D3878] = typeof(Layer17.DecryptedMessage), + [0x6719E45C] = typeof(Layer8.DecryptedMessageActionFlushHistory), + [0x8AC1F475] = typeof(Layer8.DecryptedMessageActionScreenshotMessages), + [0x65614304] = typeof(Layer8.DecryptedMessageActionDeleteMessages), + [0x0C4F40BE] = typeof(Layer8.DecryptedMessageActionReadMessages), + [0x6080758F] = typeof(Layer8.DecryptedMessageMediaAudio), + [0xB095434B] = typeof(Layer8.DecryptedMessageMediaDocument), + [0xA1733AEC] = typeof(Layer8.DecryptedMessageActionSetMessageTTL), + [0x588A0A97] = typeof(Layer8.DecryptedMessageMediaContact), + [0x35480A59] = typeof(Layer8.DecryptedMessageMediaGeoPoint), + [0x4CEE6EF3] = typeof(Layer8.DecryptedMessageMediaVideo), + [0x32798A8C] = typeof(Layer8.DecryptedMessageMediaPhoto), + [0x089F5C4A] = typeof(Layer8.DecryptedMessageMediaEmpty), + [0xAA48327D] = typeof(Layer8.DecryptedMessageService), + [0x1F814F1F] = typeof(Layer8.DecryptedMessage), // The End }; }