diff --git a/SplitSource.php b/SplitSource.php index f3ac19b13..51e2160de 100644 --- a/SplitSource.php +++ b/SplitSource.php @@ -203,7 +203,7 @@ function split_file($file, $chunks, $undo) { $set_sizes[$parent] = 0; } $sets[$parent] .= $f; - $set_sizes[$parent] += preg_match('/Td::~?Td/', $f) ? 1000000 : strlen($f); + $set_sizes[$parent] += strlen($f); } arsort($set_sizes); @@ -293,179 +293,166 @@ function split_file($file, $chunks, $undo) { ); } - if (!preg_match('/Td::~?Td/', $new_content)) { // destructor Td::~Td needs to see definitions of all forward-declared classes - $td_methods = array( - 'AccentColorId' => 'AccentColorId', - 'account_manager[_(-](?![.]get[(][)])|AccountManager[^;>]' => 'AccountManager', - 'animations_manager[_(-](?![.]get[(][)])|AnimationsManager[^;>]' => 'AnimationsManager', - 'attach_menu_manager[_(-](?![.]get[(][)])|AttachMenuManager[^;>]' => 'AttachMenuManager', - 'audios_manager[_(-](?![.]get[(][)])|AudiosManager' => 'AudiosManager', - 'auth_manager[_(-](?![.]get[(][)])|AuthManager' => 'AuthManager', - 'AutoDownloadSettings|[a-z_]*auto_download_settings' => 'AutoDownloadSettings', - 'autosave_manager[_(-](?![.]get[(][)])|AutosaveManager' => 'AutosaveManager', - 'BackgroundId' => 'BackgroundId', - 'background_manager[_(-](?![.]get[(][)])|BackgroundManager' => 'BackgroundManager', - 'BackgroundType' => 'BackgroundType', - 'Birthdate' => 'Birthdate', - 'BotMenuButton|[a-z_]*_menu_button' => 'BotMenuButton', - 'boost_manager[_(-](?![.]get[(][)])|BoostManager' => 'BoostManager', - 'bot_info_manager[_(-](?![.]get[(][)])|BotInfoManager' => 'BotInfoManager', - 'BusinessAwayMessage' => 'BusinessAwayMessage', - 'BusinessChatLink' => 'BusinessChatLink', - 'BusinessConnectedBot' => 'BusinessConnectedBot', - 'BusinessConnectionId' => 'BusinessConnectionId', - 'business_connection_manager[_(-](?![.]get[(][)])|BusinessConnectionManager' => 'BusinessConnectionManager', - 'BusinessGreetingMessage' => 'BusinessGreetingMessage', - 'BusinessInfo|business_info' => 'BusinessInfo', - 'BusinessIntro' => 'BusinessIntro', - 'business_manager[_(-](?![.]get[(][)])|BusinessManager' => 'BusinessManager', - 'BusinessRecipients' => 'BusinessRecipients', - 'BusinessWorkHours' => 'BusinessWorkHours', - 'callback_queries_manager[_(-](?![.]get[(][)])|CallbackQueriesManager' => 'CallbackQueriesManager', - 'CallId' => 'CallId', - 'call_manager[_(-](?![.]get[(][)])|CallManager' => 'CallManager', - 'ChannelId' => 'ChannelId', - 'channel_recommendation_manager[_(-](?![.]get[(][)])|ChannelRecommendationManager' => 'ChannelRecommendationManager', - 'ChatId' => 'ChatId', - 'chat_manager[_(-](?![.]get[(][)])|ChatManager([^ ;.]| [^*])' => 'ChatManager', - 'common_dialog_manager[_(-](?![.]get[(][)])|CommonDialogManager' => 'CommonDialogManager', - 'connection_state_manager[_(-](?![.]get[(][)])|ConnectionStateManager' => 'ConnectionStateManager', - 'country_info_manager[_(-](?![.]get[(][)])|CountryInfoManager' => 'CountryInfoManager', - 'CustomEmojiId' => 'CustomEmojiId', - 'device_token_manager[_(-](?![.]get[(][)])|DeviceTokenManager' => 'DeviceTokenManager', - 'DialogAction[^M]' => 'DialogAction', - 'dialog_action_manager[_(-](?![.]get[(][)])|DialogActionManager' => 'DialogActionManager', - 'DialogFilter[^A-Z]' => 'DialogFilter', - 'DialogFilterId' => 'DialogFilterId', - 'dialog_filter_manager[_(-](?![.]get[(][)])|DialogFilterManager' => 'DialogFilterManager', - 'DialogId' => 'DialogId', - 'dialog_invite_link_manager[_(-](?![.]get[(][)])|DialogInviteLinkManager' => 'DialogInviteLinkManager', - 'DialogListId' => 'DialogListId', - 'DialogLocation' => 'DialogLocation', - 'dialog_manager[_(-](?![.]get[(][)])|DialogManager' => 'DialogManager', - 'DialogParticipantFilter' => 'DialogParticipantFilter', - 'dialog_participant_manager[_(-](?![.]get[(][)])|DialogParticipantManager' => 'DialogParticipantManager', - 'DialogSource' => 'DialogSource', - 'documents_manager[_(-](?![.]get[(][)])|DocumentsManager' => 'DocumentsManager', - 'download_manager[_(-](?![.]get[(][)])|DownloadManager[^C]' => 'DownloadManager', - 'DownloadManagerCallback' => 'DownloadManagerCallback', - 'EmailVerification' => 'EmailVerification', - 'EmojiGroup' => 'EmojiGroup', - 'EmojiStatus|[a-z_]*_emoji_status' => 'EmojiStatus', - 'FactCheck' => 'FactCheck', - 'file_reference_manager[_(-](?![.]get[(][)])|FileReferenceManager|file_references[)]' => 'FileReferenceManager', - 'file_manager[_(-](?![.]get[(][)])|FileManager([^ ;.]| [^*])|update_file[)]' => 'files/FileManager', - 'FolderId' => 'FolderId', - 'forum_topic_manager[_(-](?![.]get[(][)])|ForumTopicManager' => 'ForumTopicManager', - 'game_manager[_(-](?![.]get[(][)])|GameManager' => 'GameManager', - 'G[(][)]|Global[^A-Za-z]' => 'Global', - 'GlobalPrivacySettings' => 'GlobalPrivacySettings', - 'GroupCallId' => 'GroupCallId', - 'group_call_manager[_(-](?![.]get[(][)])|GroupCallManager' => 'GroupCallManager', - 'hashtag_hints[_(-](?![.]get[(][)])|HashtagHints' => 'HashtagHints', - 'inline_message_manager[_(-](?![.]get[(][)])|InlineMessageManager' => 'InlineMessageManager', - 'inline_queries_manager[_(-](?![.]get[(][)])|InlineQueriesManager' => 'InlineQueriesManager', - 'InputBusinessChatLink' => 'InputBusinessChatLink', - 'language_pack_manager[_(-]|LanguagePackManager' => 'LanguagePackManager', - 'link_manager[_(-](?![.]get[(][)])|LinkManager' => 'LinkManager', - 'LogeventIdWithGeneration|add_log_event|delete_log_event|get_erase_log_event_promise|parse_time|store_time' => 'logevent/LogEventHelper', - 'MessageCopyOptions' => 'MessageCopyOptions', - 'MessageEffectId' => 'MessageEffectId', - 'MessageForwardInfo|LastForwardedMessageInfo|forward_info' => 'MessageForwardInfo', - 'MessageFullId' => 'MessageFullId', - 'MessageId' => 'MessageId', - 'message_import_manager[_(-](?![.]get[(][)])|MessageImportManager' => 'MessageImportManager', - 'MessageLinkInfo' => 'MessageLinkInfo', - 'MessageQuote' => 'MessageQuote', - 'MessageReaction|UnreadMessageReaction|[a-z_]*message[a-z_]*reaction' => 'MessageReaction', - 'MessageReactor' => 'MessageReactor', - 'MessageSearchOffset' => 'MessageSearchOffset', - '[a-z_]*_message_sender' => 'MessageSender', - 'messages_manager[_(-](?![.]get[(][)])|MessagesManager' => 'MessagesManager', - 'MessageThreadInfo' => 'MessageThreadInfo', - 'MessageTtl' => 'MessageTtl', - 'MissingInvitee' => 'MissingInvitee', - 'notification_manager[_(-](?![.]get[(][)])|NotificationManager|notifications[)]' => 'NotificationManager', - 'notification_settings_manager[_(-](?![.]get[(][)])|NotificationSettingsManager' => 'NotificationSettingsManager', - 'online_manager[_(-](?![.]get[(][)])|OnlineManager' => 'OnlineManager', - 'option_manager[_(-](?![.]get[(][)])|OptionManager' => 'OptionManager', - 'password_manager[_(-](?![.]get[(][)])|PasswordManager' => 'PasswordManager', - 'people_nearby_manager[_(-](?![.]get[(][)])|PeopleNearbyManager' => 'PeopleNearbyManager', - 'phone_number_manager[_(-](?![.]get[(][)])|PhoneNumberManager' => 'PhoneNumberManager', - 'PhotoSizeSource' => 'PhotoSizeSource', - 'poll_manager[_(-](?![.]get[(][)])|PollManager' => 'PollManager', - 'privacy_manager[_(-](?![.]get[(][)])|PrivacyManager' => 'PrivacyManager', - 'promo_data_manager[_(-](?![.]get[(][)])|PromoDataManager' => 'PromoDataManager', - 'PublicDialogType|get_public_dialog_type' => 'PublicDialogType', - 'quick_reply_manager[_(-](?![.]get[(][)])|QuickReplyManager' => 'QuickReplyManager', - 'ReactionListType|[a-z_]*_reaction_list_type' => 'ReactionListType', - 'reaction_manager[_(-](?![.]get[(][)])|ReactionManager' => 'ReactionManager', - 'ReactionNotificationSettings' => 'ReactionNotificationSettings', - 'ReactionNotificationsFrom' => 'ReactionNotificationsFrom', - 'ReactionType|[a-z_]*_reaction_type' => 'ReactionType', - 'RequestActor|RequestOnceActor' => 'RequestActor', - 'saved_messages_manager[_(-](?![.]get[(][)])|SavedMessagesManager' => 'SavedMessagesManager', - 'ScopeNotificationSettings|[a-z_]*_scope_notification_settings' => 'ScopeNotificationSettings', - 'SecretChatActor' => 'SecretChatActor', - 'secret_chats_manager[_(-]|SecretChatsManager' => 'SecretChatsManager', - 'secure_manager[_(-](?![.]get[(][)])|SecureManager' => 'SecureManager', - 'SentEmailCode' => 'SentEmailCode', - 'SharedDialog' => 'SharedDialog', - 'sponsored_message_manager[_(-](?![.]get[(][)])|SponsoredMessageManager' => 'SponsoredMessageManager', - 'star_manager[_(-](?![.]get[(][)])|StarManager' => 'StarManager', - 'StarSubscription[^P]' => 'StarSubscription', - 'StarSubscriptionPricing' => 'StarSubscriptionPricing', - 'state_manager[_(-](?![.]get[(][)])|StateManager' => 'StateManager', - 'statistics_manager[_(-](?![.]get[(][)])|StatisticsManager' => 'StatisticsManager', - 'StickerSetId' => 'StickerSetId', - 'stickers_manager[_(-](?![.]get[(][)])|StickersManager' => 'StickersManager', - 'storage_manager[_(-](?![.]get[(][)])|StorageManager' => 'StorageManager', - 'StoryId' => 'StoryId', - 'StoryListId' => 'StoryListId', - 'story_manager[_(-](?![.]get[(][)])|StoryManager' => 'StoryManager', - 'SuggestedAction|[a-z_]*_suggested_action' => 'SuggestedAction', - 'SynchronousRequests' => 'SynchronousRequests', - 'td_api' => 'td_api', - 'td_db[(][)]|TdDb[^A-Za-z]' => 'TdDb', - 'telegram_api' => 'telegram_api', - 'terms_of_service_manager[_(-](?![.]get[(][)])|TermsOfServiceManager' => 'TermsOfServiceManager', - 'theme_manager[_(-](?![.]get[(][)])|ThemeManager' => 'ThemeManager', - 'ThemeSettings' => 'ThemeSettings', - 'time_zone_manager[_(-](?![.]get[(][)])|TimeZoneManager' => 'TimeZoneManager', - 'TopDialogCategory|get_top_dialog_category' => 'TopDialogCategory', - 'top_dialog_manager[_(-](?![.]get[(][)])|TopDialogManager' => 'TopDialogManager', - 'translation_manager[_(-](?![.]get[(][)])|TranslationManager' => 'TranslationManager', - 'transcription_manager[_(-](?![.]get[(][)])|TranscriptionManager' => 'TranscriptionManager', - 'updates_manager[_(-](?![.]get[(][)])|UpdatesManager|get_difference[)]|updateSentMessage|dummyUpdate' => 'UpdatesManager', - 'UserId' => 'UserId', - 'user_manager[_(-](?![.]get[(][)])|UserManager([^ ;.]| [^*])' => 'UserManager', - 'video_notes_manager[_(-](?![.]get[(][)])|VideoNotesManager' => 'VideoNotesManager', - 'videos_manager[_(-](?![.]get[(][)])|VideosManager' => 'VideosManager', - 'voice_notes_manager[_(-](?![.]get[(][)])|VoiceNotesManager' => 'VoiceNotesManager', - 'WebPageId(Hash)?' => 'WebPageId', - 'web_pages_manager[_(-](?![.]get[(][)])|WebPagesManager' => 'WebPagesManager'); + $td_methods = array( + 'AccentColorId' => 'AccentColorId', + 'account_manager[_(-](?![.]get[(][)])|AccountManager[^;>]' => 'AccountManager', + 'animations_manager[_(-](?![.]get[(][)])|AnimationsManager[^;>]' => 'AnimationsManager', + 'attach_menu_manager[_(-](?![.]get[(][)])|AttachMenuManager[^;>]' => 'AttachMenuManager', + 'audios_manager[_(-](?![.]get[(][)])|AudiosManager' => 'AudiosManager', + 'auth_manager[_(-](?![.]get[(][)])|AuthManager' => 'AuthManager', + 'AutoDownloadSettings|[a-z_]*auto_download_settings' => 'AutoDownloadSettings', + 'autosave_manager[_(-](?![.]get[(][)])|AutosaveManager' => 'AutosaveManager', + 'BackgroundId' => 'BackgroundId', + 'background_manager[_(-](?![.]get[(][)])|BackgroundManager' => 'BackgroundManager', + 'BackgroundType' => 'BackgroundType', + 'Birthdate' => 'Birthdate', + 'BotMenuButton|[a-z_]*_menu_button' => 'BotMenuButton', + 'boost_manager[_(-](?![.]get[(][)])|BoostManager' => 'BoostManager', + 'bot_info_manager[_(-](?![.]get[(][)])|BotInfoManager' => 'BotInfoManager', + 'BusinessAwayMessage' => 'BusinessAwayMessage', + 'BusinessChatLink' => 'BusinessChatLink', + 'BusinessConnectedBot' => 'BusinessConnectedBot', + 'BusinessConnectionId' => 'BusinessConnectionId', + 'business_connection_manager[_(-](?![.]get[(][)])|BusinessConnectionManager' => 'BusinessConnectionManager', + 'BusinessGreetingMessage' => 'BusinessGreetingMessage', + 'BusinessInfo|business_info' => 'BusinessInfo', + 'BusinessIntro' => 'BusinessIntro', + 'business_manager[_(-](?![.]get[(][)])|BusinessManager' => 'BusinessManager', + 'BusinessRecipients' => 'BusinessRecipients', + 'BusinessWorkHours' => 'BusinessWorkHours', + 'callback_queries_manager[_(-](?![.]get[(][)])|CallbackQueriesManager' => 'CallbackQueriesManager', + 'CallId' => 'CallId', + 'call_manager[_(-](?![.]get[(][)])|CallManager' => 'CallManager', + 'ChannelId' => 'ChannelId', + 'channel_recommendation_manager[_(-](?![.]get[(][)])|ChannelRecommendationManager' => 'ChannelRecommendationManager', + 'ChatId' => 'ChatId', + 'chat_manager[_(-](?![.]get[(][)])|ChatManager([^ ;.]| [^*])' => 'ChatManager', + 'common_dialog_manager[_(-](?![.]get[(][)])|CommonDialogManager' => 'CommonDialogManager', + 'connection_state_manager[_(-](?![.]get[(][)])|ConnectionStateManager' => 'ConnectionStateManager', + 'country_info_manager[_(-](?![.]get[(][)])|CountryInfoManager' => 'CountryInfoManager', + 'CustomEmojiId' => 'CustomEmojiId', + 'device_token_manager[_(-](?![.]get[(][)])|DeviceTokenManager' => 'DeviceTokenManager', + 'DialogAction[^M]' => 'DialogAction', + 'dialog_action_manager[_(-](?![.]get[(][)])|DialogActionManager' => 'DialogActionManager', + 'DialogFilter[^A-Z]' => 'DialogFilter', + 'DialogFilterId' => 'DialogFilterId', + 'dialog_filter_manager[_(-](?![.]get[(][)])|DialogFilterManager' => 'DialogFilterManager', + 'DialogId' => 'DialogId', + 'dialog_invite_link_manager[_(-](?![.]get[(][)])|DialogInviteLinkManager' => 'DialogInviteLinkManager', + 'DialogListId' => 'DialogListId', + 'DialogLocation' => 'DialogLocation', + 'dialog_manager[_(-](?![.]get[(][)])|DialogManager' => 'DialogManager', + 'DialogParticipantFilter' => 'DialogParticipantFilter', + 'dialog_participant_manager[_(-](?![.]get[(][)])|DialogParticipantManager' => 'DialogParticipantManager', + 'DialogSource' => 'DialogSource', + 'documents_manager[_(-](?![.]get[(][)])|DocumentsManager' => 'DocumentsManager', + 'download_manager[_(-](?![.]get[(][)])|DownloadManager[^C]' => 'DownloadManager', + 'DownloadManagerCallback' => 'DownloadManagerCallback', + 'EmailVerification' => 'EmailVerification', + 'EmojiGroup' => 'EmojiGroup', + 'EmojiStatus|[a-z_]*_emoji_status' => 'EmojiStatus', + 'FactCheck' => 'FactCheck', + 'file_reference_manager[_(-](?![.]get[(][)])|FileReferenceManager|file_references[)]' => 'FileReferenceManager', + 'file_manager[_(-](?![.]get[(][)])|FileManager([^ ;.]| [^*])|update_file[)]' => 'files/FileManager', + 'FolderId' => 'FolderId', + 'forum_topic_manager[_(-](?![.]get[(][)])|ForumTopicManager' => 'ForumTopicManager', + 'game_manager[_(-](?![.]get[(][)])|GameManager' => 'GameManager', + 'G[(][)]|Global[^A-Za-z]' => 'Global', + 'GlobalPrivacySettings' => 'GlobalPrivacySettings', + 'GroupCallId' => 'GroupCallId', + 'group_call_manager[_(-](?![.]get[(][)])|GroupCallManager' => 'GroupCallManager', + 'hashtag_hints[_(-](?![.]get[(][)])|HashtagHints' => 'HashtagHints', + 'inline_message_manager[_(-](?![.]get[(][)])|InlineMessageManager' => 'InlineMessageManager', + 'inline_queries_manager[_(-](?![.]get[(][)])|InlineQueriesManager' => 'InlineQueriesManager', + 'InputBusinessChatLink' => 'InputBusinessChatLink', + 'language_pack_manager[_(-]|LanguagePackManager' => 'LanguagePackManager', + 'link_manager[_(-](?![.]get[(][)])|LinkManager' => 'LinkManager', + 'LogeventIdWithGeneration|add_log_event|delete_log_event|get_erase_log_event_promise|parse_time|store_time' => 'logevent/LogEventHelper', + 'MessageCopyOptions' => 'MessageCopyOptions', + 'MessageEffectId' => 'MessageEffectId', + 'MessageForwardInfo|LastForwardedMessageInfo|forward_info' => 'MessageForwardInfo', + 'MessageFullId' => 'MessageFullId', + 'MessageId' => 'MessageId', + 'message_import_manager[_(-](?![.]get[(][)])|MessageImportManager' => 'MessageImportManager', + 'MessageLinkInfo' => 'MessageLinkInfo', + 'MessageQuote' => 'MessageQuote', + 'MessageReaction|UnreadMessageReaction|[a-z_]*message[a-z_]*reaction' => 'MessageReaction', + 'MessageReactor' => 'MessageReactor', + 'MessageSearchOffset' => 'MessageSearchOffset', + '[a-z_]*_message_sender' => 'MessageSender', + 'messages_manager[_(-](?![.]get[(][)])|MessagesManager' => 'MessagesManager', + 'MessageThreadInfo' => 'MessageThreadInfo', + 'MessageTtl' => 'MessageTtl', + 'MissingInvitee' => 'MissingInvitee', + 'notification_manager[_(-](?![.]get[(][)])|NotificationManager|notifications[)]' => 'NotificationManager', + 'notification_settings_manager[_(-](?![.]get[(][)])|NotificationSettingsManager' => 'NotificationSettingsManager', + 'online_manager[_(-](?![.]get[(][)])|OnlineManager' => 'OnlineManager', + 'option_manager[_(-](?![.]get[(][)])|OptionManager' => 'OptionManager', + 'password_manager[_(-](?![.]get[(][)])|PasswordManager' => 'PasswordManager', + 'people_nearby_manager[_(-](?![.]get[(][)])|PeopleNearbyManager' => 'PeopleNearbyManager', + 'phone_number_manager[_(-](?![.]get[(][)])|PhoneNumberManager' => 'PhoneNumberManager', + 'PhotoSizeSource' => 'PhotoSizeSource', + 'poll_manager[_(-](?![.]get[(][)])|PollManager' => 'PollManager', + 'privacy_manager[_(-](?![.]get[(][)])|PrivacyManager' => 'PrivacyManager', + 'promo_data_manager[_(-](?![.]get[(][)])|PromoDataManager' => 'PromoDataManager', + 'PublicDialogType|get_public_dialog_type' => 'PublicDialogType', + 'quick_reply_manager[_(-](?![.]get[(][)])|QuickReplyManager' => 'QuickReplyManager', + 'ReactionListType|[a-z_]*_reaction_list_type' => 'ReactionListType', + 'reaction_manager[_(-](?![.]get[(][)])|ReactionManager' => 'ReactionManager', + 'ReactionNotificationSettings' => 'ReactionNotificationSettings', + 'ReactionNotificationsFrom' => 'ReactionNotificationsFrom', + 'ReactionType|[a-z_]*_reaction_type' => 'ReactionType', + 'RequestActor|RequestOnceActor' => 'RequestActor', + 'saved_messages_manager[_(-](?![.]get[(][)])|SavedMessagesManager' => 'SavedMessagesManager', + 'ScopeNotificationSettings|[a-z_]*_scope_notification_settings' => 'ScopeNotificationSettings', + 'SecretChatActor' => 'SecretChatActor', + 'secret_chats_manager[_(-]|SecretChatsManager' => 'SecretChatsManager', + 'secure_manager[_(-](?![.]get[(][)])|SecureManager' => 'SecureManager', + 'SentEmailCode' => 'SentEmailCode', + 'SharedDialog' => 'SharedDialog', + 'sponsored_message_manager[_(-](?![.]get[(][)])|SponsoredMessageManager' => 'SponsoredMessageManager', + 'star_manager[_(-](?![.]get[(][)])|StarManager' => 'StarManager', + 'StarSubscription[^P]' => 'StarSubscription', + 'StarSubscriptionPricing' => 'StarSubscriptionPricing', + 'state_manager[_(-](?![.]get[(][)])|StateManager' => 'StateManager', + 'statistics_manager[_(-](?![.]get[(][)])|StatisticsManager' => 'StatisticsManager', + 'StickerSetId' => 'StickerSetId', + 'stickers_manager[_(-](?![.]get[(][)])|StickersManager' => 'StickersManager', + 'storage_manager[_(-](?![.]get[(][)])|StorageManager' => 'StorageManager', + 'StoryId' => 'StoryId', + 'StoryListId' => 'StoryListId', + 'story_manager[_(-](?![.]get[(][)])|StoryManager' => 'StoryManager', + 'SuggestedAction|[a-z_]*_suggested_action' => 'SuggestedAction', + 'SynchronousRequests' => 'SynchronousRequests', + 'td_api' => 'td_api', + 'td_db[(][)]|TdDb[^A-Za-z]' => 'TdDb', + 'telegram_api' => 'telegram_api', + 'terms_of_service_manager[_(-](?![.]get[(][)])|TermsOfServiceManager' => 'TermsOfServiceManager', + 'theme_manager[_(-](?![.]get[(][)])|ThemeManager' => 'ThemeManager', + 'ThemeSettings' => 'ThemeSettings', + 'time_zone_manager[_(-](?![.]get[(][)])|TimeZoneManager' => 'TimeZoneManager', + 'TopDialogCategory|get_top_dialog_category' => 'TopDialogCategory', + 'top_dialog_manager[_(-](?![.]get[(][)])|TopDialogManager' => 'TopDialogManager', + 'translation_manager[_(-](?![.]get[(][)])|TranslationManager' => 'TranslationManager', + 'transcription_manager[_(-](?![.]get[(][)])|TranscriptionManager' => 'TranscriptionManager', + 'updates_manager[_(-](?![.]get[(][)])|UpdatesManager|get_difference[)]|updateSentMessage|dummyUpdate' => 'UpdatesManager', + 'UserId' => 'UserId', + 'user_manager[_(-](?![.]get[(][)])|UserManager([^ ;.]| [^*])' => 'UserManager', + 'video_notes_manager[_(-](?![.]get[(][)])|VideoNotesManager' => 'VideoNotesManager', + 'videos_manager[_(-](?![.]get[(][)])|VideosManager' => 'VideosManager', + 'voice_notes_manager[_(-](?![.]get[(][)])|VoiceNotesManager' => 'VoiceNotesManager', + 'WebPageId(Hash)?' => 'WebPageId', + 'web_pages_manager[_(-](?![.]get[(][)])|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('/[^a-zA-Z0-9_]('.$pattern.')/', str_replace($include_name, '', $new_content)) === 0) { - $new_content = str_replace($include_name, '', $new_content); - } + 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('/[^a-zA-Z0-9_]('.$pattern.')/', str_replace($include_name, '', $new_content)) === 0) { + $new_content = str_replace($include_name, '', $new_content); } - } else { - $new_content = preg_replace_callback( - '|#include "[a-z_A-Z/0-9.]*"|', - function ($matches) { - if (strpos($matches[0], "Manager") !== false || strpos($matches[0], "HashtagHints") !== false || strpos($matches[0], "Td.h") !== false) { - return $matches[0]; - } - return ''; - }, - $new_content - ); } if (!file_exists($new_files[$n]) || file_get_contents($new_files[$n]) !== $new_content) { @@ -487,8 +474,8 @@ $undo = in_array('--undo', $argv) || in_array('-u', $argv); $files = array('td/telegram/ChatManager' => 10, 'td/telegram/MessagesManager' => 50, 'td/telegram/NotificationManager' => 10, + 'td/telegram/Requests' => 50, 'td/telegram/StickersManager' => 10, - 'td/telegram/Td' => 50, 'td/telegram/UserManager' => 10, 'td/generate/auto/td/telegram/td_api' => 10, 'td/generate/auto/td/telegram/td_api_json' => 10,