diff --git a/SplitSource.php b/SplitSource.php index 6fda9987f..b1e51d2e3 100644 --- a/SplitSource.php +++ b/SplitSource.php @@ -257,6 +257,39 @@ function split_file($file, $chunks, $undo) { ); } + if (strpos($new_content, "Td::Td") === false) { // destructor Td::~Td needs to see definitions of all forward-declared classes + $td_methods = array( + 'auth_manager[_(-][^.]|AuthManager' => 'AuthManager', + 'ConfigShared|shared_config[(][)]' => 'ConfigShared', + 'contacts_manager[_(-][^.]|ContactsManager([^ ;.]| [^*])' => 'ContactsManager', + 'file_reference_manager[_(-][^.]|FileReferenceManager|file_references[)]' => 'FileReferenceManager', + 'file_manager[_(-][^.]|FileManager([^ ;.]| [^*])|update_file[)]' => 'files/FileManager', + 'G[(][)]|Global[^A-Za-z]' => 'Global', + 'HashtagHints' => 'HashtagHints', + 'inline_queries_manager[_(-][^.]|InlineQueriesManager' => 'InlineQueriesManager', + 'get_erase_logevent_promise' => 'logevent/LogEventHelper', + 'messages_manager[_(-][^.]|MessagesManager' => 'MessagesManager', + 'notification_manager[_(-][^.]|NotificationManager|notifications[)]' => 'NotificationManager', + 'SecretChatActor' => 'SecretChatActor', + 'secret_chats_manager[_(-][^.]|SecretChatsManager' => 'SecretChatsManager', + '[>](td_db[(][)]|get_td_db_impl[(])|TdDb[^A-Za-z]' => 'TdDb', + 'top_dialog_manager[_(-][^.]|TopDialogManager' => 'TopDialogManager', + 'updates_manager[_(-][^.]|UpdatesManager|get_difference[)]' => 'UpdatesManager', + 'WebPageId(Hash)?' => 'WebPageId', + 'web_pages_manager[_(-][^.]|WebPagesManager' => 'WebPagesManager'); + + foreach ($td_methods as $pattern => $header) { + if (strpos($cpp_name, $header) !== false) { + continue; + } + + $include_name = '#include "td/telegram/'.$header.'.h"'; + if (strpos($new_content, $include_name) !== false && preg_match('/'.$pattern.'/', str_replace($include_name, '', $new_content)) === 0) { + $new_content = str_replace($include_name, '', $new_content); + } + } + } + if (!file_exists($new_files[$n]) || file_get_contents($new_files[$n]) !== $new_content) { echo "Writing file ".$new_files[$n].PHP_EOL; file_put_contents($new_files[$n], $new_content); diff --git a/td/generate/scheme/td_api.tl b/td/generate/scheme/td_api.tl index 4955f7a1c..13f7f79cf 100644 --- a/td/generate/scheme/td_api.tl +++ b/td/generate/scheme/td_api.tl @@ -3245,7 +3245,7 @@ uploadFile file:InputFile file_type:FileType priority:int32 = File; //@description Stops the uploading of a file. Supported only for files uploaded by using uploadFile. For other files the behavior is undefined @file_id Identifier of the file to stop uploading cancelUploadFile file_id:int32 = Ok; -//@description Writes a part of a generated file. This method is intended to be used only if the client has no direct access to the TDLib's file system, because it is usually slower than a direct write to the destination file +//@description Writes a part of a generated file. This method is intended to be used only if the client has no direct access to TDLib's file system, because it is usually slower than a direct write to the destination file //@generation_id The identifier of the generation process @offset The offset from which to write the data to the file @data The data to write writeGeneratedFilePart generation_id:int64 offset:int32 data:bytes = Ok; @@ -3260,7 +3260,7 @@ setFileGenerationProgress generation_id:int64 expected_size:int32 local_prefix_s //@error If set, means that file generation has failed and should be terminated finishFileGeneration generation_id:int64 error:error = Ok; -//@description Reads a part of a file from the TDLib file cache and returns read bytes. This method is intended to be used only if the client has no direct access to the TDLib's file system, because it is usually slower than a direct read from the file +//@description Reads a part of a file from the TDLib file cache and returns read bytes. This method is intended to be used only if the client has no direct access to TDLib's file system, because it is usually slower than a direct read from the file //@file_id Identifier of the file. The file must be located in the TDLib file cache @offset The offset from which to read the file @count Number of bytes to read. An error will be returned if there are not enough bytes available in the file from the specified position readFilePart file_id:int32 offset:int32 count:int32 = FilePart; diff --git a/td/telegram/HashtagHints.h b/td/telegram/HashtagHints.h index 66a946945..a39d62627 100644 --- a/td/telegram/HashtagHints.h +++ b/td/telegram/HashtagHints.h @@ -14,6 +14,7 @@ #include "td/utils/Status.h" namespace td { + class HashtagHints : public Actor { public: HashtagHints(string mode, ActorShared<> parent); @@ -40,4 +41,5 @@ class HashtagHints : public Actor { void from_db(Result data, bool dummy); std::vector keys_to_strings(const std::vector &keys); }; + } // namespace td