@mtkruto/node 0.2.51 → 0.3.1
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/0_deps.d.ts +3 -3
- package/esm/0_deps.d.ts.map +1 -1
- package/esm/0_deps.js +3 -3
- package/esm/client/0_params.d.ts +3 -1
- package/esm/client/0_params.d.ts.map +1 -1
- package/esm/client/0_storage_operations.d.ts +8 -0
- package/esm/client/0_storage_operations.d.ts.map +1 -1
- package/esm/client/0_storage_operations.js +22 -13
- package/esm/client/0_utilities.d.ts +5 -0
- package/esm/client/0_utilities.d.ts.map +1 -1
- package/esm/client/0_utilities.js +33 -1
- package/esm/client/1_types.d.ts +3 -3
- package/esm/client/1_types.d.ts.map +1 -1
- package/esm/client/2_account_manager.d.ts.map +1 -1
- package/esm/client/2_account_manager.js +11 -10
- package/esm/client/2_update_manager.d.ts +2 -2
- package/esm/client/2_update_manager.d.ts.map +1 -1
- package/esm/client/2_update_manager.js +100 -14
- package/esm/client/3_message_manager.d.ts +2 -2
- package/esm/client/3_message_manager.d.ts.map +1 -1
- package/esm/client/3_message_manager.js +66 -31
- package/esm/client/3_video_chat_manager.d.ts.map +1 -1
- package/esm/client/3_video_chat_manager.js +2 -1
- package/esm/client/4_chat_list_manager.js +11 -11
- package/esm/client/5_client.d.ts +6 -6
- package/esm/client/5_client.d.ts.map +1 -1
- package/esm/client/5_client.js +49 -18
- package/esm/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/almost_equals.d.ts +1 -1
- package/{script/deps/jsr.io/@std/assert/1.0.5 → esm/deps/jsr.io/@std/assert/1.0.6}/almost_equals.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/almost_equals.js +1 -1
- package/{script/deps/jsr.io/@std/assert/1.0.5 → esm/deps/jsr.io/@std/assert/1.0.6}/array_includes.d.ts +1 -1
- package/esm/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/array_includes.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/array_includes.js +2 -2
- package/esm/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/assert.d.ts +1 -1
- package/esm/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/assert.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/assert.js +1 -1
- package/esm/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/assertion_error.d.ts +1 -1
- package/esm/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/assertion_error.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/assertion_error.js +1 -1
- package/{script/deps/jsr.io/@std/assert/1.0.5 → esm/deps/jsr.io/@std/assert/1.0.6}/equal.d.ts +2 -2
- package/esm/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/equal.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/equal.js +2 -2
- package/esm/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/equals.d.ts +1 -1
- package/esm/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/equals.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/equals.js +5 -5
- package/{script/deps/jsr.io/@std/assert/1.0.5 → esm/deps/jsr.io/@std/assert/1.0.6}/exists.d.ts +1 -1
- package/esm/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/exists.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/exists.js +1 -1
- package/{script/deps/jsr.io/@std/assert/1.0.5 → esm/deps/jsr.io/@std/assert/1.0.6}/fail.d.ts +1 -1
- package/esm/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/fail.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/fail.js +1 -1
- package/{script/deps/jsr.io/@std/assert/1.0.5 → esm/deps/jsr.io/@std/assert/1.0.6}/false.d.ts +1 -1
- package/esm/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/false.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/false.js +1 -1
- package/esm/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/greater.d.ts +1 -1
- package/esm/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/greater.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/greater.js +2 -2
- package/{script/deps/jsr.io/@std/assert/1.0.5 → esm/deps/jsr.io/@std/assert/1.0.6}/greater_or_equal.d.ts +1 -1
- package/esm/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/greater_or_equal.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/greater_or_equal.js +2 -2
- package/{script/deps/jsr.io/@std/assert/1.0.5 → esm/deps/jsr.io/@std/assert/1.0.6}/instance_of.d.ts +3 -3
- package/esm/deps/jsr.io/@std/assert/1.0.6/instance_of.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/instance_of.js +1 -1
- package/esm/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/is_error.d.ts +2 -2
- package/esm/deps/jsr.io/@std/assert/1.0.6/is_error.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/is_error.js +2 -2
- package/{script/deps/jsr.io/@std/assert/1.0.5 → esm/deps/jsr.io/@std/assert/1.0.6}/less.d.ts +1 -1
- package/esm/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/less.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/less.js +2 -2
- package/{script/deps/jsr.io/@std/assert/1.0.5 → esm/deps/jsr.io/@std/assert/1.0.6}/less_or_equal.d.ts +1 -1
- package/esm/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/less_or_equal.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/less_or_equal.js +2 -2
- package/{script/deps/jsr.io/@std/assert/1.0.5 → esm/deps/jsr.io/@std/assert/1.0.6}/match.d.ts +1 -1
- package/esm/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/match.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/match.js +1 -1
- package/esm/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/mod.d.ts +1 -1
- package/esm/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/mod.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/mod.js +1 -1
- package/esm/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/not_equals.d.ts +1 -1
- package/esm/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/not_equals.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/not_equals.js +1 -1
- package/{script/deps/jsr.io/@std/assert/1.0.5 → esm/deps/jsr.io/@std/assert/1.0.6}/not_instance_of.d.ts +2 -2
- package/esm/deps/jsr.io/@std/assert/1.0.6/not_instance_of.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/not_instance_of.js +1 -1
- package/esm/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/not_match.d.ts +1 -1
- package/esm/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/not_match.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/not_match.js +1 -1
- package/{script/deps/jsr.io/@std/assert/1.0.5 → esm/deps/jsr.io/@std/assert/1.0.6}/not_strict_equals.d.ts +1 -1
- package/esm/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/not_strict_equals.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/not_strict_equals.js +2 -2
- package/esm/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/object_match.d.ts +2 -2
- package/esm/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/object_match.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/object_match.js +2 -2
- package/{script/deps/jsr.io/@std/assert/1.0.5 → esm/deps/jsr.io/@std/assert/1.0.6}/rejects.d.ts +3 -3
- package/esm/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/rejects.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/rejects.js +2 -3
- package/{script/deps/jsr.io/@std/assert/1.0.5 → esm/deps/jsr.io/@std/assert/1.0.6}/strict_equals.d.ts +1 -1
- package/esm/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/strict_equals.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/strict_equals.js +6 -6
- package/{script/deps/jsr.io/@std/assert/1.0.5 → esm/deps/jsr.io/@std/assert/1.0.6}/string_includes.d.ts +1 -1
- package/esm/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/string_includes.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/string_includes.js +1 -1
- package/esm/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/throws.d.ts +3 -3
- package/esm/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/throws.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/throws.js +2 -3
- package/esm/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/unimplemented.d.ts +1 -1
- package/esm/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/unimplemented.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/unimplemented.js +1 -1
- package/{script/deps/jsr.io/@std/assert/1.0.5 → esm/deps/jsr.io/@std/assert/1.0.6}/unreachable.d.ts +1 -1
- package/esm/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/unreachable.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/unreachable.js +1 -1
- package/esm/deps/jsr.io/@std/bytes/{0.224.0 → 1.0.2}/concat.d.ts +3 -2
- package/esm/deps/jsr.io/@std/bytes/1.0.2/concat.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/bytes/{0.224.0 → 1.0.2}/concat.js +3 -2
- package/esm/deps/jsr.io/@std/internal/{1.0.3 → 1.0.4}/build_message.d.ts.map +1 -1
- package/{script/deps/jsr.io/@std/internal/1.0.3 → esm/deps/jsr.io/@std/internal/1.0.4}/diff.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/internal/{1.0.3 → 1.0.4}/diff_str.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/internal/{1.0.3 → 1.0.4}/format.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/internal/{1.0.3 → 1.0.4}/styles.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/internal/{1.0.3 → 1.0.4}/types.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/io/{0.224.8 → 0.224.9}/_constants.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/io/{0.224.8 → 0.224.9}/iterate_reader.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/io/{0.224.8 → 0.224.9}/types.d.ts.map +1 -1
- package/esm/tl/3_utilities.js +2 -2
- package/esm/types/0_id.d.ts +1 -1
- package/esm/types/1_bot_command_scope.js +1 -1
- package/package.json +1 -1
- package/script/0_deps.d.ts +3 -3
- package/script/0_deps.d.ts.map +1 -1
- package/script/0_deps.js +3 -3
- package/script/client/0_params.d.ts +3 -1
- package/script/client/0_params.d.ts.map +1 -1
- package/script/client/0_storage_operations.d.ts +8 -0
- package/script/client/0_storage_operations.d.ts.map +1 -1
- package/script/client/0_storage_operations.js +21 -12
- package/script/client/0_utilities.d.ts +5 -0
- package/script/client/0_utilities.d.ts.map +1 -1
- package/script/client/0_utilities.js +37 -1
- package/script/client/1_types.d.ts +3 -3
- package/script/client/1_types.d.ts.map +1 -1
- package/script/client/2_account_manager.d.ts.map +1 -1
- package/script/client/2_account_manager.js +11 -10
- package/script/client/2_update_manager.d.ts +2 -2
- package/script/client/2_update_manager.d.ts.map +1 -1
- package/script/client/2_update_manager.js +100 -14
- package/script/client/3_message_manager.d.ts +2 -2
- package/script/client/3_message_manager.d.ts.map +1 -1
- package/script/client/3_message_manager.js +74 -39
- package/script/client/3_video_chat_manager.d.ts.map +1 -1
- package/script/client/3_video_chat_manager.js +2 -1
- package/script/client/4_chat_list_manager.js +10 -10
- package/script/client/5_client.d.ts +6 -6
- package/script/client/5_client.d.ts.map +1 -1
- package/script/client/5_client.js +47 -16
- package/script/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/almost_equals.d.ts +1 -1
- package/{esm/deps/jsr.io/@std/assert/1.0.5 → script/deps/jsr.io/@std/assert/1.0.6}/almost_equals.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/almost_equals.js +1 -1
- package/{esm/deps/jsr.io/@std/assert/1.0.5 → script/deps/jsr.io/@std/assert/1.0.6}/array_includes.d.ts +1 -1
- package/script/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/array_includes.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/array_includes.js +2 -2
- package/script/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/assert.d.ts +1 -1
- package/script/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/assert.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/assert.js +1 -1
- package/script/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/assertion_error.d.ts +1 -1
- package/script/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/assertion_error.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/assertion_error.js +1 -1
- package/{esm/deps/jsr.io/@std/assert/1.0.5 → script/deps/jsr.io/@std/assert/1.0.6}/equal.d.ts +2 -2
- package/script/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/equal.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/equal.js +2 -2
- package/script/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/equals.d.ts +1 -1
- package/script/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/equals.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/equals.js +5 -5
- package/{esm/deps/jsr.io/@std/assert/1.0.5 → script/deps/jsr.io/@std/assert/1.0.6}/exists.d.ts +1 -1
- package/script/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/exists.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/exists.js +1 -1
- package/{esm/deps/jsr.io/@std/assert/1.0.5 → script/deps/jsr.io/@std/assert/1.0.6}/fail.d.ts +1 -1
- package/script/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/fail.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/fail.js +1 -1
- package/{esm/deps/jsr.io/@std/assert/1.0.5 → script/deps/jsr.io/@std/assert/1.0.6}/false.d.ts +1 -1
- package/script/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/false.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/false.js +1 -1
- package/script/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/greater.d.ts +1 -1
- package/script/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/greater.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/greater.js +2 -2
- package/{esm/deps/jsr.io/@std/assert/1.0.5 → script/deps/jsr.io/@std/assert/1.0.6}/greater_or_equal.d.ts +1 -1
- package/script/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/greater_or_equal.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/greater_or_equal.js +2 -2
- package/{esm/deps/jsr.io/@std/assert/1.0.5 → script/deps/jsr.io/@std/assert/1.0.6}/instance_of.d.ts +3 -3
- package/script/deps/jsr.io/@std/assert/1.0.6/instance_of.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/instance_of.js +1 -1
- package/script/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/is_error.d.ts +2 -2
- package/script/deps/jsr.io/@std/assert/1.0.6/is_error.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/is_error.js +2 -2
- package/{esm/deps/jsr.io/@std/assert/1.0.5 → script/deps/jsr.io/@std/assert/1.0.6}/less.d.ts +1 -1
- package/script/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/less.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/less.js +2 -2
- package/{esm/deps/jsr.io/@std/assert/1.0.5 → script/deps/jsr.io/@std/assert/1.0.6}/less_or_equal.d.ts +1 -1
- package/script/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/less_or_equal.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/less_or_equal.js +2 -2
- package/{esm/deps/jsr.io/@std/assert/1.0.5 → script/deps/jsr.io/@std/assert/1.0.6}/match.d.ts +1 -1
- package/script/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/match.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/match.js +1 -1
- package/script/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/mod.d.ts +1 -1
- package/script/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/mod.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/mod.js +1 -1
- package/script/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/not_equals.d.ts +1 -1
- package/script/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/not_equals.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/not_equals.js +1 -1
- package/{esm/deps/jsr.io/@std/assert/1.0.5 → script/deps/jsr.io/@std/assert/1.0.6}/not_instance_of.d.ts +2 -2
- package/script/deps/jsr.io/@std/assert/1.0.6/not_instance_of.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/not_instance_of.js +1 -1
- package/script/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/not_match.d.ts +1 -1
- package/script/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/not_match.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/not_match.js +1 -1
- package/{esm/deps/jsr.io/@std/assert/1.0.5 → script/deps/jsr.io/@std/assert/1.0.6}/not_strict_equals.d.ts +1 -1
- package/script/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/not_strict_equals.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/not_strict_equals.js +2 -2
- package/script/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/object_match.d.ts +2 -2
- package/script/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/object_match.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/object_match.js +2 -2
- package/{esm/deps/jsr.io/@std/assert/1.0.5 → script/deps/jsr.io/@std/assert/1.0.6}/rejects.d.ts +3 -3
- package/script/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/rejects.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/rejects.js +2 -3
- package/{esm/deps/jsr.io/@std/assert/1.0.5 → script/deps/jsr.io/@std/assert/1.0.6}/strict_equals.d.ts +1 -1
- package/script/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/strict_equals.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/strict_equals.js +6 -6
- package/{esm/deps/jsr.io/@std/assert/1.0.5 → script/deps/jsr.io/@std/assert/1.0.6}/string_includes.d.ts +1 -1
- package/script/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/string_includes.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/string_includes.js +1 -1
- package/script/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/throws.d.ts +3 -3
- package/script/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/throws.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/throws.js +2 -3
- package/script/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/unimplemented.d.ts +1 -1
- package/script/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/unimplemented.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/unimplemented.js +1 -1
- package/{esm/deps/jsr.io/@std/assert/1.0.5 → script/deps/jsr.io/@std/assert/1.0.6}/unreachable.d.ts +1 -1
- package/script/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/unreachable.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/assert/{1.0.5 → 1.0.6}/unreachable.js +1 -1
- package/script/deps/jsr.io/@std/bytes/{0.224.0 → 1.0.2}/concat.d.ts +3 -2
- package/script/deps/jsr.io/@std/bytes/1.0.2/concat.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/bytes/{0.224.0 → 1.0.2}/concat.js +3 -2
- package/script/deps/jsr.io/@std/internal/{1.0.3 → 1.0.4}/build_message.d.ts.map +1 -1
- package/{esm/deps/jsr.io/@std/internal/1.0.3 → script/deps/jsr.io/@std/internal/1.0.4}/diff.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/internal/{1.0.3 → 1.0.4}/diff_str.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/internal/{1.0.3 → 1.0.4}/format.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/internal/{1.0.3 → 1.0.4}/styles.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/internal/{1.0.3 → 1.0.4}/types.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/io/{0.224.8 → 0.224.9}/_constants.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/io/{0.224.8 → 0.224.9}/iterate_reader.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/io/{0.224.8 → 0.224.9}/types.d.ts.map +1 -1
- package/script/tl/3_utilities.js +2 -2
- package/script/types/0_id.d.ts +1 -1
- package/script/types/1_bot_command_scope.js +1 -1
- package/esm/deps/jsr.io/@std/assert/1.0.5/instance_of.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.5/is_error.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.5/not_instance_of.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/bytes/0.224.0/concat.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.5/instance_of.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.5/is_error.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.5/not_instance_of.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/bytes/0.224.0/concat.d.ts.map +0 -1
- /package/esm/deps/jsr.io/@std/internal/{1.0.3 → 1.0.4}/build_message.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/internal/{1.0.3 → 1.0.4}/build_message.js +0 -0
- /package/esm/deps/jsr.io/@std/internal/{1.0.3 → 1.0.4}/diff.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/internal/{1.0.3 → 1.0.4}/diff.js +0 -0
- /package/esm/deps/jsr.io/@std/internal/{1.0.3 → 1.0.4}/diff_str.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/internal/{1.0.3 → 1.0.4}/diff_str.js +0 -0
- /package/esm/deps/jsr.io/@std/internal/{1.0.3 → 1.0.4}/format.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/internal/{1.0.3 → 1.0.4}/format.js +0 -0
- /package/esm/deps/jsr.io/@std/internal/{1.0.3 → 1.0.4}/styles.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/internal/{1.0.3 → 1.0.4}/styles.js +0 -0
- /package/esm/deps/jsr.io/@std/internal/{1.0.3 → 1.0.4}/types.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/internal/{1.0.3 → 1.0.4}/types.js +0 -0
- /package/esm/deps/jsr.io/@std/io/{0.224.8 → 0.224.9}/_constants.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/io/{0.224.8 → 0.224.9}/_constants.js +0 -0
- /package/esm/deps/jsr.io/@std/io/{0.224.8 → 0.224.9}/iterate_reader.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/io/{0.224.8 → 0.224.9}/iterate_reader.js +0 -0
- /package/esm/deps/jsr.io/@std/io/{0.224.8 → 0.224.9}/types.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/io/{0.224.8 → 0.224.9}/types.js +0 -0
- /package/script/deps/jsr.io/@std/internal/{1.0.3 → 1.0.4}/build_message.d.ts +0 -0
- /package/script/deps/jsr.io/@std/internal/{1.0.3 → 1.0.4}/build_message.js +0 -0
- /package/script/deps/jsr.io/@std/internal/{1.0.3 → 1.0.4}/diff.d.ts +0 -0
- /package/script/deps/jsr.io/@std/internal/{1.0.3 → 1.0.4}/diff.js +0 -0
- /package/script/deps/jsr.io/@std/internal/{1.0.3 → 1.0.4}/diff_str.d.ts +0 -0
- /package/script/deps/jsr.io/@std/internal/{1.0.3 → 1.0.4}/diff_str.js +0 -0
- /package/script/deps/jsr.io/@std/internal/{1.0.3 → 1.0.4}/format.d.ts +0 -0
- /package/script/deps/jsr.io/@std/internal/{1.0.3 → 1.0.4}/format.js +0 -0
- /package/script/deps/jsr.io/@std/internal/{1.0.3 → 1.0.4}/styles.d.ts +0 -0
- /package/script/deps/jsr.io/@std/internal/{1.0.3 → 1.0.4}/styles.js +0 -0
- /package/script/deps/jsr.io/@std/internal/{1.0.3 → 1.0.4}/types.d.ts +0 -0
- /package/script/deps/jsr.io/@std/internal/{1.0.3 → 1.0.4}/types.js +0 -0
- /package/script/deps/jsr.io/@std/io/{0.224.8 → 0.224.9}/_constants.d.ts +0 -0
- /package/script/deps/jsr.io/@std/io/{0.224.8 → 0.224.9}/_constants.js +0 -0
- /package/script/deps/jsr.io/@std/io/{0.224.8 → 0.224.9}/iterate_reader.d.ts +0 -0
- /package/script/deps/jsr.io/@std/io/{0.224.8 → 0.224.9}/iterate_reader.js +0 -0
- /package/script/deps/jsr.io/@std/io/{0.224.8 → 0.224.9}/types.d.ts +0 -0
- /package/script/deps/jsr.io/@std/io/{0.224.8 → 0.224.9}/types.js +0 -0
|
@@ -28,7 +28,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
28
28
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
29
29
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
30
30
|
};
|
|
31
|
-
var _UpdateManager_instances, _a, _UpdateManager_c, _UpdateManager_updateState, _UpdateManager_updateHandler, _UpdateManager_LrecoverUpdateGap, _UpdateManager_LrecoverChannelUpdateGap, _UpdateManager_L$handleUpdate, _UpdateManager_L$processUpdates, _UpdateManager_LfetchState, _UpdateManager_LopenChat, _UpdateManager_defaultDropPendingUpdates, _UpdateManager_mustDropPendingUpdates, _UpdateManager_state, _UpdateManager_getState, _UpdateManager_setState, _UpdateManager_handleUpdateQueues, _UpdateManager_nonFirst, _UpdateManager_getChannelPtsWithDropPendingUpdatesCheck, _UpdateManager_checkGap, _UpdateManager_checkGapQts, _UpdateManager_checkChannelGap, _UpdateManager_channelUpdateQueues, _UpdateManager_processChannelPtsUpdateInner, _UpdateManager_queueUpdate, _UpdateManager_processChannelPtsUpdate, _UpdateManager_processPtsUpdateInner, _UpdateManager_ptsUpdateQueue, _UpdateManager_processPtsUpdate, _UpdateManager_processQtsUpdateInner, _UpdateManager_qtsUpdateQueue, _UpdateManager_processQtsUpdate, _UpdateManager_processUpdatesQueue, _UpdateManager_processUpdates, _UpdateManager_setUpdateStateDate, _UpdateManager_setUpdatePts, _UpdateManager_setUpdateQts, _UpdateManager_getLocalState, _UpdateManager_recoveringUpdateGap, _UpdateManager_recoverUpdateGapMutex, _UpdateManager_recoverChannelUpdateGap, _UpdateManager_handleUpdatesSet, _UpdateManager_handleStoredUpdates, _UpdateManager_handleUpdate, _UpdateManager_openChats;
|
|
31
|
+
var _UpdateManager_instances, _a, _UpdateManager_c, _UpdateManager_updateState, _UpdateManager_updateHandler, _UpdateManager_LrecoverUpdateGap, _UpdateManager_LrecoverChannelUpdateGap, _UpdateManager_L$handleUpdate, _UpdateManager_L$processUpdates, _UpdateManager_LfetchState, _UpdateManager_LopenChat, _UpdateManager_Lmin, _UpdateManager_defaultDropPendingUpdates, _UpdateManager_mustDropPendingUpdates, _UpdateManager_state, _UpdateManager_getState, _UpdateManager_setState, _UpdateManager_extractMessages, _UpdateManager_extractMinPeerReferences, _UpdateManager_handleUpdateQueues, _UpdateManager_nonFirst, _UpdateManager_getChannelPtsWithDropPendingUpdatesCheck, _UpdateManager_checkGap, _UpdateManager_checkGapQts, _UpdateManager_checkChannelGap, _UpdateManager_channelUpdateQueues, _UpdateManager_processChannelPtsUpdateInner, _UpdateManager_queueUpdate, _UpdateManager_processChannelPtsUpdate, _UpdateManager_processPtsUpdateInner, _UpdateManager_ptsUpdateQueue, _UpdateManager_processPtsUpdate, _UpdateManager_processQtsUpdateInner, _UpdateManager_qtsUpdateQueue, _UpdateManager_processQtsUpdate, _UpdateManager_processUpdatesQueue, _UpdateManager_processUpdates, _UpdateManager_setUpdateStateDate, _UpdateManager_setUpdatePts, _UpdateManager_setUpdateQts, _UpdateManager_getLocalState, _UpdateManager_recoveringUpdateGap, _UpdateManager_recoverUpdateGapMutex, _UpdateManager_recoverChannelUpdateGap, _UpdateManager_handleUpdatesSet, _UpdateManager_handleStoredUpdates, _UpdateManager_handleUpdate, _UpdateManager_openChats;
|
|
32
32
|
import { unreachable } from "../0_deps.js";
|
|
33
33
|
import { InputError } from "../0_errors.js";
|
|
34
34
|
import { getLogger, Mutex, Queue, second, ZERO_CHANNEL_ID } from "../1_utilities.js";
|
|
@@ -47,6 +47,7 @@ export class UpdateManager {
|
|
|
47
47
|
_UpdateManager_L$processUpdates.set(this, void 0);
|
|
48
48
|
_UpdateManager_LfetchState.set(this, void 0);
|
|
49
49
|
_UpdateManager_LopenChat.set(this, void 0);
|
|
50
|
+
_UpdateManager_Lmin.set(this, void 0);
|
|
50
51
|
_UpdateManager_defaultDropPendingUpdates.set(this, null);
|
|
51
52
|
_UpdateManager_state.set(this, undefined);
|
|
52
53
|
_UpdateManager_handleUpdateQueues.set(this, new Map());
|
|
@@ -67,6 +68,7 @@ export class UpdateManager {
|
|
|
67
68
|
__classPrivateFieldSet(this, _UpdateManager_L$processUpdates, L.branch("#processUpdates"), "f");
|
|
68
69
|
__classPrivateFieldSet(this, _UpdateManager_LfetchState, L.branch("fetchState"), "f");
|
|
69
70
|
__classPrivateFieldSet(this, _UpdateManager_LopenChat, L.branch("openChat"), "f");
|
|
71
|
+
__classPrivateFieldSet(this, _UpdateManager_Lmin, L.branch("min"), "f");
|
|
70
72
|
}
|
|
71
73
|
static isPtsUpdate(v) {
|
|
72
74
|
return isOneOf(["updateNewMessage", "updateDeleteMessages", "updateReadHistoryInbox", "updateReadHistoryOutbox", "updatePinnedChannelMessages", "updatePinnedMessages", "updateFolderPeers", "updateChannelWebPage", "updateEditMessage", "updateReadMessagesContents", "updateWebPage"], v);
|
|
@@ -100,12 +102,24 @@ export class UpdateManager {
|
|
|
100
102
|
await __classPrivateFieldGet(this, _UpdateManager_instances, "m", _UpdateManager_setState).call(this, state);
|
|
101
103
|
}
|
|
102
104
|
}
|
|
103
|
-
async processChats(chats) {
|
|
105
|
+
async processChats(chats, context) {
|
|
104
106
|
for (const chat of chats) {
|
|
105
107
|
if (isOneOf(["channel", "channelForbidden"], chat)) {
|
|
106
108
|
if (!is("channel", chat) || !chat.min || chat.min && await __classPrivateFieldGet(this, _UpdateManager_c, "f").messageStorage.getEntity(peerToChatId(chat)) == null) {
|
|
107
109
|
await __classPrivateFieldGet(this, _UpdateManager_c, "f").messageStorage.setEntity(chat);
|
|
108
110
|
}
|
|
111
|
+
if (is("channel", chat) && chat.min) {
|
|
112
|
+
const entity = await __classPrivateFieldGet(this, _UpdateManager_c, "f").messageStorage.getEntity(peerToChatId(chat));
|
|
113
|
+
const senderChatId = peerToChatId(chat);
|
|
114
|
+
if (is("channel", entity) && entity.min) {
|
|
115
|
+
for (const { chatId, senderId, messageId } of __classPrivateFieldGet(this, _UpdateManager_instances, "m", _UpdateManager_extractMinPeerReferences).call(this, context)) {
|
|
116
|
+
if (senderId == senderChatId) {
|
|
117
|
+
await __classPrivateFieldGet(this, _UpdateManager_c, "f").messageStorage.setMinPeerReference(chatId, senderId, messageId);
|
|
118
|
+
__classPrivateFieldGet(this, _UpdateManager_Lmin, "f").debug("channel min peer reference stored", chatId, senderId, messageId);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
109
123
|
if ("username" in chat && chat.username) {
|
|
110
124
|
await __classPrivateFieldGet(this, _UpdateManager_c, "f").messageStorage.updateUsernames(peerToChatId(chat), [chat.username]);
|
|
111
125
|
}
|
|
@@ -192,10 +206,10 @@ export class UpdateManager {
|
|
|
192
206
|
"users.userFull",
|
|
193
207
|
], result)) {
|
|
194
208
|
if ("chats" in result) {
|
|
195
|
-
await this.processChats(result.chats);
|
|
209
|
+
await this.processChats(result.chats, result);
|
|
196
210
|
}
|
|
197
211
|
if ("users" in result) {
|
|
198
|
-
await this.processUsers(result.users);
|
|
212
|
+
await this.processUsers(result.users, result);
|
|
199
213
|
}
|
|
200
214
|
if ("messages" in result && Array.isArray(result.messages)) {
|
|
201
215
|
for (const message of result.messages) {
|
|
@@ -213,12 +227,31 @@ export class UpdateManager {
|
|
|
213
227
|
}
|
|
214
228
|
}
|
|
215
229
|
}
|
|
216
|
-
async processUsers(users) {
|
|
230
|
+
async processUsers(users, context) {
|
|
217
231
|
for (const user of users) {
|
|
218
232
|
if (is("user", user) && user.access_hash) {
|
|
219
233
|
if (!user.min || user.min && await __classPrivateFieldGet(this, _UpdateManager_c, "f").messageStorage.getEntity(peerToChatId(user)) == null) {
|
|
220
234
|
await __classPrivateFieldGet(this, _UpdateManager_c, "f").messageStorage.setEntity(user);
|
|
221
235
|
}
|
|
236
|
+
if (user.min) {
|
|
237
|
+
__classPrivateFieldGet(this, _UpdateManager_Lmin, "f").debug("encountered min user");
|
|
238
|
+
}
|
|
239
|
+
if (is("user", user) && user.min) {
|
|
240
|
+
__classPrivateFieldGet(this, _UpdateManager_Lmin, "f").debug("emu A");
|
|
241
|
+
const entity = await __classPrivateFieldGet(this, _UpdateManager_c, "f").messageStorage.getEntity(peerToChatId(user));
|
|
242
|
+
const userId = peerToChatId(user);
|
|
243
|
+
if (is("user", entity) && entity.min) {
|
|
244
|
+
__classPrivateFieldGet(this, _UpdateManager_Lmin, "f").debug("emu B");
|
|
245
|
+
for (const { chatId, senderId, messageId } of __classPrivateFieldGet(this, _UpdateManager_instances, "m", _UpdateManager_extractMinPeerReferences).call(this, context)) {
|
|
246
|
+
__classPrivateFieldGet(this, _UpdateManager_Lmin, "f").debug("emu C", { chatId, senderId, messageId }, "=", userId);
|
|
247
|
+
if (senderId == userId) {
|
|
248
|
+
__classPrivateFieldGet(this, _UpdateManager_Lmin, "f").debug("emu X");
|
|
249
|
+
await __classPrivateFieldGet(this, _UpdateManager_c, "f").messageStorage.setMinPeerReference(chatId, senderId, messageId);
|
|
250
|
+
__classPrivateFieldGet(this, _UpdateManager_Lmin, "f").debug("user min peer reference stored", chatId, senderId, messageId);
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
}
|
|
222
255
|
if (user.username) {
|
|
223
256
|
await __classPrivateFieldGet(this, _UpdateManager_c, "f").messageStorage.updateUsernames(peerToChatId(user), [user.username]);
|
|
224
257
|
}
|
|
@@ -280,8 +313,8 @@ export class UpdateManager {
|
|
|
280
313
|
}
|
|
281
314
|
}
|
|
282
315
|
if (is("updates.difference", difference) || is("updates.differenceSlice", difference)) {
|
|
283
|
-
await this.processChats(difference.chats);
|
|
284
|
-
await this.processUsers(difference.users);
|
|
316
|
+
await this.processChats(difference.chats, difference);
|
|
317
|
+
await this.processUsers(difference.users, difference);
|
|
285
318
|
for (const message of difference.new_messages) {
|
|
286
319
|
await __classPrivateFieldGet(this, _UpdateManager_instances, "m", _UpdateManager_processUpdates).call(this, { _: "updateNewMessage", message, pts: 0, pts_count: 0 }, false);
|
|
287
320
|
}
|
|
@@ -402,7 +435,7 @@ export class UpdateManager {
|
|
|
402
435
|
}
|
|
403
436
|
}
|
|
404
437
|
}
|
|
405
|
-
_a = UpdateManager, _UpdateManager_c = new WeakMap(), _UpdateManager_updateState = new WeakMap(), _UpdateManager_updateHandler = new WeakMap(), _UpdateManager_LrecoverUpdateGap = new WeakMap(), _UpdateManager_LrecoverChannelUpdateGap = new WeakMap(), _UpdateManager_L$handleUpdate = new WeakMap(), _UpdateManager_L$processUpdates = new WeakMap(), _UpdateManager_LfetchState = new WeakMap(), _UpdateManager_LopenChat = new WeakMap(), _UpdateManager_defaultDropPendingUpdates = new WeakMap(), _UpdateManager_state = new WeakMap(), _UpdateManager_handleUpdateQueues = new WeakMap(), _UpdateManager_nonFirst = new WeakMap(), _UpdateManager_channelUpdateQueues = new WeakMap(), _UpdateManager_ptsUpdateQueue = new WeakMap(), _UpdateManager_qtsUpdateQueue = new WeakMap(), _UpdateManager_processUpdatesQueue = new WeakMap(), _UpdateManager_recoveringUpdateGap = new WeakMap(), _UpdateManager_recoverUpdateGapMutex = new WeakMap(), _UpdateManager_handleUpdatesSet = new WeakMap(), _UpdateManager_openChats = new WeakMap(), _UpdateManager_instances = new WeakSet(), _UpdateManager_mustDropPendingUpdates = async function _UpdateManager_mustDropPendingUpdates() {
|
|
438
|
+
_a = UpdateManager, _UpdateManager_c = new WeakMap(), _UpdateManager_updateState = new WeakMap(), _UpdateManager_updateHandler = new WeakMap(), _UpdateManager_LrecoverUpdateGap = new WeakMap(), _UpdateManager_LrecoverChannelUpdateGap = new WeakMap(), _UpdateManager_L$handleUpdate = new WeakMap(), _UpdateManager_L$processUpdates = new WeakMap(), _UpdateManager_LfetchState = new WeakMap(), _UpdateManager_LopenChat = new WeakMap(), _UpdateManager_Lmin = new WeakMap(), _UpdateManager_defaultDropPendingUpdates = new WeakMap(), _UpdateManager_state = new WeakMap(), _UpdateManager_handleUpdateQueues = new WeakMap(), _UpdateManager_nonFirst = new WeakMap(), _UpdateManager_channelUpdateQueues = new WeakMap(), _UpdateManager_ptsUpdateQueue = new WeakMap(), _UpdateManager_qtsUpdateQueue = new WeakMap(), _UpdateManager_processUpdatesQueue = new WeakMap(), _UpdateManager_recoveringUpdateGap = new WeakMap(), _UpdateManager_recoverUpdateGapMutex = new WeakMap(), _UpdateManager_handleUpdatesSet = new WeakMap(), _UpdateManager_openChats = new WeakMap(), _UpdateManager_instances = new WeakSet(), _UpdateManager_mustDropPendingUpdates = async function _UpdateManager_mustDropPendingUpdates() {
|
|
406
439
|
if (typeof __classPrivateFieldGet(this, _UpdateManager_c, "f").dropPendingUpdates === "boolean") {
|
|
407
440
|
return __classPrivateFieldGet(this, _UpdateManager_c, "f").dropPendingUpdates;
|
|
408
441
|
}
|
|
@@ -424,6 +457,59 @@ _a = UpdateManager, _UpdateManager_c = new WeakMap(), _UpdateManager_updateState
|
|
|
424
457
|
if (!await __classPrivateFieldGet(this, _UpdateManager_instances, "m", _UpdateManager_mustDropPendingUpdates).call(this)) {
|
|
425
458
|
await __classPrivateFieldGet(this, _UpdateManager_c, "f").storage.setState(state);
|
|
426
459
|
}
|
|
460
|
+
}, _UpdateManager_extractMessages = function _UpdateManager_extractMessages(context) {
|
|
461
|
+
const messages = new Array();
|
|
462
|
+
if (Array.isArray(context)) {
|
|
463
|
+
__classPrivateFieldGet(this, _UpdateManager_Lmin, "f").debug("em A");
|
|
464
|
+
for (const item of context) {
|
|
465
|
+
messages.push(...__classPrivateFieldGet(this, _UpdateManager_instances, "m", _UpdateManager_extractMessages).call(this, item));
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
else if (isOneOf(["updates", "updatesCombined"], context)) {
|
|
469
|
+
__classPrivateFieldGet(this, _UpdateManager_Lmin, "f").debug("em B");
|
|
470
|
+
messages.push(...__classPrivateFieldGet(this, _UpdateManager_instances, "m", _UpdateManager_extractMessages).call(this, context.updates));
|
|
471
|
+
}
|
|
472
|
+
else if (isOneOf(["updates.difference", "updates.differenceSlice", "updates.channelDifference"], context)) {
|
|
473
|
+
__classPrivateFieldGet(this, _UpdateManager_Lmin, "f").debug("em C");
|
|
474
|
+
for (const message of context.new_messages) {
|
|
475
|
+
if (is("message", message)) {
|
|
476
|
+
messages.push(message);
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
messages.push(...__classPrivateFieldGet(this, _UpdateManager_instances, "m", _UpdateManager_extractMessages).call(this, context.other_updates));
|
|
480
|
+
}
|
|
481
|
+
else if (isOneOf(["updateNewMessage", "updateNewChannelMessage", "updateEditMessage", "updateEditChannelMessage", "updateBotNewBusinessMessage", "updateBotNewBusinessMessage"], context)) {
|
|
482
|
+
__classPrivateFieldGet(this, _UpdateManager_Lmin, "f").debug("em D");
|
|
483
|
+
if (is("message", context.message)) {
|
|
484
|
+
messages.push(context.message);
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
else if (is("message", context)) {
|
|
488
|
+
__classPrivateFieldGet(this, _UpdateManager_Lmin, "f").debug("em E");
|
|
489
|
+
messages.push(context);
|
|
490
|
+
}
|
|
491
|
+
else if (context != null && typeof context === "object" && "messages" in context && Array.isArray(context.messages)) {
|
|
492
|
+
__classPrivateFieldGet(this, _UpdateManager_Lmin, "f").debug("em F");
|
|
493
|
+
for (const message of context.messages) {
|
|
494
|
+
if (is("message", message)) {
|
|
495
|
+
messages.push(message);
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
return messages;
|
|
500
|
+
}, _UpdateManager_extractMinPeerReferences = function _UpdateManager_extractMinPeerReferences(context) {
|
|
501
|
+
__classPrivateFieldGet(this, _UpdateManager_Lmin, "f").debug("empr A");
|
|
502
|
+
const minPeerReferences = new Array();
|
|
503
|
+
const messages = __classPrivateFieldGet(this, _UpdateManager_instances, "m", _UpdateManager_extractMessages).call(this, context);
|
|
504
|
+
__classPrivateFieldGet(this, _UpdateManager_Lmin, "f").debug("empr B", messages.length, context != null && typeof context == "object" && "_" in context ? context._ : typeof context);
|
|
505
|
+
for (const message of messages) {
|
|
506
|
+
__classPrivateFieldGet(this, _UpdateManager_Lmin, "f").debug("empr C");
|
|
507
|
+
if (!message.from_id) {
|
|
508
|
+
continue;
|
|
509
|
+
}
|
|
510
|
+
minPeerReferences.push({ chatId: peerToChatId(message.peer_id), senderId: peerToChatId(message.from_id), messageId: message.id });
|
|
511
|
+
}
|
|
512
|
+
return minPeerReferences;
|
|
427
513
|
}, _UpdateManager_getChannelPtsWithDropPendingUpdatesCheck = async function _UpdateManager_getChannelPtsWithDropPendingUpdatesCheck(channelId) {
|
|
428
514
|
if (!(await __classPrivateFieldGet(this, _UpdateManager_instances, "m", _UpdateManager_mustDropPendingUpdates).call(this))) {
|
|
429
515
|
return await __classPrivateFieldGet(this, _UpdateManager_c, "f").storage.getChannelPts(channelId);
|
|
@@ -672,8 +758,8 @@ _a = UpdateManager, _UpdateManager_c = new WeakMap(), _UpdateManager_updateState
|
|
|
672
758
|
}
|
|
673
759
|
/// We process the updates when we are sure there is no gap.
|
|
674
760
|
if (is("updates", updates_) || is("updatesCombined", updates_)) {
|
|
675
|
-
await this.processChats(updates_.chats);
|
|
676
|
-
await this.processUsers(updates_.users);
|
|
761
|
+
await this.processChats(updates_.chats, updates_);
|
|
762
|
+
await this.processUsers(updates_.users, updates_);
|
|
677
763
|
await __classPrivateFieldGet(this, _UpdateManager_instances, "m", _UpdateManager_setUpdateStateDate).call(this, updates_.date);
|
|
678
764
|
}
|
|
679
765
|
else if (is("updateShort", updates_) ||
|
|
@@ -769,8 +855,8 @@ _a = UpdateManager, _UpdateManager_c = new WeakMap(), _UpdateManager_updateState
|
|
|
769
855
|
}
|
|
770
856
|
}
|
|
771
857
|
if (is("updates.channelDifference", difference)) {
|
|
772
|
-
await this.processChats(difference.chats);
|
|
773
|
-
await this.processUsers(difference.users);
|
|
858
|
+
await this.processChats(difference.chats, difference);
|
|
859
|
+
await this.processUsers(difference.users, difference);
|
|
774
860
|
for (const message of difference.new_messages) {
|
|
775
861
|
await __classPrivateFieldGet(this, _UpdateManager_instances, "m", _UpdateManager_processUpdates).call(this, { _: "updateNewChannelMessage", message, pts: 0, pts_count: 0 }, false);
|
|
776
862
|
}
|
|
@@ -784,8 +870,8 @@ _a = UpdateManager, _UpdateManager_c = new WeakMap(), _UpdateManager_updateState
|
|
|
784
870
|
else if (is("updates.channelDifferenceTooLong", difference)) {
|
|
785
871
|
// TODO: invalidate messages
|
|
786
872
|
__classPrivateFieldGet(this, _UpdateManager_LrecoverChannelUpdateGap, "f").debug("received channelDifferenceTooLong");
|
|
787
|
-
await this.processChats(difference.chats);
|
|
788
|
-
await this.processUsers(difference.users);
|
|
873
|
+
await this.processChats(difference.chats, difference);
|
|
874
|
+
await this.processUsers(difference.users, difference);
|
|
789
875
|
for (const message of difference.messages) {
|
|
790
876
|
await __classPrivateFieldGet(this, _UpdateManager_instances, "m", _UpdateManager_processUpdates).call(this, { _: "updateNewChannelMessage", message, pts: 0, pts_count: 0 }, false);
|
|
791
877
|
}
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
import { Api } from "../2_tl.js";
|
|
21
21
|
import { InputMedia, PollOption, PriceTag } from "../3_types.js";
|
|
22
22
|
import { ChatAction, FileSource, FileType, ID, Message, MessageEntity, ParseMode, Reaction, Update, UsernameResolver } from "../3_types.js";
|
|
23
|
-
import { AddChatMemberParams, AddReactionParams, ApproveJoinRequestsParams, BanChatMemberParams, CreateInviteLinkParams, DeclineJoinRequestsParams, DeleteMessagesParams, EditMessageLiveLocationParams, EditMessageMediaParams, EditMessageParams, EditMessageReplyMarkupParams, ForwardMessagesParams, GetCreatedInviteLinksParams, GetHistoryParams, PinMessageParams, SearchMessagesParams, SendAnimationParams, SendAudioParams, SendChatActionParams, SendContactParams, SendDiceParams, SendDocumentParams, SendInvoiceParams, SendLocationParams, SendMediaGroupParams, SendMessageParams, SendPhotoParams, SendPollParams, SendStickerParams, SendVenueParams, SendVideoNoteParams, SendVideoParams, SendVoiceParams, SetChatMemberRightsParams, SetChatPhotoParams, SetReactionsParams, StopPollParams, UnpinMessageParams } from "./0_params.js";
|
|
23
|
+
import { AddChatMemberParams, AddReactionParams, ApproveJoinRequestsParams, BanChatMemberParams, CreateInviteLinkParams, DeclineJoinRequestsParams, DeleteMessagesParams, EditInlineMessageMediaParams, EditMessageLiveLocationParams, EditMessageMediaParams, EditMessageParams, EditMessageReplyMarkupParams, ForwardMessagesParams, GetCreatedInviteLinksParams, GetHistoryParams, PinMessageParams, SearchMessagesParams, SendAnimationParams, SendAudioParams, SendChatActionParams, SendContactParams, SendDiceParams, SendDocumentParams, SendInvoiceParams, SendLocationParams, SendMediaGroupParams, SendMessageParams, SendPhotoParams, SendPollParams, SendStickerParams, SendVenueParams, SendVideoNoteParams, SendVideoParams, SendVoiceParams, SetChatMemberRightsParams, SetChatPhotoParams, SetReactionsParams, StopPollParams, UnpinMessageParams } from "./0_params.js";
|
|
24
24
|
import { C as C_ } from "./1_types.js";
|
|
25
25
|
import { FileManager } from "./2_file_manager.js";
|
|
26
26
|
interface C extends C_ {
|
|
@@ -70,7 +70,7 @@ export declare class MessageManager {
|
|
|
70
70
|
editMessageText(chatId: ID, messageId: number, text: string, params?: EditMessageParams): Promise<import("../3_types.js").MessageText>;
|
|
71
71
|
editInlineMessageText(inlineMessageId: string, text: string, params?: EditMessageParams): Promise<void>;
|
|
72
72
|
editMessageMedia(chatId: ID, messageId: number, media: InputMedia, params?: EditMessageMediaParams): Promise<Message>;
|
|
73
|
-
editInlineMessageMedia(inlineMessageId: string, media: InputMedia, params?:
|
|
73
|
+
editInlineMessageMedia(inlineMessageId: string, media: InputMedia, params?: EditInlineMessageMediaParams): Promise<void>;
|
|
74
74
|
deleteMessages(chatId: ID, messageIds: number[], params?: DeleteMessagesParams): Promise<void>;
|
|
75
75
|
deleteScheduledMessages(chatId: ID, messageIds: number[]): Promise<void>;
|
|
76
76
|
deleteScheduledMessage(chatId: ID, messageId: number): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"3_message_manager.d.ts","sourceRoot":"","sources":["../../src/client/3_message_manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAKH,OAAO,EAAE,GAAG,EAAmD,MAAM,YAAY,CAAC;AAClF,OAAO,EAA+H,UAAU,EAAE,UAAU,EAAE,QAAQ,EAA+C,MAAM,eAAe,CAAC;AAC3O,OAAO,EAAqB,UAAU,
|
|
1
|
+
{"version":3,"file":"3_message_manager.d.ts","sourceRoot":"","sources":["../../src/client/3_message_manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAKH,OAAO,EAAE,GAAG,EAAmD,MAAM,YAAY,CAAC;AAClF,OAAO,EAA+H,UAAU,EAAE,UAAU,EAAE,QAAQ,EAA+C,MAAM,eAAe,CAAC;AAC3O,O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AAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,MAAM,CAAC,EAAE,iBAAiB;IA4D7I,aAAa,CAAC,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,mBAAmB;IAiBlE,cAAc,CAAC,MAAM,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;IAmBxC,cAAc,CAAC,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE,MAAM,CAAC,EAAE,oBAAoB;CA6DpF"}
|
|
@@ -38,9 +38,7 @@ import { assertMessageType, chatMemberRightsToTlObject, constructMessage as cons
|
|
|
38
38
|
import { messageSearchFilterToTlObject } from "../types/0_message_search_filter.js";
|
|
39
39
|
import { parseHtml } from "./0_html.js";
|
|
40
40
|
import { parseMarkdown } from "./0_markdown.js";
|
|
41
|
-
import { checkMessageId } from "./0_utilities.js";
|
|
42
|
-
import { checkArray } from "./0_utilities.js";
|
|
43
|
-
import { isHttpUrl } from "./0_utilities.js";
|
|
41
|
+
import { canBeInputChannel, canBeInputUser, checkArray, checkMessageId, isHttpUrl, toInputChannel, toInputUser } from "./0_utilities.js";
|
|
44
42
|
const FALLBACK_MIME_TYPE = "application/octet-stream";
|
|
45
43
|
const STICKER_MIME_TYPES = ["image/webp", "video/webm", "application/x-tgsticker"];
|
|
46
44
|
const messageManagerUpdates = [
|
|
@@ -95,8 +93,8 @@ export class MessageManager {
|
|
|
95
93
|
}
|
|
96
94
|
}
|
|
97
95
|
if (shouldFetch) {
|
|
98
|
-
if (
|
|
99
|
-
messages_ = await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke({ _: "channels.getMessages", channel: (
|
|
96
|
+
if (canBeInputChannel(peer)) {
|
|
97
|
+
messages_ = await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke({ _: "channels.getMessages", channel: toInputChannel(peer), id: messageIds.map((v) => ({ _: "inputMessageID", id: v })) }).then((v) => as("messages.channelMessages", v).messages);
|
|
100
98
|
}
|
|
101
99
|
else {
|
|
102
100
|
messages_ = await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke({
|
|
@@ -539,7 +537,12 @@ export class MessageManager {
|
|
|
539
537
|
}
|
|
540
538
|
async editMessageReplyMarkup(chatId, messageId, params) {
|
|
541
539
|
__classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_checkParams).call(this, params);
|
|
542
|
-
const result = await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke({
|
|
540
|
+
const result = await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke({
|
|
541
|
+
_: "messages.editMessage",
|
|
542
|
+
id: checkMessageId(messageId),
|
|
543
|
+
peer: await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(chatId),
|
|
544
|
+
reply_markup: await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_constructReplyMarkup).call(this, params),
|
|
545
|
+
}, params?.businessConnectionId);
|
|
543
546
|
const message_ = (await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_updatesToMessages).call(this, chatId, result))[0];
|
|
544
547
|
return message_;
|
|
545
548
|
}
|
|
@@ -556,7 +559,17 @@ export class MessageManager {
|
|
|
556
559
|
if (!noWebpage && params?.linkPreview?.url) {
|
|
557
560
|
media = { _: "inputMediaWebPage", url: params.linkPreview.url, force_large_media: params.linkPreview.largeMedia ? true : undefined, force_small_media: params.linkPreview.smallMedia ? true : undefined, optional: message.length ? undefined : true };
|
|
558
561
|
}
|
|
559
|
-
const result = await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke({
|
|
562
|
+
const result = await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke({
|
|
563
|
+
_: "messages.editMessage",
|
|
564
|
+
id: checkMessageId(messageId),
|
|
565
|
+
peer: await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(chatId),
|
|
566
|
+
entities,
|
|
567
|
+
message,
|
|
568
|
+
media,
|
|
569
|
+
no_webpage: noWebpage,
|
|
570
|
+
invert_media: invertMedia,
|
|
571
|
+
reply_markup: await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_constructReplyMarkup).call(this, params),
|
|
572
|
+
}, params?.businessConnectionId);
|
|
560
573
|
const message_ = (await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_updatesToMessages).call(this, chatId, result))[0];
|
|
561
574
|
return assertMessageType(message_, "text");
|
|
562
575
|
}
|
|
@@ -590,7 +603,7 @@ export class MessageManager {
|
|
|
590
603
|
reply_markup: await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_constructReplyMarkup).call(this, params),
|
|
591
604
|
message: text,
|
|
592
605
|
entities,
|
|
593
|
-
});
|
|
606
|
+
}, params?.businessConnectionId);
|
|
594
607
|
const message_ = (await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_updatesToMessages).call(this, chatId, result))[0];
|
|
595
608
|
return message_;
|
|
596
609
|
}
|
|
@@ -603,8 +616,8 @@ export class MessageManager {
|
|
|
603
616
|
async deleteMessages(chatId, messageIds, params) {
|
|
604
617
|
checkArray(messageIds, checkMessageId);
|
|
605
618
|
const peer = await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(chatId);
|
|
606
|
-
if (
|
|
607
|
-
await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke({ _: "channels.deleteMessages", channel:
|
|
619
|
+
if (canBeInputChannel(peer)) {
|
|
620
|
+
await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke({ _: "channels.deleteMessages", channel: toInputChannel(peer), id: messageIds });
|
|
608
621
|
}
|
|
609
622
|
else {
|
|
610
623
|
await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke({ _: "messages.deleteMessages", id: messageIds, revoke: params?.onlyForMe ? undefined : true });
|
|
@@ -701,9 +714,19 @@ export class MessageManager {
|
|
|
701
714
|
is("updateNewScheduledMessage", update)) {
|
|
702
715
|
if (!(is("messageEmpty", update.message))) {
|
|
703
716
|
const isOutgoing = update.message.out;
|
|
704
|
-
let shouldIgnore =
|
|
705
|
-
if (
|
|
706
|
-
|
|
717
|
+
let shouldIgnore = false;
|
|
718
|
+
if (isOutgoing) {
|
|
719
|
+
if (__classPrivateFieldGet(this, _MessageManager_c, "f").outgoingMessages == null) {
|
|
720
|
+
__classPrivateFieldGet(this, _MessageManager_c, "f").outgoingMessages = __classPrivateFieldGet(this, _MessageManager_c, "f").storage.accountType == "user" ? "all" : "business";
|
|
721
|
+
}
|
|
722
|
+
if (__classPrivateFieldGet(this, _MessageManager_c, "f").outgoingMessages == "none") {
|
|
723
|
+
shouldIgnore = true;
|
|
724
|
+
}
|
|
725
|
+
else if (__classPrivateFieldGet(this, _MessageManager_c, "f").outgoingMessages == "business") {
|
|
726
|
+
if (!is("updateBotNewBusinessMessage", update) && !is("updateBotEditBusinessMessage", update)) {
|
|
727
|
+
shouldIgnore = true;
|
|
728
|
+
}
|
|
729
|
+
}
|
|
707
730
|
}
|
|
708
731
|
if (!shouldIgnore) {
|
|
709
732
|
const business = "connection_id" in update ? { connectionId: update.connection_id, replyToMessage: update.reply_to_message } : undefined;
|
|
@@ -814,11 +837,11 @@ export class MessageManager {
|
|
|
814
837
|
}
|
|
815
838
|
async deleteChatPhoto(chatId) {
|
|
816
839
|
const peer = await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(chatId);
|
|
817
|
-
if (!(
|
|
840
|
+
if (!(canBeInputChannel(peer)) && !(is("inputPeerChat", peer))) {
|
|
818
841
|
unreachable();
|
|
819
842
|
}
|
|
820
|
-
if (
|
|
821
|
-
await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke({ _: "channels.editPhoto", channel:
|
|
843
|
+
if (canBeInputChannel(peer)) {
|
|
844
|
+
await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke({ _: "channels.editPhoto", channel: toInputChannel(peer), photo: { _: "inputChatPhotoEmpty" } });
|
|
822
845
|
}
|
|
823
846
|
else if (is("inputPeerChat", peer)) {
|
|
824
847
|
await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke({ _: "messages.editChatPhoto", chat_id: peer.chat_id, photo: { _: "inputChatPhotoEmpty" } });
|
|
@@ -826,13 +849,13 @@ export class MessageManager {
|
|
|
826
849
|
}
|
|
827
850
|
async setChatPhoto(chatId, photo, params) {
|
|
828
851
|
const peer = await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(chatId);
|
|
829
|
-
if (!(
|
|
852
|
+
if (!(canBeInputChannel(peer)) && !(is("inputPeerChat", peer))) {
|
|
830
853
|
unreachable();
|
|
831
854
|
}
|
|
832
855
|
const file = await __classPrivateFieldGet(this, _MessageManager_c, "f").fileManager.upload(photo, params);
|
|
833
856
|
const photo_ = { _: "inputChatUploadedPhoto", file };
|
|
834
|
-
if (
|
|
835
|
-
await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke({ _: "channels.editPhoto", channel:
|
|
857
|
+
if (canBeInputChannel(peer)) {
|
|
858
|
+
await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke({ _: "channels.editPhoto", channel: toInputChannel(peer), photo: photo_ });
|
|
836
859
|
}
|
|
837
860
|
else if (is("inputPeerChat", peer)) {
|
|
838
861
|
await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke({ _: "messages.editChatPhoto", chat_id: peer.chat_id, photo: photo_ });
|
|
@@ -872,10 +895,10 @@ export class MessageManager {
|
|
|
872
895
|
});
|
|
873
896
|
}
|
|
874
897
|
else if (is("inputPeerChat", chat)) {
|
|
875
|
-
if (!(
|
|
898
|
+
if (!canBeInputUser(member)) {
|
|
876
899
|
throw new InputError(`Invalid user ID: ${memberId}`);
|
|
877
900
|
}
|
|
878
|
-
await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke({ _: "messages.deleteChatUser", chat_id: chat.chat_id, user_id:
|
|
901
|
+
await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke({ _: "messages.deleteChatUser", chat_id: chat.chat_id, user_id: toInputUser(member), revoke_history: params?.deleteMessages ? true : undefined });
|
|
879
902
|
}
|
|
880
903
|
}
|
|
881
904
|
async unbanChatMember(chatId, memberId) {
|
|
@@ -961,11 +984,11 @@ export class MessageManager {
|
|
|
961
984
|
async joinChat(chatId) {
|
|
962
985
|
__classPrivateFieldGet(this, _MessageManager_c, "f").storage.assertUser("joinChat");
|
|
963
986
|
const peer = await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(chatId);
|
|
964
|
-
if (
|
|
987
|
+
if (canBeInputUser(peer)) {
|
|
965
988
|
throw new InputError("Cannot join private chats.");
|
|
966
989
|
}
|
|
967
|
-
else if (
|
|
968
|
-
await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke({ _: "channels.joinChannel", channel:
|
|
990
|
+
else if (canBeInputChannel(peer)) {
|
|
991
|
+
await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke({ _: "channels.joinChannel", channel: toInputChannel(peer) });
|
|
969
992
|
}
|
|
970
993
|
else if (is("inputPeerChat", peer)) {
|
|
971
994
|
await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke({ _: "messages.addChatUser", chat_id: peer.chat_id, user_id: { _: "inputUserSelf" }, fwd_limit: 0 }); // TODO: use potential high-level method for adding participants to chats
|
|
@@ -976,11 +999,11 @@ export class MessageManager {
|
|
|
976
999
|
}
|
|
977
1000
|
async leaveChat(chatId) {
|
|
978
1001
|
const peer = await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(chatId);
|
|
979
|
-
if (
|
|
1002
|
+
if (canBeInputUser(peer)) {
|
|
980
1003
|
throw new InputError("Cannot leave private chats.");
|
|
981
1004
|
}
|
|
982
|
-
else if (
|
|
983
|
-
await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke({ _: "channels.leaveChannel", channel:
|
|
1005
|
+
else if (canBeInputChannel(peer)) {
|
|
1006
|
+
await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke({ _: "channels.leaveChannel", channel: toInputChannel(peer) });
|
|
984
1007
|
}
|
|
985
1008
|
else if (is("inputPeerChat", peer)) {
|
|
986
1009
|
await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke({ _: "messages.deleteChatUser", chat_id: peer.chat_id, user_id: { _: "inputUserSelf" } }); // TODO: use potential high-level method for adding participants to chats
|
|
@@ -1025,7 +1048,13 @@ export class MessageManager {
|
|
|
1025
1048
|
if (message.poll.isClosed) {
|
|
1026
1049
|
throw new InputError("Poll is already stopped.");
|
|
1027
1050
|
}
|
|
1028
|
-
const result = await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke({
|
|
1051
|
+
const result = await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke({
|
|
1052
|
+
_: "messages.editMessage",
|
|
1053
|
+
peer: await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(chatId),
|
|
1054
|
+
id: messageId,
|
|
1055
|
+
media: ({ _: "inputMediaPoll", poll: ({ _: "poll", id: BigInt(message.poll.id), closed: true, question: { _: "textWithEntities", text: "", entities: [] }, answers: [] }) }),
|
|
1056
|
+
reply_markup: await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_constructReplyMarkup).call(this, params),
|
|
1057
|
+
}, params?.businessConnectionId);
|
|
1029
1058
|
const message_ = (await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_updatesToMessages).call(this, chatId, result))[0];
|
|
1030
1059
|
return assertMessageType(message_, "poll").poll;
|
|
1031
1060
|
}
|
|
@@ -1033,7 +1062,13 @@ export class MessageManager {
|
|
|
1033
1062
|
__classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_checkParams).call(this, params);
|
|
1034
1063
|
const message = await this.getMessage(chatId, messageId);
|
|
1035
1064
|
if (message && "location" in message && message.location.livePeriod) {
|
|
1036
|
-
const result = await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke({
|
|
1065
|
+
const result = await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke({
|
|
1066
|
+
_: "messages.editMessage",
|
|
1067
|
+
peer: await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(chatId),
|
|
1068
|
+
id: messageId,
|
|
1069
|
+
media: ({ _: "inputMediaGeoLive", geo_point: ({ _: "inputGeoPoint", lat: latitude, long: longitude, accuracy_radius: params?.horizontalAccuracy }), heading: params?.heading, proximity_notification_radius: params?.proximityAlertRadius }),
|
|
1070
|
+
reply_markup: await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_constructReplyMarkup).call(this, params),
|
|
1071
|
+
}, params?.businessConnectionId);
|
|
1037
1072
|
const message = (await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_updatesToMessages).call(this, chatId, result))[0];
|
|
1038
1073
|
return assertMessageType(message, "location");
|
|
1039
1074
|
}
|
|
@@ -1129,8 +1164,8 @@ export class MessageManager {
|
|
|
1129
1164
|
if (is("inputPeerChat", chat)) {
|
|
1130
1165
|
throw new InputError("addChatMembers cannot be used with basic groups");
|
|
1131
1166
|
}
|
|
1132
|
-
else if (
|
|
1133
|
-
const result = await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke({ _: "channels.inviteToChannel", channel:
|
|
1167
|
+
else if (canBeInputChannel(chat)) {
|
|
1168
|
+
const result = await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke({ _: "channels.inviteToChannel", channel: toInputChannel(chat), users });
|
|
1134
1169
|
return result.missing_invitees.map(constructFailedInvitation);
|
|
1135
1170
|
}
|
|
1136
1171
|
unreachable();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"3_video_chat_manager.d.ts","sourceRoot":"","sources":["../../src/client/3_video_chat_manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAKH,OAAO,EAAE,GAAG,EAAmB,MAAM,YAAY,CAAC;AAClD,OAAO,EAAkD,EAAE,EAAE,MAAM,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAChI,OAAO,EAAE,6BAA6B,EAAE,mBAAmB,EAAE,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,MAAM,EAAE,sBAAsB,GAAG,OAAO,CAAC,MAAM,CAAC;IA2B7D,qBAAqB,CAAC,EAAE,EAAE,MAAM;IAgB/B,uBAAuB,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,6BAA6B;CAmBrI"}
|
|
@@ -34,6 +34,7 @@ import { InputError } from "../0_errors.js";
|
|
|
34
34
|
import { getRandomId, toUnixTimestamp, ZERO_CHANNEL_ID } from "../1_utilities.js";
|
|
35
35
|
import { as, is, isOneOf } from "../2_tl.js";
|
|
36
36
|
import { constructLiveStreamChannel, constructVideoChat } from "../3_types.js";
|
|
37
|
+
import { canBeInputUser } from "./0_utilities.js";
|
|
37
38
|
const videoChatManagerUpdates = [
|
|
38
39
|
"updateGroupCall",
|
|
39
40
|
];
|
|
@@ -160,7 +161,7 @@ export class VideoChatManager {
|
|
|
160
161
|
}
|
|
161
162
|
_VideoChatManager_c = new WeakMap(), _VideoChatManager_instances = new WeakSet(), _VideoChatManager_createGroupCall = async function _VideoChatManager_createGroupCall(chatId, title, liveStream, scheduleDate) {
|
|
162
163
|
const peer = await __classPrivateFieldGet(this, _VideoChatManager_c, "f").getInputPeer(chatId);
|
|
163
|
-
if (
|
|
164
|
+
if (canBeInputUser(peer)) {
|
|
164
165
|
throw new InputError("Video chats are only available for groups and channels.");
|
|
165
166
|
}
|
|
166
167
|
const { updates } = await __classPrivateFieldGet(this, _VideoChatManager_c, "f").invoke({ _: "phone.createGroupCall", peer, random_id: getRandomId(true), title, rtmp_stream: liveStream, schedule_date: scheduleDate ? toUnixTimestamp(scheduleDate) : undefined }).then((v) => as("updates", v));
|
|
@@ -34,7 +34,7 @@ import { InputError } from "../0_errors.js";
|
|
|
34
34
|
import { getLogger, toUnixTimestamp } from "../1_utilities.js";
|
|
35
35
|
import { as, is, isOneOf, peerToChatId } from "../2_tl.js";
|
|
36
36
|
import { constructChat, constructChatListItem, constructChatListItem3, constructChatListItem4, constructChatMember, getChatListItemOrder } from "../3_types.js";
|
|
37
|
-
import { getChatListId } from "./0_utilities.js";
|
|
37
|
+
import { canBeInputChannel, canBeInputUser, getChatListId, toInputChannel, toInputUser } from "./0_utilities.js";
|
|
38
38
|
const chatListManagerUpdates = [
|
|
39
39
|
"updateNewMessage",
|
|
40
40
|
"updateNewChannelMessage",
|
|
@@ -188,8 +188,8 @@ export class ChatListManager {
|
|
|
188
188
|
}
|
|
189
189
|
async getChatAdministrators(chatId) {
|
|
190
190
|
const peer = await __classPrivateFieldGet(this, _ChatListManager_c, "f").getInputPeer(chatId);
|
|
191
|
-
if (
|
|
192
|
-
const channel =
|
|
191
|
+
if (canBeInputChannel(peer)) {
|
|
192
|
+
const channel = toInputChannel(peer);
|
|
193
193
|
const participants = await __classPrivateFieldGet(this, _ChatListManager_c, "f").invoke({ _: "channels.getParticipants", channel, filter: { _: "channelParticipantsAdmins" }, offset: 0, limit: 100, hash: 0n });
|
|
194
194
|
if (is("channels.channelParticipantsNotModified", participants)) {
|
|
195
195
|
unreachable();
|
|
@@ -217,8 +217,8 @@ export class ChatListManager {
|
|
|
217
217
|
}
|
|
218
218
|
async getChatMember(chatId, userId) {
|
|
219
219
|
const peer = await __classPrivateFieldGet(this, _ChatListManager_c, "f").getInputPeer(chatId);
|
|
220
|
-
if (
|
|
221
|
-
const { participant } = await __classPrivateFieldGet(this, _ChatListManager_c, "f").invoke({ _: "channels.getParticipant", channel:
|
|
220
|
+
if (canBeInputChannel(peer)) {
|
|
221
|
+
const { participant } = await __classPrivateFieldGet(this, _ChatListManager_c, "f").invoke({ _: "channels.getParticipant", channel: toInputChannel(peer), participant: await __classPrivateFieldGet(this, _ChatListManager_c, "f").getInputPeer(userId) });
|
|
222
222
|
return await constructChatMember(participant, __classPrivateFieldGet(this, _ChatListManager_c, "f").getEntity);
|
|
223
223
|
}
|
|
224
224
|
else if (is("inputPeerChat", peer)) {
|
|
@@ -233,8 +233,8 @@ export class ChatListManager {
|
|
|
233
233
|
}
|
|
234
234
|
async getChatMembers(chatId, params) {
|
|
235
235
|
const peer = await __classPrivateFieldGet(this, _ChatListManager_c, "f").getInputPeer(chatId);
|
|
236
|
-
if (
|
|
237
|
-
const channel =
|
|
236
|
+
if (canBeInputChannel(peer)) {
|
|
237
|
+
const channel = toInputChannel(peer);
|
|
238
238
|
const participants = await __classPrivateFieldGet(this, _ChatListManager_c, "f").invoke({ _: "channels.getParticipants", channel, filter: { _: "channelParticipantsRecent" }, offset: params?.offset ?? 0, limit: params?.limit ?? 100, hash: 0n });
|
|
239
239
|
if (is("channels.channelParticipantsNotModified", participants)) {
|
|
240
240
|
unreachable();
|
|
@@ -499,14 +499,14 @@ _ChatListManager_c = new WeakMap(), _ChatListManager_LgetChats = new WeakMap(),
|
|
|
499
499
|
if (fullChat != null) {
|
|
500
500
|
return fullChat;
|
|
501
501
|
}
|
|
502
|
-
if (
|
|
503
|
-
fullChat = (await __classPrivateFieldGet(this, _ChatListManager_c, "f").invoke({ _: "users.getFullUser", id:
|
|
502
|
+
if (canBeInputUser(inputPeer)) {
|
|
503
|
+
fullChat = (await __classPrivateFieldGet(this, _ChatListManager_c, "f").invoke({ _: "users.getFullUser", id: toInputUser(inputPeer) })).full_user;
|
|
504
504
|
}
|
|
505
505
|
else if (is("inputPeerChat", inputPeer)) {
|
|
506
506
|
fullChat = (await __classPrivateFieldGet(this, _ChatListManager_c, "f").invoke({ ...inputPeer, _: "messages.getFullChat" })).full_chat;
|
|
507
507
|
}
|
|
508
|
-
else if (
|
|
509
|
-
fullChat = (await __classPrivateFieldGet(this, _ChatListManager_c, "f").invoke({ _: "channels.getFullChannel", channel:
|
|
508
|
+
else if (canBeInputChannel(inputPeer)) {
|
|
509
|
+
fullChat = (await __classPrivateFieldGet(this, _ChatListManager_c, "f").invoke({ _: "channels.getFullChannel", channel: toInputChannel(inputPeer) })).full_chat;
|
|
510
510
|
}
|
|
511
511
|
await __classPrivateFieldGet(this, _ChatListManager_c, "f").storage.setFullChat(chatId_, fullChat);
|
|
512
512
|
if (fullChat != null && "call" in fullChat && fullChat.call) {
|