@mtkruto/node 0.62.0 → 0.63.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/2_tl.d.ts +6 -6
- package/esm/2_tl.d.ts.map +1 -1
- package/esm/2_tl.js +6 -6
- package/esm/3_errors.d.ts +1 -2
- package/esm/3_errors.d.ts.map +1 -1
- package/esm/3_errors.js +2 -1
- package/esm/4_constants.d.ts +0 -1
- package/esm/4_constants.d.ts.map +1 -1
- package/esm/4_constants.js +0 -1
- package/esm/4_errors.d.ts +2 -2
- package/esm/4_errors.d.ts.map +1 -1
- package/esm/4_session.d.ts +24 -0
- package/esm/4_session.d.ts.map +1 -0
- package/esm/4_session.js +23 -0
- package/esm/5_client.d.ts +1 -1
- package/esm/5_client.js +1 -1
- package/esm/client/0_client_abstract.d.ts +28 -26
- package/esm/client/0_client_abstract.d.ts.map +1 -1
- package/esm/client/0_client_abstract.js +16 -88
- package/esm/client/0_params.d.ts +5 -0
- package/esm/client/0_params.d.ts.map +1 -1
- package/esm/client/0_password.d.ts.map +1 -1
- package/esm/client/0_password.js +2 -2
- package/esm/client/0_storage_operations.d.ts +4 -4
- package/esm/client/0_storage_operations.d.ts.map +1 -1
- package/esm/client/0_storage_operations.js +14 -14
- package/esm/client/0_update_processor.d.ts +19 -0
- package/esm/client/0_update_processor.d.ts.map +1 -1
- package/esm/client/0_update_processor.js +19 -0
- package/esm/client/0_utilities.d.ts +6 -2
- package/esm/client/0_utilities.d.ts.map +1 -1
- package/esm/client/0_utilities.js +21 -23
- package/esm/client/1_client_plain.d.ts +9 -6
- package/esm/client/1_client_plain.d.ts.map +1 -1
- package/esm/client/1_client_plain.js +26 -41
- package/esm/client/1_types.d.ts +4 -23
- package/esm/client/1_types.d.ts.map +1 -1
- package/esm/client/2_account_manager.js +10 -10
- package/esm/client/2_business_connection_manager.d.ts.map +1 -1
- package/esm/client/2_business_connection_manager.js +4 -4
- package/esm/client/2_client_encrypted.d.ts +58 -0
- package/esm/client/2_client_encrypted.d.ts.map +1 -0
- package/esm/client/2_client_encrypted.js +265 -0
- package/esm/client/2_file_manager.d.ts.map +1 -1
- package/esm/client/2_file_manager.js +54 -74
- package/esm/client/2_network_statistics_manager.d.ts +1 -1
- package/esm/client/2_network_statistics_manager.d.ts.map +1 -1
- package/esm/client/2_network_statistics_manager.js +3 -3
- package/esm/client/2_payment_manager.d.ts.map +1 -1
- package/esm/client/2_payment_manager.js +3 -3
- package/esm/client/2_reaction_manager.d.ts.map +1 -1
- package/esm/client/2_reaction_manager.js +10 -10
- package/esm/client/2_translations_manager.d.ts +19 -0
- package/esm/client/2_translations_manager.d.ts.map +1 -1
- package/esm/client/2_translations_manager.js +24 -5
- package/esm/client/2_update_manager.d.ts +4 -4
- package/esm/client/2_update_manager.d.ts.map +1 -1
- package/esm/client/2_update_manager.js +69 -79
- package/esm/client/3_client_encrypted_pool.d.ts +30 -0
- package/esm/client/3_client_encrypted_pool.d.ts.map +1 -0
- package/esm/client/3_client_encrypted_pool.js +70 -0
- package/esm/client/3_message_manager.d.ts.map +1 -1
- package/esm/client/3_message_manager.js +100 -74
- package/esm/client/3_video_chat_manager.d.ts.map +1 -1
- package/esm/client/3_video_chat_manager.js +15 -20
- package/esm/client/4_callback_query_manager.d.ts.map +1 -1
- package/esm/client/4_callback_query_manager.js +2 -2
- package/esm/client/4_chat_list_manager.d.ts.map +1 -1
- package/esm/client/4_chat_list_manager.js +33 -33
- package/esm/client/4_chat_manager.d.ts.map +1 -1
- package/esm/client/4_chat_manager.js +25 -25
- package/esm/client/4_gift_manager.js +2 -2
- package/esm/client/4_inline_query_manager.d.ts.map +1 -1
- package/esm/client/4_inline_query_manager.js +4 -4
- package/esm/client/4_poll_manager.d.ts.map +1 -1
- package/esm/client/4_poll_manager.js +5 -5
- package/esm/client/4_story_manager.d.ts.map +1 -1
- package/esm/client/4_story_manager.js +10 -10
- package/esm/client/5_client.d.ts +3 -9
- package/esm/client/5_client.d.ts.map +1 -1
- package/esm/client/5_client.js +290 -306
- package/esm/connection/0_connection.d.ts +5 -4
- package/esm/connection/0_connection.d.ts.map +1 -1
- package/esm/connection/1_connection_web_socket.js +2 -2
- package/esm/mod.d.ts +1 -1
- package/esm/mod.d.ts.map +1 -1
- package/esm/mod.js +1 -1
- package/{script/tl/2_tl_reader.d.ts → esm/session/0_session_error.d.ts} +4 -7
- package/esm/session/0_session_error.d.ts.map +1 -0
- package/esm/{tl/2_tl_reader.d.ts → session/0_session_error.js} +5 -7
- package/esm/{tl/2_tl_writer.d.ts → session/0_session_state.d.ts} +7 -5
- package/esm/session/0_session_state.d.ts.map +1 -0
- package/esm/session/0_session_state.js +77 -0
- package/esm/session/1_session.d.ts +31 -0
- package/esm/session/1_session.d.ts.map +1 -0
- package/esm/session/1_session.js +149 -0
- package/esm/session/2_session_encrypted.d.ts +40 -0
- package/esm/session/2_session_encrypted.d.ts.map +1 -0
- package/esm/session/2_session_encrypted.js +416 -0
- package/esm/session/2_session_plain.d.ts +25 -0
- package/esm/session/2_session_plain.d.ts.map +1 -0
- package/esm/session/2_session_plain.js +56 -0
- package/esm/tl/0_tl_error.d.ts +22 -0
- package/esm/tl/0_tl_error.d.ts.map +1 -0
- package/esm/tl/0_tl_error.js +21 -0
- package/esm/tl/0_types.d.ts +25 -0
- package/esm/tl/0_types.d.ts.map +1 -0
- package/esm/tl/0_types.js +20 -0
- package/esm/tl/0_utilities.d.ts +32 -0
- package/esm/tl/0_utilities.d.ts.map +1 -0
- package/esm/tl/0_utilities.js +51 -0
- package/esm/tl/0_utilities_test.d.ts.map +1 -0
- package/esm/tl/1_mtproto_api.d.ts +371 -0
- package/esm/tl/1_mtproto_api.d.ts.map +1 -0
- package/esm/tl/1_mtproto_api.js +416 -0
- package/esm/tl/{0_api.d.ts → 1_telegram_api.d.ts} +23 -340
- package/esm/tl/1_telegram_api.d.ts.map +1 -0
- package/esm/tl/{0_api.js → 1_telegram_api.js} +4945 -11109
- package/{script/tl/0_tl_raw_reader.d.ts → esm/tl/1_tl_reader.d.ts} +5 -2
- package/esm/tl/1_tl_reader.d.ts.map +1 -0
- package/esm/tl/{2_tl_reader.js → 1_tl_reader.js} +107 -40
- package/esm/tl/1_tl_reader_test.d.ts.map +1 -0
- package/esm/tl/{0_tl_raw_writer.d.ts → 1_tl_writer.d.ts} +5 -2
- package/esm/tl/1_tl_writer.d.ts.map +1 -0
- package/esm/tl/{2_tl_writer.js → 1_tl_writer.js} +80 -23
- package/esm/tl/1_tl_writer_test.d.ts.map +1 -0
- package/esm/tl/1_utilities.d.ts +9 -24
- package/esm/tl/1_utilities.d.ts.map +1 -1
- package/esm/tl/1_utilities.js +18 -64
- package/esm/tl/2_message.d.ts +2 -2
- package/esm/tl/2_message.d.ts.map +1 -1
- package/esm/tl/2_message.js +7 -7
- package/esm/tl/2_mtproto.d.ts +33 -0
- package/esm/tl/2_mtproto.d.ts.map +1 -0
- package/esm/tl/2_mtproto.js +53 -0
- package/{script/tl/2_utilities.d.ts → esm/tl/2_telegram.d.ts} +16 -2
- package/esm/tl/2_telegram.d.ts.map +1 -0
- package/esm/tl/{2_utilities.js → 2_telegram.js} +46 -1
- package/esm/transport/0_transport.d.ts +1 -1
- package/esm/transport/0_transport.d.ts.map +1 -1
- package/esm/types/0_chat_photo.d.ts.map +1 -1
- package/esm/types/0_chat_photo.js +2 -2
- package/esm/types/0_giveaway_parameters.d.ts.map +1 -1
- package/esm/types/0_giveaway_parameters.js +3 -3
- package/esm/types/0_location.d.ts.map +1 -1
- package/esm/types/0_location.js +5 -5
- package/esm/types/0_message_entity.d.ts.map +1 -1
- package/esm/types/0_message_entity.js +20 -20
- package/esm/types/0_reaction.d.ts.map +1 -1
- package/esm/types/0_reaction.js +4 -4
- package/esm/types/0_slow_mode_duration.d.ts +19 -0
- package/esm/types/0_slow_mode_duration.d.ts.map +1 -1
- package/esm/types/0_slow_mode_duration.js +19 -0
- package/esm/types/0_thumbnail.d.ts.map +1 -1
- package/esm/types/0_thumbnail.js +3 -3
- package/esm/types/0_translation.d.ts +19 -0
- package/esm/types/0_translation.d.ts.map +1 -1
- package/esm/types/0_translation.js +22 -3
- package/esm/types/0_video_chat.d.ts.map +1 -1
- package/esm/types/0_video_chat.js +2 -2
- package/esm/types/1_animation.d.ts.map +1 -1
- package/esm/types/1_animation.js +2 -2
- package/esm/types/1_audio.d.ts.map +1 -1
- package/esm/types/1_audio.js +2 -2
- package/esm/types/1_bot_command_scope.d.ts.map +1 -1
- package/esm/types/1_bot_command_scope.js +2 -2
- package/esm/types/1_chat_p.d.ts.map +1 -1
- package/esm/types/1_chat_p.js +6 -6
- package/esm/types/1_document.d.ts.map +1 -1
- package/esm/types/1_document.js +2 -2
- package/esm/types/1_keyboard_button.d.ts.map +1 -1
- package/esm/types/1_keyboard_button.js +10 -10
- package/esm/types/1_message_reaction.d.ts.map +1 -1
- package/esm/types/1_message_reaction.js +6 -6
- package/esm/types/1_photo.d.ts.map +1 -1
- package/esm/types/1_photo.js +3 -3
- package/esm/types/1_sticker.d.ts.map +1 -1
- package/esm/types/1_sticker.js +8 -8
- package/esm/types/1_story_privacy.d.ts.map +1 -1
- package/esm/types/1_story_privacy.js +7 -7
- package/esm/types/1_user.d.ts.map +1 -1
- package/esm/types/1_user.js +2 -2
- package/esm/types/1_venue.d.ts.map +1 -1
- package/esm/types/1_venue.js +2 -2
- package/esm/types/1_video.d.ts.map +1 -1
- package/esm/types/1_video.js +2 -2
- package/esm/types/1_video_note.d.ts.map +1 -1
- package/esm/types/1_video_note.js +2 -2
- package/esm/types/2_chat.d.ts.map +1 -1
- package/esm/types/2_chat.js +8 -8
- package/esm/types/2_chat_member.d.ts.map +1 -1
- package/esm/types/2_chat_member.js +10 -10
- package/esm/types/2_chat_settings.d.ts +19 -0
- package/esm/types/2_chat_settings.d.ts.map +1 -1
- package/esm/types/2_chat_settings.js +21 -2
- package/esm/types/2_chosen_inline_result.d.ts.map +1 -1
- package/esm/types/2_chosen_inline_result.js +4 -4
- package/esm/types/2_game.d.ts.map +1 -1
- package/esm/types/2_game.js +4 -4
- package/esm/types/2_gift_upgraded_component.d.ts.map +1 -1
- package/esm/types/2_gift_upgraded_component.js +3 -3
- package/esm/types/2_inactive_chat.d.ts.map +1 -1
- package/esm/types/2_inactive_chat.js +2 -2
- package/esm/types/2_inline_keyboard_button.d.ts.map +1 -1
- package/esm/types/2_inline_keyboard_button.js +10 -10
- package/esm/types/2_inline_query.d.ts.map +1 -1
- package/esm/types/2_inline_query.js +7 -7
- package/esm/types/2_message_reactions.d.ts.map +1 -1
- package/esm/types/2_message_reactions.js +2 -2
- package/esm/types/2_story_content.d.ts.map +1 -1
- package/esm/types/2_story_content.js +6 -6
- package/esm/types/2_story_interactive_area.d.ts.map +1 -1
- package/esm/types/2_story_interactive_area.js +9 -9
- package/esm/types/3_chat_member_updated.d.ts.map +1 -1
- package/esm/types/3_chat_member_updated.js +2 -2
- package/esm/types/3_gift.d.ts.map +1 -1
- package/esm/types/3_gift.js +3 -3
- package/esm/types/3_join_request.d.ts.map +1 -1
- package/esm/types/3_join_request.js +2 -2
- package/esm/types/3_reply_markup.d.ts.map +1 -1
- package/esm/types/3_reply_markup.js +5 -5
- package/esm/types/4_claimed_gift.d.ts.map +1 -1
- package/esm/types/4_claimed_gift.js +2 -2
- package/esm/types/4_inline_query_result.d.ts.map +1 -1
- package/esm/types/4_inline_query_result.js +14 -14
- package/esm/types/4_message.d.ts.map +1 -1
- package/esm/types/4_message.js +57 -57
- package/esm/types/5_callback_query.d.ts +1 -1
- package/esm/types/5_callback_query.d.ts.map +1 -1
- package/esm/types/5_callback_query.js +7 -8
- package/esm/types/5_chat_list_item.d.ts.map +1 -1
- package/esm/types/5_chat_list_item.js +5 -5
- package/esm/types/5_claimed_gifts.d.ts.map +1 -1
- package/esm/types/5_claimed_gifts.js +6 -6
- package/esm/types/_file_id.d.ts.map +1 -1
- package/esm/types/_file_id.js +3 -3
- package/package.json +1 -1
- package/script/2_tl.d.ts +6 -6
- package/script/2_tl.d.ts.map +1 -1
- package/script/2_tl.js +11 -11
- package/script/3_errors.d.ts +1 -2
- package/script/3_errors.d.ts.map +1 -1
- package/script/3_errors.js +2 -1
- package/script/4_constants.d.ts +0 -1
- package/script/4_constants.d.ts.map +1 -1
- package/script/4_constants.js +1 -2
- package/script/4_errors.d.ts +2 -2
- package/script/4_errors.d.ts.map +1 -1
- package/script/4_session.d.ts +24 -0
- package/script/4_session.d.ts.map +1 -0
- package/script/4_session.js +39 -0
- package/script/5_client.d.ts +1 -1
- package/script/5_client.js +1 -1
- package/script/client/0_client_abstract.d.ts +28 -26
- package/script/client/0_client_abstract.d.ts.map +1 -1
- package/script/client/0_client_abstract.js +18 -113
- package/script/client/0_params.d.ts +5 -0
- package/script/client/0_params.d.ts.map +1 -1
- package/script/client/0_password.d.ts.map +1 -1
- package/script/client/0_password.js +1 -1
- package/script/client/0_storage_operations.d.ts +4 -4
- package/script/client/0_storage_operations.d.ts.map +1 -1
- package/script/client/0_storage_operations.js +13 -13
- package/script/client/0_update_processor.d.ts +19 -0
- package/script/client/0_update_processor.d.ts.map +1 -1
- package/script/client/0_update_processor.js +19 -0
- package/script/client/0_utilities.d.ts +6 -2
- package/script/client/0_utilities.d.ts.map +1 -1
- package/script/client/0_utilities.js +22 -24
- package/script/client/1_client_plain.d.ts +9 -6
- package/script/client/1_client_plain.d.ts.map +1 -1
- package/script/client/1_client_plain.js +25 -40
- package/script/client/1_types.d.ts +4 -23
- package/script/client/1_types.d.ts.map +1 -1
- package/script/client/2_account_manager.js +9 -9
- package/script/client/2_business_connection_manager.d.ts.map +1 -1
- package/script/client/2_business_connection_manager.js +3 -3
- package/script/client/2_client_encrypted.d.ts +58 -0
- package/script/client/2_client_encrypted.d.ts.map +1 -0
- package/script/client/2_client_encrypted.js +269 -0
- package/script/client/2_file_manager.d.ts.map +1 -1
- package/script/client/2_file_manager.js +52 -72
- package/script/client/2_network_statistics_manager.d.ts +1 -1
- package/script/client/2_network_statistics_manager.d.ts.map +1 -1
- package/script/client/2_network_statistics_manager.js +3 -3
- package/script/client/2_payment_manager.d.ts.map +1 -1
- package/script/client/2_payment_manager.js +2 -2
- package/script/client/2_reaction_manager.d.ts.map +1 -1
- package/script/client/2_reaction_manager.js +9 -9
- package/script/client/2_translations_manager.d.ts +19 -0
- package/script/client/2_translations_manager.d.ts.map +1 -1
- package/script/client/2_translations_manager.js +23 -4
- package/script/client/2_update_manager.d.ts +4 -4
- package/script/client/2_update_manager.d.ts.map +1 -1
- package/script/client/2_update_manager.js +68 -78
- package/script/client/3_client_encrypted_pool.d.ts +30 -0
- package/script/client/3_client_encrypted_pool.d.ts.map +1 -0
- package/script/client/3_client_encrypted_pool.js +74 -0
- package/script/client/3_message_manager.d.ts.map +1 -1
- package/script/client/3_message_manager.js +99 -73
- package/script/client/3_video_chat_manager.d.ts.map +1 -1
- package/script/client/3_video_chat_manager.js +14 -19
- package/script/client/4_callback_query_manager.d.ts.map +1 -1
- package/script/client/4_callback_query_manager.js +1 -1
- package/script/client/4_chat_list_manager.d.ts.map +1 -1
- package/script/client/4_chat_list_manager.js +32 -32
- package/script/client/4_chat_manager.d.ts.map +1 -1
- package/script/client/4_chat_manager.js +24 -24
- package/script/client/4_gift_manager.js +1 -1
- package/script/client/4_inline_query_manager.d.ts.map +1 -1
- package/script/client/4_inline_query_manager.js +3 -3
- package/script/client/4_poll_manager.d.ts.map +1 -1
- package/script/client/4_poll_manager.js +4 -4
- package/script/client/4_story_manager.d.ts.map +1 -1
- package/script/client/4_story_manager.js +9 -9
- package/script/client/5_client.d.ts +3 -9
- package/script/client/5_client.d.ts.map +1 -1
- package/script/client/5_client.js +284 -300
- package/script/connection/0_connection.d.ts +5 -4
- package/script/connection/0_connection.d.ts.map +1 -1
- package/script/connection/1_connection_web_socket.js +2 -2
- package/script/mod.d.ts +1 -1
- package/script/mod.d.ts.map +1 -1
- package/script/mod.js +1 -2
- package/script/session/0_session_error.d.ts +24 -0
- package/script/session/0_session_error.d.ts.map +1 -0
- package/script/session/0_session_error.js +29 -0
- package/script/{tl/2_tl_writer.d.ts → session/0_session_state.d.ts} +7 -5
- package/script/session/0_session_state.d.ts.map +1 -0
- package/script/session/0_session_state.js +81 -0
- package/script/session/1_session.d.ts +31 -0
- package/script/session/1_session.d.ts.map +1 -0
- package/script/session/1_session.js +176 -0
- package/script/session/2_session_encrypted.d.ts +40 -0
- package/script/session/2_session_encrypted.d.ts.map +1 -0
- package/script/session/2_session_encrypted.js +420 -0
- package/script/session/2_session_plain.d.ts +25 -0
- package/script/session/2_session_plain.d.ts.map +1 -0
- package/script/session/2_session_plain.js +60 -0
- package/script/tl/0_tl_error.d.ts +22 -0
- package/script/tl/0_tl_error.d.ts.map +1 -0
- package/script/tl/0_tl_error.js +25 -0
- package/script/tl/0_types.d.ts +25 -0
- package/script/tl/0_types.d.ts.map +1 -0
- package/script/tl/0_types.js +21 -0
- package/script/tl/0_utilities.d.ts +32 -0
- package/script/tl/0_utilities.d.ts.map +1 -0
- package/script/tl/0_utilities.js +59 -0
- package/script/tl/0_utilities_test.d.ts.map +1 -0
- package/script/tl/1_mtproto_api.d.ts +371 -0
- package/script/tl/1_mtproto_api.d.ts.map +1 -0
- package/script/tl/1_mtproto_api.js +419 -0
- package/script/tl/{0_api.d.ts → 1_telegram_api.d.ts} +23 -340
- package/script/tl/1_telegram_api.d.ts.map +1 -0
- package/script/tl/{0_api.js → 1_telegram_api.js} +4947 -11134
- package/{esm/tl/0_tl_raw_reader.d.ts → script/tl/1_tl_reader.d.ts} +5 -2
- package/script/tl/1_tl_reader.d.ts.map +1 -0
- package/script/tl/1_tl_reader.js +218 -0
- package/script/tl/1_tl_reader_test.d.ts.map +1 -0
- package/script/tl/{0_tl_raw_writer.d.ts → 1_tl_writer.d.ts} +5 -2
- package/script/tl/1_tl_writer.d.ts.map +1 -0
- package/script/tl/{2_tl_writer.js → 1_tl_writer.js} +102 -45
- package/script/tl/1_tl_writer_test.d.ts.map +1 -0
- package/script/tl/1_utilities.d.ts +9 -24
- package/script/tl/1_utilities.d.ts.map +1 -1
- package/script/tl/1_utilities.js +19 -72
- package/script/tl/2_message.d.ts +2 -2
- package/script/tl/2_message.d.ts.map +1 -1
- package/script/tl/2_message.js +7 -7
- package/script/tl/2_mtproto.d.ts +33 -0
- package/script/tl/2_mtproto.d.ts.map +1 -0
- package/script/tl/2_mtproto.js +78 -0
- package/{esm/tl/2_utilities.d.ts → script/tl/2_telegram.d.ts} +16 -2
- package/script/tl/2_telegram.d.ts.map +1 -0
- package/script/tl/2_telegram.js +167 -0
- package/script/transport/0_transport.d.ts +1 -1
- package/script/transport/0_transport.d.ts.map +1 -1
- package/script/types/0_chat_photo.d.ts.map +1 -1
- package/script/types/0_chat_photo.js +1 -1
- package/script/types/0_giveaway_parameters.d.ts.map +1 -1
- package/script/types/0_giveaway_parameters.js +2 -2
- package/script/types/0_location.d.ts.map +1 -1
- package/script/types/0_location.js +4 -4
- package/script/types/0_message_entity.d.ts.map +1 -1
- package/script/types/0_message_entity.js +19 -19
- package/script/types/0_reaction.d.ts.map +1 -1
- package/script/types/0_reaction.js +3 -3
- package/script/types/0_slow_mode_duration.d.ts +19 -0
- package/script/types/0_slow_mode_duration.d.ts.map +1 -1
- package/script/types/0_slow_mode_duration.js +19 -0
- package/script/types/0_thumbnail.d.ts.map +1 -1
- package/script/types/0_thumbnail.js +2 -2
- package/script/types/0_translation.d.ts +19 -0
- package/script/types/0_translation.d.ts.map +1 -1
- package/script/types/0_translation.js +21 -2
- package/script/types/0_video_chat.d.ts.map +1 -1
- package/script/types/0_video_chat.js +1 -1
- package/script/types/1_animation.d.ts.map +1 -1
- package/script/types/1_animation.js +1 -1
- package/script/types/1_audio.d.ts.map +1 -1
- package/script/types/1_audio.js +1 -1
- package/script/types/1_bot_command_scope.d.ts.map +1 -1
- package/script/types/1_bot_command_scope.js +1 -1
- package/script/types/1_chat_p.d.ts.map +1 -1
- package/script/types/1_chat_p.js +5 -5
- package/script/types/1_document.d.ts.map +1 -1
- package/script/types/1_document.js +1 -1
- package/script/types/1_keyboard_button.d.ts.map +1 -1
- package/script/types/1_keyboard_button.js +9 -9
- package/script/types/1_message_reaction.d.ts.map +1 -1
- package/script/types/1_message_reaction.js +5 -5
- package/script/types/1_photo.d.ts.map +1 -1
- package/script/types/1_photo.js +2 -2
- package/script/types/1_sticker.d.ts.map +1 -1
- package/script/types/1_sticker.js +7 -7
- package/script/types/1_story_privacy.d.ts.map +1 -1
- package/script/types/1_story_privacy.js +6 -6
- package/script/types/1_user.d.ts.map +1 -1
- package/script/types/1_user.js +1 -1
- package/script/types/1_venue.d.ts.map +1 -1
- package/script/types/1_venue.js +1 -1
- package/script/types/1_video.d.ts.map +1 -1
- package/script/types/1_video.js +1 -1
- package/script/types/1_video_note.d.ts.map +1 -1
- package/script/types/1_video_note.js +1 -1
- package/script/types/2_chat.d.ts.map +1 -1
- package/script/types/2_chat.js +7 -7
- package/script/types/2_chat_member.d.ts.map +1 -1
- package/script/types/2_chat_member.js +9 -9
- package/script/types/2_chat_settings.d.ts +19 -0
- package/script/types/2_chat_settings.d.ts.map +1 -1
- package/script/types/2_chat_settings.js +20 -1
- package/script/types/2_chosen_inline_result.d.ts.map +1 -1
- package/script/types/2_chosen_inline_result.js +3 -3
- package/script/types/2_game.d.ts.map +1 -1
- package/script/types/2_game.js +3 -3
- package/script/types/2_gift_upgraded_component.d.ts.map +1 -1
- package/script/types/2_gift_upgraded_component.js +2 -2
- package/script/types/2_inactive_chat.d.ts.map +1 -1
- package/script/types/2_inactive_chat.js +1 -1
- package/script/types/2_inline_keyboard_button.d.ts.map +1 -1
- package/script/types/2_inline_keyboard_button.js +9 -9
- package/script/types/2_inline_query.d.ts.map +1 -1
- package/script/types/2_inline_query.js +6 -6
- package/script/types/2_message_reactions.d.ts.map +1 -1
- package/script/types/2_message_reactions.js +1 -1
- package/script/types/2_story_content.d.ts.map +1 -1
- package/script/types/2_story_content.js +5 -5
- package/script/types/2_story_interactive_area.d.ts.map +1 -1
- package/script/types/2_story_interactive_area.js +8 -8
- package/script/types/3_chat_member_updated.d.ts.map +1 -1
- package/script/types/3_chat_member_updated.js +1 -1
- package/script/types/3_gift.d.ts.map +1 -1
- package/script/types/3_gift.js +2 -2
- package/script/types/3_join_request.d.ts.map +1 -1
- package/script/types/3_join_request.js +1 -1
- package/script/types/3_reply_markup.d.ts.map +1 -1
- package/script/types/3_reply_markup.js +4 -4
- package/script/types/4_claimed_gift.d.ts.map +1 -1
- package/script/types/4_claimed_gift.js +1 -1
- package/script/types/4_inline_query_result.d.ts.map +1 -1
- package/script/types/4_inline_query_result.js +13 -13
- package/script/types/4_message.d.ts.map +1 -1
- package/script/types/4_message.js +56 -56
- package/script/types/5_callback_query.d.ts +1 -1
- package/script/types/5_callback_query.d.ts.map +1 -1
- package/script/types/5_callback_query.js +6 -7
- package/script/types/5_chat_list_item.d.ts.map +1 -1
- package/script/types/5_chat_list_item.js +4 -4
- package/script/types/5_claimed_gifts.d.ts.map +1 -1
- package/script/types/5_claimed_gifts.js +5 -5
- package/script/types/_file_id.d.ts.map +1 -1
- package/script/types/_file_id.js +2 -2
- package/esm/client/0_message.d.ts +0 -29
- package/esm/client/0_message.d.ts.map +0 -1
- package/esm/client/0_message.js +0 -83
- package/esm/client/1_client_encrypted.d.ts +0 -52
- package/esm/client/1_client_encrypted.d.ts.map +0 -1
- package/esm/client/1_client_encrypted.js +0 -381
- package/esm/tl/0_api.d.ts.map +0 -1
- package/esm/tl/0_tl_raw_reader.d.ts.map +0 -1
- package/esm/tl/0_tl_raw_reader.js +0 -97
- package/esm/tl/0_tl_raw_reader_test.d.ts.map +0 -1
- package/esm/tl/0_tl_raw_writer.d.ts.map +0 -1
- package/esm/tl/0_tl_raw_writer.js +0 -86
- package/esm/tl/0_tl_raw_writer_test.d.ts.map +0 -1
- package/esm/tl/1_utilities_test.d.ts.map +0 -1
- package/esm/tl/2_tl_reader.d.ts.map +0 -1
- package/esm/tl/2_tl_reader_test.d.ts.map +0 -1
- package/esm/tl/2_tl_writer.d.ts.map +0 -1
- package/esm/tl/2_tl_writer_test.d.ts.map +0 -1
- package/esm/tl/2_utilities.d.ts.map +0 -1
- package/script/client/0_message.d.ts +0 -29
- package/script/client/0_message.d.ts.map +0 -1
- package/script/client/0_message.js +0 -90
- package/script/client/1_client_encrypted.d.ts +0 -52
- package/script/client/1_client_encrypted.d.ts.map +0 -1
- package/script/client/1_client_encrypted.js +0 -385
- package/script/tl/0_api.d.ts.map +0 -1
- package/script/tl/0_tl_raw_reader.d.ts.map +0 -1
- package/script/tl/0_tl_raw_reader.js +0 -102
- package/script/tl/0_tl_raw_reader_test.d.ts.map +0 -1
- package/script/tl/0_tl_raw_writer.d.ts.map +0 -1
- package/script/tl/0_tl_raw_writer.js +0 -90
- package/script/tl/0_tl_raw_writer_test.d.ts.map +0 -1
- package/script/tl/1_utilities_test.d.ts.map +0 -1
- package/script/tl/2_tl_reader.d.ts.map +0 -1
- package/script/tl/2_tl_reader.js +0 -150
- package/script/tl/2_tl_reader_test.d.ts.map +0 -1
- package/script/tl/2_tl_writer.d.ts.map +0 -1
- package/script/tl/2_tl_writer_test.d.ts.map +0 -1
- package/script/tl/2_utilities.d.ts.map +0 -1
- package/script/tl/2_utilities.js +0 -98
|
@@ -48,10 +48,10 @@ class ReactionManager {
|
|
|
48
48
|
__classPrivateFieldSet(this, _ReactionManager_c, c, "f");
|
|
49
49
|
}
|
|
50
50
|
canHandleUpdate(update) {
|
|
51
|
-
return
|
|
51
|
+
return _2_tl_js_1.Api.isOneOf(reactionManagerUpdates, update);
|
|
52
52
|
}
|
|
53
53
|
async handleUpdate(update) {
|
|
54
|
-
if (
|
|
54
|
+
if (_2_tl_js_1.Api.is("updateBotMessageReactions", update)) {
|
|
55
55
|
const messageReactionCount = await (0, _3_types_js_1.constructMessageReactionCount)(update, __classPrivateFieldGet(this, _ReactionManager_c, "f").getEntity);
|
|
56
56
|
if (messageReactionCount) {
|
|
57
57
|
return { messageReactionCount };
|
|
@@ -60,7 +60,7 @@ class ReactionManager {
|
|
|
60
60
|
return null;
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
|
-
else if (
|
|
63
|
+
else if (_2_tl_js_1.Api.is("updateBotMessageReaction", update)) {
|
|
64
64
|
const messageReactions = await (0, _3_types_js_1.constructMessageReactions)(update, __classPrivateFieldGet(this, _ReactionManager_c, "f").getEntity);
|
|
65
65
|
if (messageReactions) {
|
|
66
66
|
return { messageReactions };
|
|
@@ -69,10 +69,10 @@ class ReactionManager {
|
|
|
69
69
|
return null;
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
|
-
else if (
|
|
73
|
-
const chatId =
|
|
72
|
+
else if (_2_tl_js_1.Api.is("updateMessageReactions", update)) {
|
|
73
|
+
const chatId = _2_tl_js_1.Api.peerToChatId(update.peer);
|
|
74
74
|
const message = await __classPrivateFieldGet(this, _ReactionManager_c, "f").messageStorage.getMessage(chatId, update.msg_id);
|
|
75
|
-
if (
|
|
75
|
+
if (_2_tl_js_1.Api.is("message", message)) {
|
|
76
76
|
message.reactions = update.reactions;
|
|
77
77
|
await __classPrivateFieldGet(this, _ReactionManager_c, "f").messageStorage.setMessage(chatId, update.msg_id, message);
|
|
78
78
|
const views = message.views ?? 0;
|
|
@@ -85,10 +85,10 @@ class ReactionManager {
|
|
|
85
85
|
return null;
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
|
-
else if (
|
|
89
|
-
const chatId =
|
|
88
|
+
else if (_2_tl_js_1.Api.isOneOf(["updateChannelMessageViews", "updateChannelMessageForwards"], update)) {
|
|
89
|
+
const chatId = _2_tl_js_1.Api.peerToChatId({ ...update, _: "peerChannel" });
|
|
90
90
|
const message = await __classPrivateFieldGet(this, _ReactionManager_c, "f").messageStorage.getMessage(chatId, update.id);
|
|
91
|
-
if (
|
|
91
|
+
if (_2_tl_js_1.Api.is("message", message)) {
|
|
92
92
|
if ("views" in update) {
|
|
93
93
|
message.views = update.views;
|
|
94
94
|
}
|
|
@@ -1,3 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MTKruto - Cross-runtime JavaScript library for building Telegram clients
|
|
3
|
+
* Copyright (C) 2023-2025 Roj <https://roj.im/>
|
|
4
|
+
*
|
|
5
|
+
* This file is part of MTKruto.
|
|
6
|
+
*
|
|
7
|
+
* This program is free software: you can redistribute it and/or modify
|
|
8
|
+
* it under the terms of the GNU Lesser General Public License as published by
|
|
9
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
10
|
+
* (at your option) any later version.
|
|
11
|
+
*
|
|
12
|
+
* This program is distributed in the hope that it will be useful,
|
|
13
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15
|
+
* GNU Lesser General Public License for more details.
|
|
16
|
+
*
|
|
17
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
18
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
19
|
+
*/
|
|
1
20
|
import { Api } from "../2_tl.js";
|
|
2
21
|
import { Translation, Update } from "../3_types.js";
|
|
3
22
|
import { GetTranslationsParams } from "./0_params.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"2_translations_manager.d.ts","sourceRoot":"","sources":["../../src/client/2_translations_manager.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"2_translations_manager.d.ts","sourceRoot":"","sources":["../../src/client/2_translations_manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAKH,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAAwB,WAAW,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAC1E,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,CAAC,EAAE,MAAM,cAAc,CAAC;AAEjC,QAAA,MAAM,0BAA0B,sDAGtB,CAAC;AAEX,KAAK,yBAAyB,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,OAAO,0BAA0B,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;AAExF,qBAAa,mBAAoB,YAAW,eAAe,CAAC,yBAAyB,CAAC;;gBAGxE,CAAC,EAAE,CAAC;IAIhB,eAAe,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,GAAG,MAAM,IAAI,yBAAyB;IAIlE,eAAe,CAAC,MAAM,CAAC,EAAE,qBAAqB;IA8F9C,YAAY,CAAC,MAAM,EAAE,yBAAyB,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;CAqB9E"}
|
|
@@ -1,4 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* MTKruto - Cross-runtime JavaScript library for building Telegram clients
|
|
4
|
+
* Copyright (C) 2023-2025 Roj <https://roj.im/>
|
|
5
|
+
*
|
|
6
|
+
* This file is part of MTKruto.
|
|
7
|
+
*
|
|
8
|
+
* This program is free software: you can redistribute it and/or modify
|
|
9
|
+
* it under the terms of the GNU Lesser General Public License as published by
|
|
10
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
11
|
+
* (at your option) any later version.
|
|
12
|
+
*
|
|
13
|
+
* This program is distributed in the hope that it will be useful,
|
|
14
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+
* GNU Lesser General Public License for more details.
|
|
17
|
+
*
|
|
18
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
19
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
20
|
+
*/
|
|
2
21
|
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
3
22
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
4
23
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
@@ -30,7 +49,7 @@ class TranslationsManager {
|
|
|
30
49
|
__classPrivateFieldSet(this, _TranslationsManager_c, c, "f");
|
|
31
50
|
}
|
|
32
51
|
canHandleUpdate(update) {
|
|
33
|
-
return
|
|
52
|
+
return _2_tl_js_1.Api.isOneOf(translationsManagerUpdates, update);
|
|
34
53
|
}
|
|
35
54
|
async getTranslations(params) {
|
|
36
55
|
__classPrivateFieldGet(this, _TranslationsManager_c, "f").storage.assertUser("getTranslations");
|
|
@@ -48,12 +67,12 @@ class TranslationsManager {
|
|
|
48
67
|
if (!__classPrivateFieldGet(this, _TranslationsManager_c, "f").langPack) {
|
|
49
68
|
return null;
|
|
50
69
|
}
|
|
51
|
-
if (
|
|
70
|
+
if (_2_tl_js_1.Api.is("updateLangPackTooLong", update)) {
|
|
52
71
|
await __classPrivateFieldGet(this, _TranslationsManager_instances, "m", _TranslationsManager_updateTranslations).call(this, __classPrivateFieldGet(this, _TranslationsManager_c, "f").langPack, update.lang_code);
|
|
53
72
|
const translations = await __classPrivateFieldGet(this, _TranslationsManager_instances, "m", _TranslationsManager_getTranslationsInner).call(this, __classPrivateFieldGet(this, _TranslationsManager_c, "f").langPack, update.lang_code, true);
|
|
54
73
|
return { platform: __classPrivateFieldGet(this, _TranslationsManager_c, "f").langPack, language: update.lang_code, translations };
|
|
55
74
|
}
|
|
56
|
-
else if (
|
|
75
|
+
else if (_2_tl_js_1.Api.is("updateLangPack", update)) {
|
|
57
76
|
if (!__classPrivateFieldGet(this, _TranslationsManager_c, "f").langCode) {
|
|
58
77
|
return null;
|
|
59
78
|
}
|
|
@@ -134,7 +153,7 @@ _TranslationsManager_c = new WeakMap(), _TranslationsManager_updateTranslationsQ
|
|
|
134
153
|
}
|
|
135
154
|
}, _TranslationsManager_applyLangPackDifference = function _TranslationsManager_applyLangPackDifference(translations, strings) {
|
|
136
155
|
for (const string of strings) {
|
|
137
|
-
if (
|
|
156
|
+
if (_2_tl_js_1.Api.is("langPackStringDeleted", string)) {
|
|
138
157
|
translations = translations.filter((v) => v.key != string.key);
|
|
139
158
|
}
|
|
140
159
|
else {
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
19
19
|
*/
|
|
20
20
|
import { Queue } from "../1_utilities.js";
|
|
21
|
-
import { Api
|
|
21
|
+
import { Api } from "../2_tl.js";
|
|
22
22
|
import { ID } from "../3_types.js";
|
|
23
23
|
import { C } from "./1_types.js";
|
|
24
24
|
type UpdateHandler = (update: Api.Update) => Promise<(() => Promise<unknown>)>;
|
|
@@ -34,9 +34,9 @@ export declare class UpdateManager {
|
|
|
34
34
|
static isQtsUpdate(v: Api.Update): v is QtsUpdate;
|
|
35
35
|
static isChannelPtsUpdate(v: Api.Update | Api.Updates): v is ChannelPtsUpdate;
|
|
36
36
|
fetchState(source: string): Promise<void>;
|
|
37
|
-
processChats(chats: Api.Chat[], context:
|
|
38
|
-
processResult(result:
|
|
39
|
-
processUsers(users: Api.User[], context:
|
|
37
|
+
processChats(chats: Api.Chat[], context: Api.DeserializedType): Promise<void>;
|
|
38
|
+
processResult(result: Api.DeserializedType): Promise<void>;
|
|
39
|
+
processUsers(users: Api.User[], context: Api.DeserializedType): Promise<void>;
|
|
40
40
|
getHandleUpdateQueue(boxId: bigint): Queue;
|
|
41
41
|
processUpdates(updates: Api.Update | Api.Updates, checkGap: boolean, call?: Api.AnyObject | null, callback?: () => void): void;
|
|
42
42
|
recoverUpdateGap(source: string): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"2_update_manager.d.ts","sourceRoot":"","sources":["../../src/client/2_update_manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,OAAO,EAA4B,KAAK,EAAmB,MAAM,mBAAmB,CAAC;AACrF,OAAO,EAAE,GAAG,
|
|
1
|
+
{"version":3,"file":"2_update_manager.d.ts","sourceRoot":"","sources":["../../src/client/2_update_manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,OAAO,EAA4B,KAAK,EAAmB,MAAM,mBAAmB,CAAC;AACrF,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAEjC,OAAO,EAAE,EAAE,EAAE,MAAM,eAAe,CAAC;AAEnC,OAAO,EAAE,CAAC,EAAE,MAAM,cAAc,CAAC;AAEjC,KAAK,aAAa,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,KAAK,OAAO,CAAC,CAAC,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AAE/E,MAAM,MAAM,SAAS,GACjB,GAAG,CAAC,gBAAgB,GACpB,GAAG,CAAC,oBAAoB,GACxB,GAAG,CAAC,sBAAsB,GAC1B,GAAG,CAAC,uBAAuB,GAC3B,GAAG,CAAC,2BAA2B,GAC/B,GAAG,CAAC,oBAAoB,GACxB,GAAG,CAAC,iBAAiB,GACrB,GAAG,CAAC,oBAAoB,GACxB,GAAG,CAAC,iBAAiB,GACrB,GAAG,CAAC,0BAA0B,GAC9B,GAAG,CAAC,aAAa,CAAC;AAEtB,MAAM,MAAM,gBAAgB,GACxB,GAAG,CAAC,uBAAuB,GAC3B,GAAG,CAAC,wBAAwB,GAC5B,GAAG,CAAC,2BAA2B,GAC/B,GAAG,CAAC,oBAAoB,CAAC;AAE7B,MAAM,MAAM,SAAS,GACjB,GAAG,CAAC,yBAAyB,GAC7B,GAAG,CAAC,qBAAqB,GACzB,GAAG,CAAC,gBAAgB,GACpB,GAAG,CAAC,qBAAqB,GACzB,GAAG,CAAC,wBAAwB,GAC5B,GAAG,CAAC,4BAA4B,GAChC,GAAG,CAAC,kBAAkB,GACtB,GAAG,CAAC,wBAAwB,GAC5B,GAAG,CAAC,yBAAyB,GAC7B,GAAG,CAAC,wBAAwB,GAC5B,GAAG,CAAC,2BAA2B,GAC/B,GAAG,CAAC,4BAA4B,GAChC,GAAG,CAAC,8BAA8B,CAAC;AAEvC,qBAAa,aAAa;;IACxB,MAAM,CAAC,QAAQ,CAAC,SAAS,KAAK;IAC9B,MAAM,CAAC,QAAQ,CAAC,WAAW,MAAM;gBAcrB,CAAC,EAAE,CAAC;IAahB,MAAM,CAAC,WAAW,CAAC,CAAC,EAAE,GAAG,CAAC,MAAM,GAAG,CAAC,IAAI,SAAS;IAIjD,MAAM,CAAC,WAAW,CAAC,CAAC,EAAE,GAAG,CAAC,MAAM,GAAG,CAAC,IAAI,SAAS;IAIjD,MAAM,CAAC,kBAAkB,CAAC,CAAC,EAAE,GAAG,CAAC,MAAM,GAAG,GAAG,CAAC,OAAO,GAAG,CAAC,IAAI,gBAAgB;IAuCvE,UAAU,CAAC,MAAM,EAAE,MAAM;IA0DzB,YAAY,CAAC,KAAK,EAAE,GAAG,CAAC,IAAI,EAAE,EAAE,OAAO,EAAE,GAAG,CAAC,gBAAgB;IA8B7D,aAAa,CAAC,MAAM,EAAE,GAAG,CAAC,gBAAgB;IAqG1C,YAAY,CAAC,KAAK,EAAE,GAAG,CAAC,IAAI,EAAE,EAAE,OAAO,EAAE,GAAG,CAAC,gBAAgB;IAgCnE,oBAAoB,CAAC,KAAK,EAAE,MAAM;IA2JlC,cAAc,CAAC,OAAO,EAAE,GAAG,CAAC,MAAM,GAAG,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,GAAE,GAAG,CAAC,SAAS,GAAG,IAAW,EAAE,QAAQ,CAAC,EAAE,MAAM,IAAI;IAsMvH,gBAAgB,CAAC,MAAM,EAAE,MAAM;IAmLrC,gBAAgB,CAAC,OAAO,EAAE,aAAa;IAKjC,QAAQ,CAAC,MAAM,EAAE,EAAE;IAmDnB,SAAS,CAAC,MAAM,EAAE,EAAE;IAY1B,aAAa;CAMd"}
|
|
@@ -74,13 +74,13 @@ class UpdateManager {
|
|
|
74
74
|
__classPrivateFieldSet(this, _UpdateManager_Lmin, L.branch("min"), "f");
|
|
75
75
|
}
|
|
76
76
|
static isPtsUpdate(v) {
|
|
77
|
-
return
|
|
77
|
+
return _2_tl_js_1.Api.isOneOf(["updateNewMessage", "updateDeleteMessages", "updateReadHistoryInbox", "updateReadHistoryOutbox", "updatePinnedChannelMessages", "updatePinnedMessages", "updateFolderPeers", "updateChannelWebPage", "updateEditMessage", "updateReadMessagesContents", "updateWebPage"], v);
|
|
78
78
|
}
|
|
79
79
|
static isQtsUpdate(v) {
|
|
80
|
-
return
|
|
80
|
+
return _2_tl_js_1.Api.isOneOf(["updateNewEncryptedMessage", "updateMessagePollVote", "updateBotStopped", "updateChatParticipant", "updateChannelParticipant", "updateBotChatInviteRequester", "updateBotChatBoost", "updateBotMessageReaction", "updateBotMessageReactions", "updateBotBusinessConnect", "updateBotNewBusinessMessage", "updateBotEditBusinessMessage", "updateBotDeleteBusinessMessage"], v);
|
|
81
81
|
}
|
|
82
82
|
static isChannelPtsUpdate(v) {
|
|
83
|
-
return
|
|
83
|
+
return _2_tl_js_1.Api.isOneOf([
|
|
84
84
|
"updateNewChannelMessage",
|
|
85
85
|
"updateEditChannelMessage",
|
|
86
86
|
"updateDeleteChannelMessages",
|
|
@@ -88,15 +88,12 @@ class UpdateManager {
|
|
|
88
88
|
], v);
|
|
89
89
|
}
|
|
90
90
|
async fetchState(source) {
|
|
91
|
-
if (__classPrivateFieldGet(this, _UpdateManager_c, "f").cdn) {
|
|
92
|
-
return;
|
|
93
|
-
}
|
|
94
91
|
let state = await __classPrivateFieldGet(this, _UpdateManager_c, "f").invoke({ _: "updates.getState" });
|
|
95
92
|
const difference = await __classPrivateFieldGet(this, _UpdateManager_c, "f").invoke({ ...state, _: "updates.getDifference" });
|
|
96
|
-
if (
|
|
93
|
+
if (_2_tl_js_1.Api.is("updates.difference", difference)) {
|
|
97
94
|
state = difference.state;
|
|
98
95
|
}
|
|
99
|
-
else if (
|
|
96
|
+
else if (_2_tl_js_1.Api.is("updates.differenceSlice", difference)) {
|
|
100
97
|
state = difference.intermediate_state;
|
|
101
98
|
}
|
|
102
99
|
__classPrivateFieldSet(this, _UpdateManager_updateState, state, "f");
|
|
@@ -107,14 +104,14 @@ class UpdateManager {
|
|
|
107
104
|
}
|
|
108
105
|
async processChats(chats, context) {
|
|
109
106
|
for (const chat of chats) {
|
|
110
|
-
if (
|
|
111
|
-
if (!
|
|
107
|
+
if (_2_tl_js_1.Api.isOneOf(["channel", "channelForbidden"], chat)) {
|
|
108
|
+
if (!_2_tl_js_1.Api.is("channel", chat) || !chat.min || chat.min && await __classPrivateFieldGet(this, _UpdateManager_c, "f").messageStorage.getEntity(_2_tl_js_1.Api.peerToChatId(chat)) == null) {
|
|
112
109
|
await __classPrivateFieldGet(this, _UpdateManager_c, "f").messageStorage.setEntity(chat);
|
|
113
110
|
}
|
|
114
|
-
if (
|
|
115
|
-
const entity = await __classPrivateFieldGet(this, _UpdateManager_c, "f").messageStorage.getEntity(
|
|
116
|
-
const senderChatId =
|
|
117
|
-
if (
|
|
111
|
+
if (_2_tl_js_1.Api.is("channel", chat) && chat.min) {
|
|
112
|
+
const entity = await __classPrivateFieldGet(this, _UpdateManager_c, "f").messageStorage.getEntity(_2_tl_js_1.Api.peerToChatId(chat));
|
|
113
|
+
const senderChatId = _2_tl_js_1.Api.peerToChatId(chat);
|
|
114
|
+
if (_2_tl_js_1.Api.is("channel", entity) && entity.min) {
|
|
118
115
|
for (const { chatId, senderId, messageId } of __classPrivateFieldGet(this, _UpdateManager_instances, "m", _UpdateManager_extractMinPeerReferences).call(this, context)) {
|
|
119
116
|
if (senderId == senderChatId) {
|
|
120
117
|
await __classPrivateFieldGet(this, _UpdateManager_c, "f").messageStorage.setMinPeerReference(chatId, senderId, messageId);
|
|
@@ -124,19 +121,19 @@ class UpdateManager {
|
|
|
124
121
|
}
|
|
125
122
|
}
|
|
126
123
|
if ("username" in chat && chat.username) {
|
|
127
|
-
await __classPrivateFieldGet(this, _UpdateManager_c, "f").messageStorage.updateUsernames(
|
|
124
|
+
await __classPrivateFieldGet(this, _UpdateManager_c, "f").messageStorage.updateUsernames(_2_tl_js_1.Api.peerToChatId(chat), [chat.username]);
|
|
128
125
|
}
|
|
129
126
|
if ("usernames" in chat && chat.usernames) {
|
|
130
|
-
await __classPrivateFieldGet(this, _UpdateManager_c, "f").messageStorage.updateUsernames(
|
|
127
|
+
await __classPrivateFieldGet(this, _UpdateManager_c, "f").messageStorage.updateUsernames(_2_tl_js_1.Api.peerToChatId(chat), chat.usernames.map((v) => v.username));
|
|
131
128
|
}
|
|
132
129
|
}
|
|
133
|
-
else if (
|
|
130
|
+
else if (_2_tl_js_1.Api.isOneOf(["chat", "chatForbidden"], chat)) {
|
|
134
131
|
await __classPrivateFieldGet(this, _UpdateManager_c, "f").messageStorage.setEntity(chat);
|
|
135
132
|
}
|
|
136
133
|
}
|
|
137
134
|
}
|
|
138
135
|
async processResult(result) {
|
|
139
|
-
if (
|
|
136
|
+
if (_2_tl_js_1.Api.isOneOf([
|
|
140
137
|
"account.authorizationForm",
|
|
141
138
|
"account.autoSaveSettings",
|
|
142
139
|
"account.privacyRules",
|
|
@@ -216,33 +213,33 @@ class UpdateManager {
|
|
|
216
213
|
}
|
|
217
214
|
if ("messages" in result && Array.isArray(result.messages)) {
|
|
218
215
|
for (const message of result.messages) {
|
|
219
|
-
if (
|
|
220
|
-
await __classPrivateFieldGet(this, _UpdateManager_c, "f").messageStorage.setMessage(
|
|
216
|
+
if (_2_tl_js_1.Api.is("message", message) || _2_tl_js_1.Api.is("messageService", message)) {
|
|
217
|
+
await __classPrivateFieldGet(this, _UpdateManager_c, "f").messageStorage.setMessage(_2_tl_js_1.Api.peerToChatId(message.peer_id), message.id, message);
|
|
221
218
|
}
|
|
222
219
|
}
|
|
223
220
|
}
|
|
224
221
|
}
|
|
225
|
-
if (
|
|
222
|
+
if (_2_tl_js_1.Api.is("messages.messages", result)) {
|
|
226
223
|
for (const message of result.messages) {
|
|
227
|
-
if (
|
|
228
|
-
await __classPrivateFieldGet(this, _UpdateManager_c, "f").messageStorage.setMessage(
|
|
224
|
+
if (_2_tl_js_1.Api.is("message", message) || _2_tl_js_1.Api.is("messageService", message)) {
|
|
225
|
+
await __classPrivateFieldGet(this, _UpdateManager_c, "f").messageStorage.setMessage(_2_tl_js_1.Api.peerToChatId(message.peer_id), message.id, message);
|
|
229
226
|
}
|
|
230
227
|
}
|
|
231
228
|
}
|
|
232
229
|
}
|
|
233
230
|
async processUsers(users, context) {
|
|
234
231
|
for (const user of users) {
|
|
235
|
-
if (
|
|
236
|
-
if (!user.min || user.min && await __classPrivateFieldGet(this, _UpdateManager_c, "f").messageStorage.getEntity(
|
|
232
|
+
if (_2_tl_js_1.Api.is("user", user) && user.access_hash) {
|
|
233
|
+
if (!user.min || user.min && await __classPrivateFieldGet(this, _UpdateManager_c, "f").messageStorage.getEntity(_2_tl_js_1.Api.peerToChatId(user)) == null) {
|
|
237
234
|
await __classPrivateFieldGet(this, _UpdateManager_c, "f").messageStorage.setEntity(user);
|
|
238
235
|
}
|
|
239
236
|
if (user.min) {
|
|
240
237
|
__classPrivateFieldGet(this, _UpdateManager_Lmin, "f").debug("encountered min user");
|
|
241
238
|
}
|
|
242
|
-
if (
|
|
243
|
-
const entity = await __classPrivateFieldGet(this, _UpdateManager_c, "f").messageStorage.getEntity(
|
|
244
|
-
const userId =
|
|
245
|
-
if (
|
|
239
|
+
if (_2_tl_js_1.Api.is("user", user) && user.min) {
|
|
240
|
+
const entity = await __classPrivateFieldGet(this, _UpdateManager_c, "f").messageStorage.getEntity(_2_tl_js_1.Api.peerToChatId(user));
|
|
241
|
+
const userId = _2_tl_js_1.Api.peerToChatId(user);
|
|
242
|
+
if (_2_tl_js_1.Api.is("user", entity) && entity.min) {
|
|
246
243
|
for (const { chatId, senderId, messageId } of __classPrivateFieldGet(this, _UpdateManager_instances, "m", _UpdateManager_extractMinPeerReferences).call(this, context)) {
|
|
247
244
|
if (senderId == userId) {
|
|
248
245
|
await __classPrivateFieldGet(this, _UpdateManager_c, "f").messageStorage.setMinPeerReference(chatId, senderId, messageId);
|
|
@@ -252,10 +249,10 @@ class UpdateManager {
|
|
|
252
249
|
}
|
|
253
250
|
}
|
|
254
251
|
if (user.username) {
|
|
255
|
-
await __classPrivateFieldGet(this, _UpdateManager_c, "f").messageStorage.updateUsernames(
|
|
252
|
+
await __classPrivateFieldGet(this, _UpdateManager_c, "f").messageStorage.updateUsernames(_2_tl_js_1.Api.peerToChatId(user), [user.username]);
|
|
256
253
|
}
|
|
257
254
|
if (user.usernames) {
|
|
258
|
-
await __classPrivateFieldGet(this, _UpdateManager_c, "f").messageStorage.updateUsernames(
|
|
255
|
+
await __classPrivateFieldGet(this, _UpdateManager_c, "f").messageStorage.updateUsernames(_2_tl_js_1.Api.peerToChatId(user), user.usernames.map((v) => v.username));
|
|
259
256
|
}
|
|
260
257
|
}
|
|
261
258
|
}
|
|
@@ -271,15 +268,9 @@ class UpdateManager {
|
|
|
271
268
|
}
|
|
272
269
|
}
|
|
273
270
|
processUpdates(updates, checkGap, call = null, callback) {
|
|
274
|
-
|
|
275
|
-
return;
|
|
276
|
-
}
|
|
277
|
-
__classPrivateFieldGet(this, _UpdateManager_processUpdatesQueue, "f").add(() => __classPrivateFieldGet(this, _UpdateManager_instances, "m", _UpdateManager_processUpdates).call(this, updates, checkGap, call).then(callback));
|
|
271
|
+
__classPrivateFieldGet(this, _UpdateManager_processUpdatesQueue, "f").add(() => __classPrivateFieldGet(this, _UpdateManager_instances, "m", _UpdateManager_processUpdates).call(this, updates, checkGap, call).finally(callback));
|
|
278
272
|
}
|
|
279
273
|
async recoverUpdateGap(source) {
|
|
280
|
-
if (__classPrivateFieldGet(this, _UpdateManager_c, "f").cdn) {
|
|
281
|
-
return;
|
|
282
|
-
}
|
|
283
274
|
const wasRecoveringUpdateGap = __classPrivateFieldGet(this, _UpdateManager_recoveringUpdateGap, "f");
|
|
284
275
|
const unlock = await __classPrivateFieldGet(this, _UpdateManager_recoverUpdateGapMutex, "f").lock();
|
|
285
276
|
if (wasRecoveringUpdateGap) {
|
|
@@ -311,7 +302,7 @@ class UpdateManager {
|
|
|
311
302
|
throw err;
|
|
312
303
|
}
|
|
313
304
|
}
|
|
314
|
-
if (
|
|
305
|
+
if (_2_tl_js_1.Api.is("updates.difference", difference) || _2_tl_js_1.Api.is("updates.differenceSlice", difference)) {
|
|
315
306
|
await this.processChats(difference.chats, difference);
|
|
316
307
|
await this.processUsers(difference.users, difference);
|
|
317
308
|
for (const message of difference.new_messages) {
|
|
@@ -320,26 +311,26 @@ class UpdateManager {
|
|
|
320
311
|
for (const update of difference.other_updates) {
|
|
321
312
|
await __classPrivateFieldGet(this, _UpdateManager_instances, "m", _UpdateManager_processUpdates).call(this, update, false);
|
|
322
313
|
}
|
|
323
|
-
if (
|
|
314
|
+
if (_2_tl_js_1.Api.is("updates.difference", difference)) {
|
|
324
315
|
await __classPrivateFieldGet(this, _UpdateManager_instances, "m", _UpdateManager_setState).call(this, difference.state);
|
|
325
316
|
__classPrivateFieldGet(this, _UpdateManager_LrecoverUpdateGap, "f").debug("recovered from update gap");
|
|
326
317
|
break;
|
|
327
318
|
}
|
|
328
|
-
else if (
|
|
319
|
+
else if (_2_tl_js_1.Api.is("updates.differenceSlice", difference)) {
|
|
329
320
|
state = difference.intermediate_state;
|
|
330
321
|
}
|
|
331
322
|
else {
|
|
332
323
|
(0, _0_deps_js_1.unreachable)();
|
|
333
324
|
}
|
|
334
325
|
}
|
|
335
|
-
else if (
|
|
326
|
+
else if (_2_tl_js_1.Api.is("updates.differenceTooLong", difference)) {
|
|
336
327
|
await __classPrivateFieldGet(this, _UpdateManager_c, "f").messageStorage.deleteMessages();
|
|
337
328
|
await __classPrivateFieldGet(this, _UpdateManager_c, "f").storage.removeChats(0);
|
|
338
329
|
await __classPrivateFieldGet(this, _UpdateManager_c, "f").storage.removeChats(1);
|
|
339
330
|
state.pts = difference.pts;
|
|
340
331
|
__classPrivateFieldGet(this, _UpdateManager_LrecoverUpdateGap, "f").debug("received differenceTooLong");
|
|
341
332
|
}
|
|
342
|
-
else if (
|
|
333
|
+
else if (_2_tl_js_1.Api.is("updates.differenceEmpty", difference)) {
|
|
343
334
|
await __classPrivateFieldGet(this, _UpdateManager_instances, "m", _UpdateManager_setUpdateStateDate).call(this, difference.date);
|
|
344
335
|
__classPrivateFieldGet(this, _UpdateManager_LrecoverUpdateGap, "f").debug("there was no update gap");
|
|
345
336
|
break;
|
|
@@ -359,9 +350,6 @@ class UpdateManager {
|
|
|
359
350
|
}
|
|
360
351
|
}
|
|
361
352
|
setUpdateHandler(handler) {
|
|
362
|
-
if (__classPrivateFieldGet(this, _UpdateManager_c, "f").cdn) {
|
|
363
|
-
return;
|
|
364
|
-
}
|
|
365
353
|
__classPrivateFieldSet(this, _UpdateManager_updateHandler, handler, "f");
|
|
366
354
|
}
|
|
367
355
|
async openChat(chatId) {
|
|
@@ -373,7 +361,7 @@ class UpdateManager {
|
|
|
373
361
|
}
|
|
374
362
|
const controller = new AbortController();
|
|
375
363
|
const promise = Promise.resolve().then(async () => {
|
|
376
|
-
const logger = __classPrivateFieldGet(this, _UpdateManager_LopenChat, "f").branch(
|
|
364
|
+
const logger = __classPrivateFieldGet(this, _UpdateManager_LopenChat, "f").branch(_2_tl_js_1.Api.peerToChatId(channel) + "");
|
|
377
365
|
while (true) {
|
|
378
366
|
if (__classPrivateFieldGet(this, _UpdateManager_c, "f").disconnected()) {
|
|
379
367
|
logger.debug("disconnected, stopping the loop");
|
|
@@ -464,28 +452,28 @@ _a = UpdateManager, _UpdateManager_c = new WeakMap(), _UpdateManager_updateState
|
|
|
464
452
|
messages.push(...__classPrivateFieldGet(this, _UpdateManager_instances, "m", _UpdateManager_extractMessages).call(this, item));
|
|
465
453
|
}
|
|
466
454
|
}
|
|
467
|
-
else if (
|
|
455
|
+
else if (_2_tl_js_1.Api.isOneOf(["updates", "updatesCombined"], context)) {
|
|
468
456
|
messages.push(...__classPrivateFieldGet(this, _UpdateManager_instances, "m", _UpdateManager_extractMessages).call(this, context.updates));
|
|
469
457
|
}
|
|
470
|
-
else if (
|
|
458
|
+
else if (_2_tl_js_1.Api.isOneOf(["updates.difference", "updates.differenceSlice", "updates.channelDifference"], context)) {
|
|
471
459
|
for (const message of context.new_messages) {
|
|
472
|
-
if (
|
|
460
|
+
if (_2_tl_js_1.Api.is("message", message)) {
|
|
473
461
|
messages.push(message);
|
|
474
462
|
}
|
|
475
463
|
}
|
|
476
464
|
messages.push(...__classPrivateFieldGet(this, _UpdateManager_instances, "m", _UpdateManager_extractMessages).call(this, context.other_updates));
|
|
477
465
|
}
|
|
478
|
-
else if (
|
|
479
|
-
if (
|
|
466
|
+
else if (_2_tl_js_1.Api.isOneOf(["updateNewMessage", "updateNewChannelMessage", "updateEditMessage", "updateEditChannelMessage", "updateBotNewBusinessMessage", "updateBotNewBusinessMessage"], context)) {
|
|
467
|
+
if (_2_tl_js_1.Api.is("message", context.message)) {
|
|
480
468
|
messages.push(context.message);
|
|
481
469
|
}
|
|
482
470
|
}
|
|
483
|
-
else if (
|
|
471
|
+
else if (_2_tl_js_1.Api.is("message", context)) {
|
|
484
472
|
messages.push(context);
|
|
485
473
|
}
|
|
486
474
|
else if (context != null && typeof context === "object" && "messages" in context && Array.isArray(context.messages)) {
|
|
487
475
|
for (const message of context.messages) {
|
|
488
|
-
if (
|
|
476
|
+
if (_2_tl_js_1.Api.is("message", message)) {
|
|
489
477
|
messages.push(message);
|
|
490
478
|
}
|
|
491
479
|
}
|
|
@@ -498,7 +486,7 @@ _a = UpdateManager, _UpdateManager_c = new WeakMap(), _UpdateManager_updateState
|
|
|
498
486
|
if (!message.from_id) {
|
|
499
487
|
continue;
|
|
500
488
|
}
|
|
501
|
-
minPeerReferences.push({ chatId:
|
|
489
|
+
minPeerReferences.push({ chatId: _2_tl_js_1.Api.peerToChatId(message.peer_id), senderId: _2_tl_js_1.Api.peerToChatId(message.from_id), messageId: message.id });
|
|
502
490
|
}
|
|
503
491
|
return minPeerReferences;
|
|
504
492
|
}, _UpdateManager_getChannelPtsWithDropPendingUpdatesCheck = async function _UpdateManager_getChannelPtsWithDropPendingUpdatesCheck(channelId) {
|
|
@@ -532,8 +520,8 @@ _a = UpdateManager, _UpdateManager_c = new WeakMap(), _UpdateManager_updateState
|
|
|
532
520
|
await __classPrivateFieldGet(this, _UpdateManager_instances, "m", _UpdateManager_recoverChannelUpdateGap).call(this, channelId, "processUpdates");
|
|
533
521
|
}
|
|
534
522
|
}, _UpdateManager_processChannelPtsUpdateInner = async function _UpdateManager_processChannelPtsUpdateInner(update, checkGap) {
|
|
535
|
-
const channelId =
|
|
536
|
-
if (
|
|
523
|
+
const channelId = _2_tl_js_1.Api.is("updateNewChannelMessage", update) || _2_tl_js_1.Api.is("updateEditChannelMessage", update) ? _2_tl_js_1.Api.as("peerChannel", update.message.peer_id).channel_id : update.channel_id;
|
|
524
|
+
if (_2_tl_js_1.Api.is("updateChannelTooLong", update)) {
|
|
537
525
|
if (update.pts != undefined) {
|
|
538
526
|
await __classPrivateFieldGet(this, _UpdateManager_c, "f").storage.setChannelPts(channelId, update.pts);
|
|
539
527
|
}
|
|
@@ -568,7 +556,7 @@ _a = UpdateManager, _UpdateManager_c = new WeakMap(), _UpdateManager_updateState
|
|
|
568
556
|
}
|
|
569
557
|
});
|
|
570
558
|
}, _UpdateManager_processChannelPtsUpdate = function _UpdateManager_processChannelPtsUpdate(update, checkGap) {
|
|
571
|
-
const channelId =
|
|
559
|
+
const channelId = _2_tl_js_1.Api.is("updateNewChannelMessage", update) || _2_tl_js_1.Api.is("updateEditChannelMessage", update) ? _2_tl_js_1.Api.as("peerChannel", update.message.peer_id).channel_id : update.channel_id;
|
|
572
560
|
let queue = __classPrivateFieldGet(this, _UpdateManager_channelUpdateQueues, "f").get(channelId);
|
|
573
561
|
if (queue == undefined) {
|
|
574
562
|
queue = new _1_utilities_js_1.Queue(`channelUpdates-${channelId}`);
|
|
@@ -628,7 +616,7 @@ _a = UpdateManager, _UpdateManager_c = new WeakMap(), _UpdateManager_updateState
|
|
|
628
616
|
/// [2]: https://core.telegram.org/type/Updates
|
|
629
617
|
/// [3]: https://core.telegram.org/constructor/updatesTooLong
|
|
630
618
|
let updates;
|
|
631
|
-
if (
|
|
619
|
+
if (_2_tl_js_1.Api.is("updatesCombined", updates_) || _2_tl_js_1.Api.is("updates", updates_)) {
|
|
632
620
|
updates = updates_.updates;
|
|
633
621
|
const seq = updates_.seq;
|
|
634
622
|
const seqStart = "seq_start" in updates_ ? updates_.seq_start : updates_.seq;
|
|
@@ -659,10 +647,10 @@ _a = UpdateManager, _UpdateManager_c = new WeakMap(), _UpdateManager_updateState
|
|
|
659
647
|
}
|
|
660
648
|
}
|
|
661
649
|
}
|
|
662
|
-
else if (
|
|
650
|
+
else if (_2_tl_js_1.Api.is("updateShort", updates_)) {
|
|
663
651
|
updates = [updates_.update];
|
|
664
652
|
}
|
|
665
|
-
else if (
|
|
653
|
+
else if (_2_tl_js_1.Api.is("updateShortMessage", updates_)) {
|
|
666
654
|
updates = [
|
|
667
655
|
{
|
|
668
656
|
_: "updateNewMessage",
|
|
@@ -688,7 +676,7 @@ _a = UpdateManager, _UpdateManager_c = new WeakMap(), _UpdateManager_updateState
|
|
|
688
676
|
},
|
|
689
677
|
];
|
|
690
678
|
}
|
|
691
|
-
else if (
|
|
679
|
+
else if (_2_tl_js_1.Api.is("updateShortChatMessage", updates_)) {
|
|
692
680
|
updates = [
|
|
693
681
|
{
|
|
694
682
|
_: "updateNewMessage",
|
|
@@ -713,8 +701,8 @@ _a = UpdateManager, _UpdateManager_c = new WeakMap(), _UpdateManager_updateState
|
|
|
713
701
|
},
|
|
714
702
|
];
|
|
715
703
|
}
|
|
716
|
-
else if (
|
|
717
|
-
if (!
|
|
704
|
+
else if (_2_tl_js_1.Api.is("updateShortSentMessage", updates_)) {
|
|
705
|
+
if (!_2_tl_js_1.Api.is("messages.sendMessage", call)) {
|
|
718
706
|
(0, _0_deps_js_1.unreachable)();
|
|
719
707
|
}
|
|
720
708
|
updates = [{
|
|
@@ -725,7 +713,7 @@ _a = UpdateManager, _UpdateManager_c = new WeakMap(), _UpdateManager_updateState
|
|
|
725
713
|
silent: call.silent,
|
|
726
714
|
id: updates_.id,
|
|
727
715
|
from_id: { _: "peerUser", user_id: BigInt(await __classPrivateFieldGet(this, _UpdateManager_c, "f").getSelfId()) },
|
|
728
|
-
peer_id:
|
|
716
|
+
peer_id: _2_tl_js_1.Api.inputPeerToPeer(call.peer),
|
|
729
717
|
message: call.message,
|
|
730
718
|
media: updates_.media,
|
|
731
719
|
date: updates_.date,
|
|
@@ -737,30 +725,32 @@ _a = UpdateManager, _UpdateManager_c = new WeakMap(), _UpdateManager_updateState
|
|
|
737
725
|
pts_count: updates_.pts_count,
|
|
738
726
|
}];
|
|
739
727
|
}
|
|
740
|
-
else if (
|
|
728
|
+
else if (_2_tl_js_1.Api.is("updatesTooLong", updates_)) {
|
|
741
729
|
await this.recoverUpdateGap("updatesTooLong");
|
|
742
730
|
return;
|
|
743
731
|
}
|
|
744
|
-
else if (
|
|
732
|
+
else if (_2_tl_js_1.Api.isOfEnum("Update", updates_)) {
|
|
745
733
|
updates = [updates_];
|
|
746
734
|
}
|
|
747
735
|
else {
|
|
748
736
|
(0, _0_deps_js_1.unreachable)();
|
|
749
737
|
}
|
|
750
738
|
/// We process the updates when we are sure there is no gap.
|
|
751
|
-
if (
|
|
739
|
+
if (_2_tl_js_1.Api.is("updates", updates_) || _2_tl_js_1.Api.is("updatesCombined", updates_)) {
|
|
752
740
|
await this.processChats(updates_.chats, updates_);
|
|
753
741
|
await this.processUsers(updates_.users, updates_);
|
|
754
742
|
await __classPrivateFieldGet(this, _UpdateManager_instances, "m", _UpdateManager_setUpdateStateDate).call(this, updates_.date);
|
|
755
743
|
}
|
|
756
|
-
else if (
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
744
|
+
else if (_2_tl_js_1.Api.isOneOf([
|
|
745
|
+
"updateShort",
|
|
746
|
+
"updateShortMessage",
|
|
747
|
+
"updateShortChatMessage",
|
|
748
|
+
"updateShortSentMessage",
|
|
749
|
+
], updates_)) {
|
|
760
750
|
await __classPrivateFieldGet(this, _UpdateManager_instances, "m", _UpdateManager_setUpdateStateDate).call(this, updates_.date);
|
|
761
751
|
}
|
|
762
752
|
for (const update of updates) {
|
|
763
|
-
if (
|
|
753
|
+
if (_2_tl_js_1.Api.is("updatePtsChanged", update)) {
|
|
764
754
|
await this.fetchState("updatePtsChanged");
|
|
765
755
|
if (__classPrivateFieldGet(this, _UpdateManager_updateState, "f")) {
|
|
766
756
|
await __classPrivateFieldGet(this, _UpdateManager_instances, "m", _UpdateManager_setState).call(this, __classPrivateFieldGet(this, _UpdateManager_updateState, "f"));
|
|
@@ -820,7 +810,7 @@ _a = UpdateManager, _UpdateManager_c = new WeakMap(), _UpdateManager_updateState
|
|
|
820
810
|
let pts = pts_ == null ? 1 : pts_;
|
|
821
811
|
let delay = 5;
|
|
822
812
|
while (true) {
|
|
823
|
-
const { access_hash } = await __classPrivateFieldGet(this, _UpdateManager_c, "f").getInputPeer(_1_utilities_js_1.ZERO_CHANNEL_ID + -Number(channelId)).then((v) =>
|
|
813
|
+
const { access_hash } = await __classPrivateFieldGet(this, _UpdateManager_c, "f").getInputPeer(_1_utilities_js_1.ZERO_CHANNEL_ID + -Number(channelId)).then((v) => _2_tl_js_1.Api.as("inputPeerChannel", v));
|
|
824
814
|
let difference;
|
|
825
815
|
try {
|
|
826
816
|
difference = await __classPrivateFieldGet(this, _UpdateManager_c, "f").invoke({
|
|
@@ -845,7 +835,7 @@ _a = UpdateManager, _UpdateManager_c = new WeakMap(), _UpdateManager_updateState
|
|
|
845
835
|
throw err;
|
|
846
836
|
}
|
|
847
837
|
}
|
|
848
|
-
if (
|
|
838
|
+
if (_2_tl_js_1.Api.is("updates.channelDifference", difference)) {
|
|
849
839
|
await this.processChats(difference.chats, difference);
|
|
850
840
|
await this.processUsers(difference.users, difference);
|
|
851
841
|
for (const message of difference.new_messages) {
|
|
@@ -858,7 +848,7 @@ _a = UpdateManager, _UpdateManager_c = new WeakMap(), _UpdateManager_updateState
|
|
|
858
848
|
__classPrivateFieldGet(this, _UpdateManager_LrecoverChannelUpdateGap, "f").debug(`recovered from update gap [${channelId}, ${source}]`, channelId, source);
|
|
859
849
|
break;
|
|
860
850
|
}
|
|
861
|
-
else if (
|
|
851
|
+
else if (_2_tl_js_1.Api.is("updates.channelDifferenceTooLong", difference)) {
|
|
862
852
|
// TODO: invalidate messages
|
|
863
853
|
__classPrivateFieldGet(this, _UpdateManager_LrecoverChannelUpdateGap, "f").debug("received channelDifferenceTooLong");
|
|
864
854
|
await this.processChats(difference.chats, difference);
|
|
@@ -866,7 +856,7 @@ _a = UpdateManager, _UpdateManager_c = new WeakMap(), _UpdateManager_updateState
|
|
|
866
856
|
for (const message of difference.messages) {
|
|
867
857
|
await __classPrivateFieldGet(this, _UpdateManager_instances, "m", _UpdateManager_processUpdates).call(this, { _: "updateNewChannelMessage", message, pts: 0, pts_count: 0 }, false);
|
|
868
858
|
}
|
|
869
|
-
const pts_ =
|
|
859
|
+
const pts_ = _2_tl_js_1.Api.as("dialog", difference.dialog).pts;
|
|
870
860
|
if (pts_ != undefined) {
|
|
871
861
|
pts = pts_;
|
|
872
862
|
}
|
|
@@ -875,7 +865,7 @@ _a = UpdateManager, _UpdateManager_c = new WeakMap(), _UpdateManager_updateState
|
|
|
875
865
|
}
|
|
876
866
|
__classPrivateFieldGet(this, _UpdateManager_LrecoverChannelUpdateGap, "f").debug("processed channelDifferenceTooLong");
|
|
877
867
|
}
|
|
878
|
-
else if (
|
|
868
|
+
else if (_2_tl_js_1.Api.is("updates.channelDifferenceEmpty", difference)) {
|
|
879
869
|
__classPrivateFieldGet(this, _UpdateManager_LrecoverChannelUpdateGap, "f").debug("there was no update gap");
|
|
880
870
|
break;
|
|
881
871
|
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MTKruto - Cross-runtime JavaScript library for building Telegram clients
|
|
3
|
+
* Copyright (C) 2023-2025 Roj <https://roj.im/>
|
|
4
|
+
*
|
|
5
|
+
* This file is part of MTKruto.
|
|
6
|
+
*
|
|
7
|
+
* This program is free software: you can redistribute it and/or modify
|
|
8
|
+
* it under the terms of the GNU Lesser General Public License as published by
|
|
9
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
10
|
+
* (at your option) any later version.
|
|
11
|
+
*
|
|
12
|
+
* This program is distributed in the hope that it will be useful,
|
|
13
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15
|
+
* GNU Lesser General Public License for more details.
|
|
16
|
+
*
|
|
17
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
18
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
19
|
+
*/
|
|
20
|
+
import { ClientEncrypted } from "./2_client_encrypted.js";
|
|
21
|
+
export declare class ClientEncryptedPool {
|
|
22
|
+
#private;
|
|
23
|
+
constructor(requestPerClient: number);
|
|
24
|
+
get size(): number;
|
|
25
|
+
add(client: ClientEncrypted): void;
|
|
26
|
+
nextClient(): ClientEncrypted;
|
|
27
|
+
disconnect(): void;
|
|
28
|
+
map(callback: (client: ClientEncrypted) => void): void;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=3_client_encrypted_pool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"3_client_encrypted_pool.d.ts","sourceRoot":"","sources":["../../src/client/3_client_encrypted_pool.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D,qBAAa,mBAAmB;;gBAMlB,gBAAgB,EAAE,MAAM;IAIpC,IAAI,IAAI,WAEP;IAED,GAAG,CAAC,MAAM,EAAE,eAAe;IAc3B,UAAU;IAKV,UAAU;IAMV,GAAG,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,eAAe,KAAK,IAAI;CAGhD"}
|