diff --git a/td/generate/DotnetTlDocumentationGenerator.php b/td/generate/DotnetTlDocumentationGenerator.php index fc7b99b8b..2c8977028 100644 --- a/td/generate/DotnetTlDocumentationGenerator.php +++ b/td/generate/DotnetTlDocumentationGenerator.php @@ -177,7 +177,7 @@ EOT protected function addFieldDocumentation($class_name, $field_name, $type_name, $field_info, $may_be_null) { $end = ';'; - if (substr($type_name, 0, strlen($field_name)) === $field_name) { + if ($type_name == $field_name.'^' || ($type_name == 'Message^' && $field_name == 'ReplyToMessage')) { $type_name = '::Telegram::Td::Api::'.$type_name; $end = ' {'; } diff --git a/td/generate/tl_writer_dotnet.h b/td/generate/tl_writer_dotnet.h index dfb34637e..673144aeb 100644 --- a/td/generate/tl_writer_dotnet.h +++ b/td/generate/tl_writer_dotnet.h @@ -244,7 +244,7 @@ class TlWriterDotNet final : public TL_writer { if (field_name == class_name) { fixed_field_name += "Value"; } - if (type_name.substr(0, field_name.size()) == field_name) { + if (type_name == field_name + "^" || (type_name == "Message^" && field_name == "ReplyToMessage")) { auto fixed_type_name = "::Telegram::Td::Api::" + type_name; std::stringstream ss; ss << "private:\n";