From 75fb3c148809ad978d8b710ff185be5d9efdc6e6 Mon Sep 17 00:00:00 2001 From: "Andres G. Aragoneses" Date: Thu, 16 Apr 2020 16:30:58 +0800 Subject: [PATCH] TeleSharp.TL: fix build Manual edits needed after code autogeneration. --- src/TeleSharp.TL/TL/Auth/TLRequestSignUp.cs | 6 ++- .../TL/Contacts/TLRequestGetSaved.cs | 6 ++- src/TeleSharp.TL/TL/Payments/TLPaymentForm.cs | 6 ++- src/TeleSharp.TL/TL/TLChatPhoto.cs | 12 ++++-- src/TeleSharp.TL/TL/TLJsonObject.cs | 6 ++- src/TeleSharp.TL/TL/TLPhotoCachedSize.cs | 6 ++- src/TeleSharp.TL/TL/TLPhotoSize.cs | 6 ++- src/TeleSharp.TL/TL/TLUserProfilePhoto.cs | 12 ++++-- src/TeleSharp.TL/TL/TLVector.cs | 41 ------------------- src/TeleSharp.TL/TL/TLWebPage.cs | 6 ++- 10 files changed, 44 insertions(+), 63 deletions(-) delete mode 100644 src/TeleSharp.TL/TL/TLVector.cs diff --git a/src/TeleSharp.TL/TL/Auth/TLRequestSignUp.cs b/src/TeleSharp.TL/TL/Auth/TLRequestSignUp.cs index c562a88..2836973 100644 --- a/src/TeleSharp.TL/TL/Auth/TLRequestSignUp.cs +++ b/src/TeleSharp.TL/TL/Auth/TLRequestSignUp.cs @@ -24,7 +24,8 @@ namespace TeleSharp.TL.Auth public string PhoneCodeHash { get; set; } public string FirstName { get; set; } public string LastName { get; set; } - public Auth.TLAbsAuthorization Response { get; set; } + // manual edit: TLAbsAuthorization->TLAuthorization + public Auth.TLAuthorization Response { get; set; } public void ComputeFlags() { @@ -50,7 +51,8 @@ namespace TeleSharp.TL.Auth public override void DeserializeResponse(BinaryReader br) { - Response = (Auth.TLAbsAuthorization)ObjectUtils.DeserializeObject(br); + // manual edit: TLAbsAuthorization->TLAuthorization + Response = (Auth.TLAuthorization)ObjectUtils.DeserializeObject(br); } } } diff --git a/src/TeleSharp.TL/TL/Contacts/TLRequestGetSaved.cs b/src/TeleSharp.TL/TL/Contacts/TLRequestGetSaved.cs index 034467d..7b4cb60 100644 --- a/src/TeleSharp.TL/TL/Contacts/TLRequestGetSaved.cs +++ b/src/TeleSharp.TL/TL/Contacts/TLRequestGetSaved.cs @@ -20,7 +20,8 @@ namespace TeleSharp.TL.Contacts } } - public TLVector Response { get; set; } + // manual edit: SavedContact -> TLSavedPhoneContact + public TLVector Response { get; set; } public void ComputeFlags() { @@ -40,7 +41,8 @@ namespace TeleSharp.TL.Contacts public override void DeserializeResponse(BinaryReader br) { - Response = (TLVector)ObjectUtils.DeserializeVector(br); + // manual edit: SavedContact -> TLSavedPhoneContact + Response = (TLVector)ObjectUtils.DeserializeVector (br); } } } diff --git a/src/TeleSharp.TL/TL/Payments/TLPaymentForm.cs b/src/TeleSharp.TL/TL/Payments/TLPaymentForm.cs index 5417942..75da9dd 100644 --- a/src/TeleSharp.TL/TL/Payments/TLPaymentForm.cs +++ b/src/TeleSharp.TL/TL/Payments/TLPaymentForm.cs @@ -30,7 +30,8 @@ namespace TeleSharp.TL.Payments public string NativeProvider { get; set; } public TLDataJSON NativeParams { get; set; } public TLPaymentRequestedInfo SavedInfo { get; set; } - public PaymentSavedCredentials SavedCredentials { get; set; } + // manual edit: PaymentSavedCredentials -> TLPaymentSavedCredentialsCard + public TLPaymentSavedCredentialsCard SavedCredentials { get; set; } public TLVector Users { get; set; } public void ComputeFlags() @@ -63,7 +64,8 @@ namespace TeleSharp.TL.Payments SavedInfo = null; if ((Flags & 2) != 0) - SavedCredentials = (PaymentSavedCredentials)ObjectUtils.DeserializeObject(br); + // manual edit: PaymentSavedCredentials -> TLPaymentSavedCredentialsCard + SavedCredentials = (TLPaymentSavedCredentialsCard)ObjectUtils.DeserializeObject(br); else SavedCredentials = null; diff --git a/src/TeleSharp.TL/TL/TLChatPhoto.cs b/src/TeleSharp.TL/TL/TLChatPhoto.cs index 5b49482..4ce91d8 100644 --- a/src/TeleSharp.TL/TL/TLChatPhoto.cs +++ b/src/TeleSharp.TL/TL/TLChatPhoto.cs @@ -20,8 +20,10 @@ namespace TeleSharp.TL } } - public FileLocation PhotoSmall { get; set; } - public FileLocation PhotoBig { get; set; } + // manual edit: FileLocation->TLFileLocationToBeDeprecated + public TLFileLocationToBeDeprecated PhotoSmall { get; set; } + // manual edit: FileLocation->TLFileLocationToBeDeprecated + public TLFileLocationToBeDeprecated PhotoBig { get; set; } public int DcId { get; set; } public void ComputeFlags() @@ -31,8 +33,10 @@ namespace TeleSharp.TL public override void DeserializeBody(BinaryReader br) { - PhotoSmall = (FileLocation)ObjectUtils.DeserializeObject(br); - PhotoBig = (FileLocation)ObjectUtils.DeserializeObject(br); + // manual edit: FileLocation->TLFileLocationToBeDeprecated + PhotoSmall = (TLFileLocationToBeDeprecated)ObjectUtils.DeserializeObject(br); + // manual edit: FileLocation->TLFileLocationToBeDeprecated + PhotoBig = (TLFileLocationToBeDeprecated)ObjectUtils.DeserializeObject(br); DcId = br.ReadInt32(); } diff --git a/src/TeleSharp.TL/TL/TLJsonObject.cs b/src/TeleSharp.TL/TL/TLJsonObject.cs index 5b3d611..3ec19d3 100644 --- a/src/TeleSharp.TL/TL/TLJsonObject.cs +++ b/src/TeleSharp.TL/TL/TLJsonObject.cs @@ -20,7 +20,8 @@ namespace TeleSharp.TL } } - public TLVector Value { get; set; } + // manual edit: TLJSONObjectValue->TLJsonObjectValue + public TLVector Value { get; set; } public void ComputeFlags() { @@ -29,7 +30,8 @@ namespace TeleSharp.TL public override void DeserializeBody(BinaryReader br) { - Value = (TLVector)ObjectUtils.DeserializeVector(br); + // manual edit: TLJSONObjectValue->TLJsonObjectValue + Value = (TLVector)ObjectUtils.DeserializeVector (br); } public override void SerializeBody(BinaryWriter bw) diff --git a/src/TeleSharp.TL/TL/TLPhotoCachedSize.cs b/src/TeleSharp.TL/TL/TLPhotoCachedSize.cs index 1be6cc4..30812b9 100644 --- a/src/TeleSharp.TL/TL/TLPhotoCachedSize.cs +++ b/src/TeleSharp.TL/TL/TLPhotoCachedSize.cs @@ -21,7 +21,8 @@ namespace TeleSharp.TL } public string Type { get; set; } - public FileLocation Location { get; set; } + // manual edit: FileLocation->TLFileLocationToBeDeprecated + public TLFileLocationToBeDeprecated Location { get; set; } public int W { get; set; } public int H { get; set; } public byte[] Bytes { get; set; } @@ -34,7 +35,8 @@ namespace TeleSharp.TL public override void DeserializeBody(BinaryReader br) { Type = StringUtil.Deserialize(br); - Location = (FileLocation)ObjectUtils.DeserializeObject(br); + // manual edit: FileLocation->TLFileLocationToBeDeprecated + Location = (TLFileLocationToBeDeprecated)ObjectUtils.DeserializeObject(br); W = br.ReadInt32(); H = br.ReadInt32(); Bytes = BytesUtil.Deserialize(br); diff --git a/src/TeleSharp.TL/TL/TLPhotoSize.cs b/src/TeleSharp.TL/TL/TLPhotoSize.cs index cc5d94c..22b6f1a 100644 --- a/src/TeleSharp.TL/TL/TLPhotoSize.cs +++ b/src/TeleSharp.TL/TL/TLPhotoSize.cs @@ -21,7 +21,8 @@ namespace TeleSharp.TL } public string Type { get; set; } - public FileLocation Location { get; set; } + // manual edit: FileLocation->TLFileLocationToBeDeprecated + public TLFileLocationToBeDeprecated Location { get; set; } public int W { get; set; } public int H { get; set; } public int Size { get; set; } @@ -34,7 +35,8 @@ namespace TeleSharp.TL public override void DeserializeBody(BinaryReader br) { Type = StringUtil.Deserialize(br); - Location = (FileLocation)ObjectUtils.DeserializeObject(br); + // manual edit: FileLocation->TLFileLocationToBeDeprecated + Location = (TLFileLocationToBeDeprecated)ObjectUtils.DeserializeObject(br); W = br.ReadInt32(); H = br.ReadInt32(); Size = br.ReadInt32(); diff --git a/src/TeleSharp.TL/TL/TLUserProfilePhoto.cs b/src/TeleSharp.TL/TL/TLUserProfilePhoto.cs index fefd669..cafe6a4 100644 --- a/src/TeleSharp.TL/TL/TLUserProfilePhoto.cs +++ b/src/TeleSharp.TL/TL/TLUserProfilePhoto.cs @@ -21,8 +21,10 @@ namespace TeleSharp.TL } public long PhotoId { get; set; } - public FileLocation PhotoSmall { get; set; } - public FileLocation PhotoBig { get; set; } + // manual edit: FileLocation->TLFileLocationToBeDeprecated + public TLFileLocationToBeDeprecated PhotoSmall { get; set; } + // manual edit: FileLocation->TLFileLocationToBeDeprecated + public TLFileLocationToBeDeprecated PhotoBig { get; set; } public int DcId { get; set; } public void ComputeFlags() @@ -33,8 +35,10 @@ namespace TeleSharp.TL public override void DeserializeBody(BinaryReader br) { PhotoId = br.ReadInt64(); - PhotoSmall = (FileLocation)ObjectUtils.DeserializeObject(br); - PhotoBig = (FileLocation)ObjectUtils.DeserializeObject(br); + // manual edit: FileLocation->TLFileLocationToBeDeprecated + PhotoSmall = (TLFileLocationToBeDeprecated)ObjectUtils.DeserializeObject(br); + // manual edit: FileLocation->TLFileLocationToBeDeprecated + PhotoBig = (TLFileLocationToBeDeprecated)ObjectUtils.DeserializeObject(br); DcId = br.ReadInt32(); } diff --git a/src/TeleSharp.TL/TL/TLVector.cs b/src/TeleSharp.TL/TL/TLVector.cs deleted file mode 100644 index 15a0205..0000000 --- a/src/TeleSharp.TL/TL/TLVector.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -using TeleSharp.TL; - -namespace TeleSharp.TL -{ - [TLObject(481674261)] - public class TLVector : TLObject - { - public override int Constructor - { - get - { - return 481674261; - } - } - - // no fields - - public void ComputeFlags() - { - // do nothing - } - - public override void DeserializeBody(BinaryReader br) - { - // do nothing - } - - public override void SerializeBody(BinaryWriter bw) - { - bw.Write(Constructor); - // do nothing - } - } -} diff --git a/src/TeleSharp.TL/TL/TLWebPage.cs b/src/TeleSharp.TL/TL/TLWebPage.cs index ca6dec3..7685bdf 100644 --- a/src/TeleSharp.TL/TL/TLWebPage.cs +++ b/src/TeleSharp.TL/TL/TLWebPage.cs @@ -38,7 +38,8 @@ namespace TeleSharp.TL public string Author { get; set; } public TLAbsDocument Document { get; set; } public TLPage CachedPage { get; set; } - public TLVector Attributes { get; set; } + // manual edit: WebPageAttribute->TLWebPageAttributeTheme + public TLVector Attributes { get; set; } public void ComputeFlags() { @@ -118,7 +119,8 @@ namespace TeleSharp.TL CachedPage = null; if ((Flags & 4096) != 0) - Attributes = (TLVector)ObjectUtils.DeserializeVector(br); + // manual edit: WebPageAttribute->TLWebPageAttributeTheme + Attributes = (TLVector)ObjectUtils.DeserializeVector (br); else Attributes = null;