From 019609c91ae5ed1741e27c323072d48d13325e8d Mon Sep 17 00:00:00 2001 From: levlam Date: Thu, 25 Apr 2024 23:49:18 +0300 Subject: [PATCH] Fix .NET binding. --- td/generate/DotnetTlDocumentationGenerator.php | 3 +++ td/generate/tl_writer_dotnet.h | 8 ++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/td/generate/DotnetTlDocumentationGenerator.php b/td/generate/DotnetTlDocumentationGenerator.php index 2c8977028..f6bb561f3 100644 --- a/td/generate/DotnetTlDocumentationGenerator.php +++ b/td/generate/DotnetTlDocumentationGenerator.php @@ -180,6 +180,9 @@ EOT if ($type_name == $field_name.'^' || ($type_name == 'Message^' && $field_name == 'ReplyToMessage')) { $type_name = '::Telegram::Td::Api::'.$type_name; $end = ' {'; + } else if ($class_name == "WebPage" && $field_name == "Stickers" && $type_name == "Array^") { + $type_name = 'Array<::Telegram::Td::Api::Sticker^>^'; + $end = ' {'; } $full_line = $class_name." property $type_name $field_name$end"; $this->addDocumentation($full_line, <<^"); + if (type_name == field_name + "^" || (type_name == "Message^" && field_name == "ReplyToMessage") || + is_web_page_stickers) { + auto fixed_type_name = + is_web_page_stickers ? "Array<::Telegram::Td::Api::Sticker^>^" : "::Telegram::Td::Api::" + type_name; std::stringstream ss; ss << "private:\n"; ss << " " << fixed_type_name << " " << fixed_field_name << "PrivateField;\n";