shellzapy 0.1.0__py3-none-any.whl
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.
- shellzapy-0.1.0.dist-info/METADATA +112 -0
- shellzapy-0.1.0.dist-info/RECORD +345 -0
- shellzapy-0.1.0.dist-info/WHEEL +4 -0
- shellzapy-0.1.0.dist-info/licenses/LICENSE +21 -0
- shellzapy-0.1.0.dist-info/licenses/NOTICE +9 -0
- zapy/__init__.py +58 -0
- zapy/_appstate/__init__.py +59 -0
- zapy/_appstate/constants.py +82 -0
- zapy/_appstate/crypto/__init__.py +17 -0
- zapy/_appstate/crypto/app_state_crypto.py +401 -0
- zapy/_appstate/parsers/__init__.py +23 -0
- zapy/_appstate/parsers/encoding.py +157 -0
- zapy/_appstate/parsers/response_parser.py +135 -0
- zapy/_appstate/sync/__init__.py +11 -0
- zapy/_appstate/sync/sync_client.py +1559 -0
- zapy/_appstate/types.py +137 -0
- zapy/_appstate/utils.py +100 -0
- zapy/_auth/__init__.py +3 -0
- zapy/_auth/auth_client.py +618 -0
- zapy/_auth/credentials_flow.py +290 -0
- zapy/_auth/pairing/__init__.py +3 -0
- zapy/_auth/pairing/companion_host.py +239 -0
- zapy/_auth/pairing/flow.py +808 -0
- zapy/_auth/pairing/pairing_code_crypto.py +143 -0
- zapy/_auth/pairing/qr_flow.py +123 -0
- zapy/_auth/pairing/shortcake_crypto.py +122 -0
- zapy/_auth/pairing/shortcake_flow.py +393 -0
- zapy/_auth/types.py +110 -0
- zapy/_client/__init__.py +26 -0
- zapy/_client/client.py +972 -0
- zapy/_client/connection/__init__.py +6 -0
- zapy/_client/connection/manager.py +525 -0
- zapy/_client/connection/receipt_queue.py +74 -0
- zapy/_client/coordinators/__init__.py +81 -0
- zapy/_client/coordinators/ab_props.py +260 -0
- zapy/_client/coordinators/app_state_mutation.py +2538 -0
- zapy/_client/coordinators/bot.py +830 -0
- zapy/_client/coordinators/broadcast_list.py +101 -0
- zapy/_client/coordinators/business.py +247 -0
- zapy/_client/coordinators/email.py +158 -0
- zapy/_client/coordinators/group.py +1478 -0
- zapy/_client/coordinators/incoming_node.py +758 -0
- zapy/_client/coordinators/low_level.py +119 -0
- zapy/_client/coordinators/message.py +1153 -0
- zapy/_client/coordinators/message_dispatch.py +1637 -0
- zapy/_client/coordinators/newsletter.py +110 -0
- zapy/_client/coordinators/offline_resume.py +271 -0
- zapy/_client/coordinators/passive_tasks.py +447 -0
- zapy/_client/coordinators/presence.py +103 -0
- zapy/_client/coordinators/privacy.py +623 -0
- zapy/_client/coordinators/profile.py +1024 -0
- zapy/_client/coordinators/retry.py +1878 -0
- zapy/_client/coordinators/status.py +132 -0
- zapy/_client/coordinators/stream_control.py +260 -0
- zapy/_client/coordinators/trusted_contact_token.py +417 -0
- zapy/_client/events/__init__.py +266 -0
- zapy/_client/events/abprops.py +58 -0
- zapy/_client/events/appstate_mutation.py +248 -0
- zapy/_client/events/business.py +565 -0
- zapy/_client/events/call.py +144 -0
- zapy/_client/events/chatstate.py +41 -0
- zapy/_client/events/devices.py +122 -0
- zapy/_client/events/dirty.py +384 -0
- zapy/_client/events/group.py +655 -0
- zapy/_client/events/identity.py +40 -0
- zapy/_client/events/incoming.py +1079 -0
- zapy/_client/events/mex_notification.py +317 -0
- zapy/_client/events/offline.py +123 -0
- zapy/_client/events/picture.py +67 -0
- zapy/_client/events/presence.py +74 -0
- zapy/_client/events/privacy.py +187 -0
- zapy/_client/events/privacy_token.py +72 -0
- zapy/_client/events/receipt.py +109 -0
- zapy/_client/events/registration.py +70 -0
- zapy/_client/events/username.py +76 -0
- zapy/_client/factory.py +2020 -0
- zapy/_client/media.py +829 -0
- zapy/_client/newsletter/__init__.py +90 -0
- zapy/_client/newsletter/admin.py +323 -0
- zapy/_client/newsletter/content.py +499 -0
- zapy/_client/newsletter/discovery.py +233 -0
- zapy/_client/newsletter/messaging.py +396 -0
- zapy/_client/newsletter/mex.py +99 -0
- zapy/_client/newsletter/parse.py +406 -0
- zapy/_client/newsletter/types.py +393 -0
- zapy/_client/persistence/__init__.py +89 -0
- zapy/_client/persistence/companion_host.py +133 -0
- zapy/_client/persistence/ephemeral_setting.py +245 -0
- zapy/_client/persistence/group_history.py +361 -0
- zapy/_client/persistence/history_blob.py +169 -0
- zapy/_client/persistence/history_sync.py +646 -0
- zapy/_client/persistence/mailbox.py +232 -0
- zapy/_client/persistence/write_behind_persistence.py +368 -0
- zapy/_client/plugins/__init__.py +23 -0
- zapy/_client/plugins/define.py +44 -0
- zapy/_client/plugins/install.py +254 -0
- zapy/_client/plugins/types.py +64 -0
- zapy/_client/tokens/__init__.py +21 -0
- zapy/_client/tokens/cs_token.py +47 -0
- zapy/_client/tokens/tc_token.py +43 -0
- zapy/_client/types.py +988 -0
- zapy/_crypto/__init__.py +65 -0
- zapy/_crypto/core/__init__.py +62 -0
- zapy/_crypto/core/hkdf.py +41 -0
- zapy/_crypto/core/keys.py +51 -0
- zapy/_crypto/core/nonce.py +25 -0
- zapy/_crypto/core/primitives.py +179 -0
- zapy/_crypto/core/random.py +32 -0
- zapy/_crypto/core/xeddsa.py +72 -0
- zapy/_crypto/curves/__init__.py +3 -0
- zapy/_crypto/curves/constants.py +10 -0
- zapy/_crypto/curves/ed25519.py +61 -0
- zapy/_crypto/curves/types.py +18 -0
- zapy/_crypto/curves/x25519.py +117 -0
- zapy/_crypto/math/__init__.py +3 -0
- zapy/_crypto/math/constants.py +35 -0
- zapy/_crypto/math/edwards.py +174 -0
- zapy/_crypto/math/fe.py +120 -0
- zapy/_crypto/math/le.py +13 -0
- zapy/_crypto/math/mod.py +15 -0
- zapy/_crypto/math/prime.py +11 -0
- zapy/_crypto/math/types.py +25 -0
- zapy/_crypto/native_backend.py +40 -0
- zapy/_infra/__init__.py +3 -0
- zapy/_infra/log.py +142 -0
- zapy/_infra/perf.py +77 -0
- zapy/_media/__init__.py +64 -0
- zapy/_media/constants.py +133 -0
- zapy/_media/container.py +110 -0
- zapy/_media/crypto/__init__.py +19 -0
- zapy/_media/crypto/crypto.py +633 -0
- zapy/_media/crypto/media_retry.py +107 -0
- zapy/_media/processor.py +100 -0
- zapy/_media/sticker/__init__.py +8 -0
- zapy/_media/sticker/pack.py +188 -0
- zapy/_media/transfer/__init__.py +15 -0
- zapy/_media/transfer/client.py +635 -0
- zapy/_media/transfer/conn.py +48 -0
- zapy/_media/types.py +169 -0
- zapy/_message/__init__.py +121 -0
- zapy/_message/addons/__init__.py +5 -0
- zapy/_message/addons/link_preview/__init__.py +54 -0
- zapy/_message/addons/link_preview/builder.py +56 -0
- zapy/_message/addons/link_preview/detect.py +72 -0
- zapy/_message/addons/link_preview/fetcher.py +553 -0
- zapy/_message/addons/link_preview/types.py +100 -0
- zapy/_message/client.py +486 -0
- zapy/_message/context_info.py +424 -0
- zapy/_message/crypto/__init__.py +71 -0
- zapy/_message/crypto/addon_crypto.py +656 -0
- zapy/_message/crypto/icdc.py +138 -0
- zapy/_message/crypto/phash.py +87 -0
- zapy/_message/crypto/reporting_token.py +498 -0
- zapy/_message/crypto/use_case_secret.py +113 -0
- zapy/_message/encode/__init__.py +84 -0
- zapy/_message/encode/content.py +636 -0
- zapy/_message/encode/device_sent.py +88 -0
- zapy/_message/encode/media_payload.py +122 -0
- zapy/_message/encode/padding.py +27 -0
- zapy/_message/kinds/__init__.py +1 -0
- zapy/_message/kinds/bot.py +179 -0
- zapy/_message/kinds/group_history.py +206 -0
- zapy/_message/kinds/newsletter.py +388 -0
- zapy/_message/kinds/sticker_pack.py +74 -0
- zapy/_message/messaging/__init__.py +336 -0
- zapy/_message/messaging/companion_host.py +117 -0
- zapy/_message/messaging/fanout.py +311 -0
- zapy/_message/messaging/group_metadata.py +444 -0
- zapy/_message/messaging/ignore_key.py +264 -0
- zapy/_message/messaging/key_protocol.py +217 -0
- zapy/_message/messaging/link_preview.py +448 -0
- zapy/_message/messaging/messages.py +1429 -0
- zapy/_message/primitives/__init__.py +1 -0
- zapy/_message/primitives/ack.py +232 -0
- zapy/_message/primitives/incoming.py +1141 -0
- zapy/_message/primitives/media_retry.py +451 -0
- zapy/_message/primitives/peer_data_operation.py +271 -0
- zapy/_message/types.py +434 -0
- zapy/_proto/WAProto_pb2.py +2584 -0
- zapy/_proto/__init__.py +1 -0
- zapy/_protocol/__init__.py +3 -0
- zapy/_protocol/abprops_spec.py +6216 -0
- zapy/_protocol/auth.py +17 -0
- zapy/_protocol/browser.py +57 -0
- zapy/_protocol/defaults.py +38 -0
- zapy/_protocol/device_identity.py +54 -0
- zapy/_protocol/jid.py +241 -0
- zapy/_protocol/message.py +127 -0
- zapy/_protocol/nodes.py +144 -0
- zapy/_protocol/notification.py +18 -0
- zapy/_retry/__init__.py +77 -0
- zapy/_retry/codec.py +209 -0
- zapy/_retry/constants.py +28 -0
- zapy/_retry/parse.py +132 -0
- zapy/_retry/reason.py +65 -0
- zapy/_retry/replay.py +483 -0
- zapy/_retry/tracker.py +161 -0
- zapy/_retry/types.py +122 -0
- zapy/_signal/__init__.py +171 -0
- zapy/_signal/api/__init__.py +133 -0
- zapy/_signal/api/codec.py +164 -0
- zapy/_signal/api/constants.py +14 -0
- zapy/_signal/api/device_sync.py +915 -0
- zapy/_signal/api/digest_sync.py +363 -0
- zapy/_signal/api/identity_sync.py +250 -0
- zapy/_signal/api/missing_pre_keys_sync.py +267 -0
- zapy/_signal/api/prekeys.py +191 -0
- zapy/_signal/api/result_map.py +40 -0
- zapy/_signal/api/rotate_key.py +111 -0
- zapy/_signal/api/session_sync.py +297 -0
- zapy/_signal/attestation.py +145 -0
- zapy/_signal/constants.py +22 -0
- zapy/_signal/encoding.py +78 -0
- zapy/_signal/group/__init__.py +35 -0
- zapy/_signal/group/chain.py +139 -0
- zapy/_signal/group/codec.py +78 -0
- zapy/_signal/group/encoding.py +166 -0
- zapy/_signal/group/manager.py +361 -0
- zapy/_signal/registration/__init__.py +44 -0
- zapy/_signal/registration/keygen.py +46 -0
- zapy/_signal/registration/reg_encoding.py +66 -0
- zapy/_signal/registration/reg_utils.py +52 -0
- zapy/_signal/session/__init__.py +114 -0
- zapy/_signal/session/encoding.py +385 -0
- zapy/_signal/session/protocol.py +590 -0
- zapy/_signal/session/ratchet.py +381 -0
- zapy/_signal/session/resolver.py +630 -0
- zapy/_signal/session/serializer.py +96 -0
- zapy/_signal/session/session.py +272 -0
- zapy/_signal/types.py +214 -0
- zapy/_store/__init__.py +118 -0
- zapy/_store/cache/__init__.py +166 -0
- zapy/_store/cache/identity.py +130 -0
- zapy/_store/cache/privacy_token.py +116 -0
- zapy/_store/cache/sender_key.py +168 -0
- zapy/_store/cache/session.py +142 -0
- zapy/_store/contracts/__init__.py +84 -0
- zapy/_store/contracts/appstate.py +82 -0
- zapy/_store/contracts/auth.py +16 -0
- zapy/_store/contracts/chat_metadata.py +29 -0
- zapy/_store/contracts/contact.py +31 -0
- zapy/_store/contracts/device_list.py +35 -0
- zapy/_store/contracts/group_metadata.py +33 -0
- zapy/_store/contracts/identity.py +18 -0
- zapy/_store/contracts/message.py +36 -0
- zapy/_store/contracts/message_secret.py +41 -0
- zapy/_store/contracts/pre_key.py +32 -0
- zapy/_store/contracts/privacy_token.py +32 -0
- zapy/_store/contracts/retry.py +47 -0
- zapy/_store/contracts/sender_key.py +37 -0
- zapy/_store/contracts/session.py +21 -0
- zapy/_store/contracts/signal.py +23 -0
- zapy/_store/contracts/thread.py +35 -0
- zapy/_store/create_store.py +890 -0
- zapy/_store/locks.py +1154 -0
- zapy/_store/memory/__init__.py +40 -0
- zapy/_store/memory/appstate.py +200 -0
- zapy/_store/memory/auth.py +24 -0
- zapy/_store/memory/chat_metadata.py +124 -0
- zapy/_store/memory/contact.py +125 -0
- zapy/_store/memory/device_list.py +161 -0
- zapy/_store/memory/group_metadata.py +125 -0
- zapy/_store/memory/identity.py +86 -0
- zapy/_store/memory/message.py +85 -0
- zapy/_store/memory/message_secret.py +145 -0
- zapy/_store/memory/pre_key.py +112 -0
- zapy/_store/memory/privacy_token.py +103 -0
- zapy/_store/memory/retry.py +250 -0
- zapy/_store/memory/sender_key.py +162 -0
- zapy/_store/memory/session.py +111 -0
- zapy/_store/memory/signal.py +45 -0
- zapy/_store/memory/thread.py +66 -0
- zapy/_store/noop.py +279 -0
- zapy/_transport/__init__.py +3 -0
- zapy/_transport/binary/__init__.py +77 -0
- zapy/_transport/binary/constants.py +80 -0
- zapy/_transport/binary/decoder.py +260 -0
- zapy/_transport/binary/encoder.py +279 -0
- zapy/_transport/binary/tokens.py +1289 -0
- zapy/_transport/comms.py +759 -0
- zapy/_transport/keepalive/__init__.py +3 -0
- zapy/_transport/keepalive/keep_alive.py +252 -0
- zapy/_transport/node/__init__.py +3 -0
- zapy/_transport/node/builders/__init__.py +9 -0
- zapy/_transport/node/builders/abprops.py +33 -0
- zapy/_transport/node/builders/account_sync.py +120 -0
- zapy/_transport/node/builders/bot.py +56 -0
- zapy/_transport/node/builders/business.py +261 -0
- zapy/_transport/node/builders/chatstate.py +74 -0
- zapy/_transport/node/builders/community.py +116 -0
- zapy/_transport/node/builders/device.py +30 -0
- zapy/_transport/node/builders/email.py +181 -0
- zapy/_transport/node/builders/global_.py +74 -0
- zapy/_transport/node/builders/group.py +279 -0
- zapy/_transport/node/builders/media.py +21 -0
- zapy/_transport/node/builders/message.py +436 -0
- zapy/_transport/node/builders/mobile.py +227 -0
- zapy/_transport/node/builders/newsletter.py +293 -0
- zapy/_transport/node/builders/offline.py +20 -0
- zapy/_transport/node/builders/pairing.py +130 -0
- zapy/_transport/node/builders/passive.py +28 -0
- zapy/_transport/node/builders/prekeys.py +215 -0
- zapy/_transport/node/builders/presence.py +100 -0
- zapy/_transport/node/builders/privacy.py +243 -0
- zapy/_transport/node/builders/privacy_token.py +94 -0
- zapy/_transport/node/builders/profile.py +176 -0
- zapy/_transport/node/builders/retry.py +156 -0
- zapy/_transport/node/builders/shortcake.py +87 -0
- zapy/_transport/node/builders/tos.py +92 -0
- zapy/_transport/node/builders/usync.py +185 -0
- zapy/_transport/node/helpers.py +201 -0
- zapy/_transport/node/orchestrator.py +210 -0
- zapy/_transport/node/query.py +82 -0
- zapy/_transport/node/transport.py +105 -0
- zapy/_transport/node/usync.py +33 -0
- zapy/_transport/node/xml.py +38 -0
- zapy/_transport/noise/__init__.py +7 -0
- zapy/_transport/noise/cert.py +85 -0
- zapy/_transport/noise/client_payload.py +344 -0
- zapy/_transport/noise/constants.py +12 -0
- zapy/_transport/noise/frame_codec.py +120 -0
- zapy/_transport/noise/handshake.py +92 -0
- zapy/_transport/noise/session.py +493 -0
- zapy/_transport/noise/socket.py +45 -0
- zapy/_transport/noise/types.py +66 -0
- zapy/_transport/noise/version.json +3 -0
- zapy/_transport/proxy.py +35 -0
- zapy/_transport/types.py +19 -0
- zapy/_transport/wa_version_fetcher.py +159 -0
- zapy/_transport/web_socket.py +602 -0
- zapy/_util/__init__.py +3 -0
- zapy/_util/bytes.py +131 -0
- zapy/_util/coercion.py +29 -0
- zapy/_util/collections.py +45 -0
- zapy/_util/primitives.py +49 -0
- zapy/client.py +840 -0
- zapy/errors.py +148 -0
- zapy/events.py +564 -0
- zapy/jid.py +140 -0
- zapy/py.typed +0 -0
- zapy/stores/__init__.py +50 -0
- zapy/stores/base.py +1627 -0
- zapy/stores/json_file.py +359 -0
- zapy/stores/memory.py +322 -0
- zapy/stores/sqlite.py +343 -0
|
@@ -0,0 +1,447 @@
|
|
|
1
|
+
"""Passive post-connect tasks coordinator (mirrors ``WaPassiveTasksCoordinator``)."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import asyncio
|
|
6
|
+
import time
|
|
7
|
+
from collections.abc import Callable, Sequence
|
|
8
|
+
from dataclasses import dataclass
|
|
9
|
+
from typing import Any, Protocol
|
|
10
|
+
|
|
11
|
+
from zapy._auth.types import WaAuthCredentials
|
|
12
|
+
from zapy._infra.log import Logger
|
|
13
|
+
from zapy._protocol import defaults as _defaults
|
|
14
|
+
from zapy._protocol.nodes import WA_IQ_TYPES
|
|
15
|
+
from zapy._signal.api.constants import (
|
|
16
|
+
SIGNAL_SIGNED_PREKEY_ROTATION_INTERVAL_MS,
|
|
17
|
+
SIGNAL_SIGNED_PREKEY_SERVER_ERROR_BACKOFF_MS,
|
|
18
|
+
SIGNAL_UPLOAD_PREKEYS_COUNT,
|
|
19
|
+
)
|
|
20
|
+
from zapy._signal.api.digest_sync import (
|
|
21
|
+
SignalDigestPrefetchedLocalKeyBundle,
|
|
22
|
+
SignalDigestValidationResult,
|
|
23
|
+
)
|
|
24
|
+
from zapy._signal.api.prekeys import (
|
|
25
|
+
build_pre_key_upload_iq,
|
|
26
|
+
parse_pre_key_upload_failure,
|
|
27
|
+
)
|
|
28
|
+
from zapy._signal.api.rotate_key import SignalRotateKeyResult
|
|
29
|
+
from zapy._signal.registration.keygen import generate_pre_key_pair
|
|
30
|
+
from zapy._store.contracts.pre_key import WaPreKeyStore
|
|
31
|
+
from zapy._store.contracts.signal import WaSignalStore
|
|
32
|
+
from zapy._transport.node.builders.passive import build_passive_mode_iq_node
|
|
33
|
+
from zapy._transport.types import BinaryNode
|
|
34
|
+
from zapy._util.primitives import to_error
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
@dataclass(frozen=True, slots=True)
|
|
38
|
+
class WaPassiveQueryOptions:
|
|
39
|
+
"""Extra routing flags for a passive-tasks IQ (verbatim ``useSystemId``)."""
|
|
40
|
+
|
|
41
|
+
use_system_id: bool = False
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
class WaPassiveTasksRuntime(Protocol):
|
|
45
|
+
"""Transport callbacks the coordinator needs (mirrors the TS runtime)."""
|
|
46
|
+
|
|
47
|
+
async def query_with_context(
|
|
48
|
+
self,
|
|
49
|
+
context: str,
|
|
50
|
+
node: BinaryNode,
|
|
51
|
+
timeout_ms: float | None = None,
|
|
52
|
+
context_data: dict[str, Any] | None = None,
|
|
53
|
+
options: WaPassiveQueryOptions | None = None,
|
|
54
|
+
) -> BinaryNode: ...
|
|
55
|
+
|
|
56
|
+
def get_current_credentials(self) -> WaAuthCredentials | None: ...
|
|
57
|
+
|
|
58
|
+
async def persist_server_has_pre_keys(self, value: bool) -> None: ...
|
|
59
|
+
|
|
60
|
+
async def send_node_direct(self, node: BinaryNode) -> None: ...
|
|
61
|
+
|
|
62
|
+
def take_dangling_receipts(self) -> Sequence[BinaryNode]: ...
|
|
63
|
+
|
|
64
|
+
def requeue_dangling_receipt(self, node: BinaryNode) -> None: ...
|
|
65
|
+
|
|
66
|
+
def should_queue_dangling_receipt(
|
|
67
|
+
self, node: BinaryNode, error: Exception
|
|
68
|
+
) -> bool: ...
|
|
69
|
+
|
|
70
|
+
def sync_ab_props(self) -> None: ...
|
|
71
|
+
|
|
72
|
+
async def send_initial_presence(self) -> None: ...
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
class WaPassiveDigestSync(Protocol):
|
|
76
|
+
"""Digest validation surface ``WaPassiveTasksCoordinator`` consumes."""
|
|
77
|
+
|
|
78
|
+
async def validate_local_key_bundle(
|
|
79
|
+
self,
|
|
80
|
+
prefetched: SignalDigestPrefetchedLocalKeyBundle | None = None,
|
|
81
|
+
) -> SignalDigestValidationResult: ...
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
class WaPassiveRotateKey(Protocol):
|
|
85
|
+
"""Signed-pre-key rotation surface ``WaPassiveTasksCoordinator`` consumes."""
|
|
86
|
+
|
|
87
|
+
async def rotate_signed_pre_key(
|
|
88
|
+
self, timeout_ms: float | None = None
|
|
89
|
+
) -> SignalRotateKeyResult: ...
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
class WaPassiveAppStateSync(Protocol):
|
|
93
|
+
"""Initial-sync-key surface ``WaPassiveTasksCoordinator`` consumes."""
|
|
94
|
+
|
|
95
|
+
async def ensure_initial_sync_key(self) -> object: ...
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
class WaPassiveTasksCoordinator:
|
|
99
|
+
"""Runs the fire-and-forget post-connect pipeline (prekeys, digest, receipts)."""
|
|
100
|
+
|
|
101
|
+
def __init__(
|
|
102
|
+
self,
|
|
103
|
+
*,
|
|
104
|
+
logger: Logger,
|
|
105
|
+
signal_store: WaSignalStore,
|
|
106
|
+
pre_key_store: WaPreKeyStore,
|
|
107
|
+
signal_digest_sync: WaPassiveDigestSync,
|
|
108
|
+
signal_rotate_key: WaPassiveRotateKey,
|
|
109
|
+
runtime: WaPassiveTasksRuntime,
|
|
110
|
+
signed_pre_key_rotation_interval_ms: int | None = None,
|
|
111
|
+
signed_pre_key_server_error_backoff_ms: int | None = None,
|
|
112
|
+
mobile_primary: Callable[[], bool] | None = None,
|
|
113
|
+
app_state_sync: WaPassiveAppStateSync | None = None,
|
|
114
|
+
) -> None:
|
|
115
|
+
self._logger = logger
|
|
116
|
+
self._signal_store = signal_store
|
|
117
|
+
self._pre_key_store = pre_key_store
|
|
118
|
+
self._signal_digest_sync = signal_digest_sync
|
|
119
|
+
self._signal_rotate_key = signal_rotate_key
|
|
120
|
+
self._signed_pre_key_rotation_interval_ms = (
|
|
121
|
+
signed_pre_key_rotation_interval_ms
|
|
122
|
+
if signed_pre_key_rotation_interval_ms is not None
|
|
123
|
+
else SIGNAL_SIGNED_PREKEY_ROTATION_INTERVAL_MS
|
|
124
|
+
)
|
|
125
|
+
self._signed_pre_key_server_error_backoff_ms = (
|
|
126
|
+
signed_pre_key_server_error_backoff_ms
|
|
127
|
+
if signed_pre_key_server_error_backoff_ms is not None
|
|
128
|
+
else SIGNAL_SIGNED_PREKEY_SERVER_ERROR_BACKOFF_MS
|
|
129
|
+
)
|
|
130
|
+
self._runtime = runtime
|
|
131
|
+
self._mobile_primary = (
|
|
132
|
+
mobile_primary if mobile_primary is not None else (lambda: False)
|
|
133
|
+
)
|
|
134
|
+
self._app_state_sync = app_state_sync
|
|
135
|
+
self._passive_tasks_future: asyncio.Task[None] | None = None
|
|
136
|
+
|
|
137
|
+
def start_passive_tasks_after_connect(self) -> None:
|
|
138
|
+
"""Kick off the post-connect pipeline unless one is already running."""
|
|
139
|
+
if self._passive_tasks_future is not None:
|
|
140
|
+
self._logger.trace("passive connect tasks already running")
|
|
141
|
+
return
|
|
142
|
+
|
|
143
|
+
async def _run() -> None:
|
|
144
|
+
try:
|
|
145
|
+
await self._run_passive_tasks_after_connect()
|
|
146
|
+
except Exception as error:
|
|
147
|
+
normalized = to_error(error)
|
|
148
|
+
message = str(normalized.args[0]) if normalized.args else ""
|
|
149
|
+
self._logger.warn("passive connect tasks failed", {"message": message})
|
|
150
|
+
finally:
|
|
151
|
+
self._passive_tasks_future = None
|
|
152
|
+
|
|
153
|
+
self._passive_tasks_future = asyncio.get_running_loop().create_task(_run())
|
|
154
|
+
|
|
155
|
+
async def handle_pre_key_low_notification(self) -> None:
|
|
156
|
+
"""Mark the server as out of prekeys and upload a fresh batch."""
|
|
157
|
+
await asyncio.gather(
|
|
158
|
+
self._pre_key_store.set_server_has_pre_keys(False),
|
|
159
|
+
self._runtime.persist_server_has_pre_keys(False),
|
|
160
|
+
)
|
|
161
|
+
await self._upload_pre_keys_if_missing(False)
|
|
162
|
+
|
|
163
|
+
async def handle_digest_notification(self) -> None:
|
|
164
|
+
"""Re-validate the digest and recover prekeys when it no longer matches."""
|
|
165
|
+
await self._validate_digest_and_recover_pre_keys()
|
|
166
|
+
|
|
167
|
+
def reset_in_flight_state(self) -> None:
|
|
168
|
+
"""Note a requested reset while a run is still in flight (trace only)."""
|
|
169
|
+
if self._passive_tasks_future is None:
|
|
170
|
+
return
|
|
171
|
+
self._logger.trace(
|
|
172
|
+
"passive connect tasks reset requested while run is still in-flight"
|
|
173
|
+
)
|
|
174
|
+
|
|
175
|
+
async def _run_passive_tasks_after_connect(self) -> None:
|
|
176
|
+
credentials = self._runtime.get_current_credentials()
|
|
177
|
+
if credentials is None or not credentials.me_jid:
|
|
178
|
+
self._logger.trace(
|
|
179
|
+
"passive connect tasks skipped: session is not registered"
|
|
180
|
+
)
|
|
181
|
+
return
|
|
182
|
+
|
|
183
|
+
self._runtime.sync_ab_props()
|
|
184
|
+
|
|
185
|
+
if self._mobile_primary() and self._app_state_sync is not None:
|
|
186
|
+
try:
|
|
187
|
+
await self._app_state_sync.ensure_initial_sync_key()
|
|
188
|
+
except Exception as error:
|
|
189
|
+
normalized = to_error(error)
|
|
190
|
+
message = str(normalized.args[0]) if normalized.args else ""
|
|
191
|
+
self._logger.warn(
|
|
192
|
+
"app-state initial key generation failed", {"message": message}
|
|
193
|
+
)
|
|
194
|
+
|
|
195
|
+
try:
|
|
196
|
+
await self._runtime.send_initial_presence()
|
|
197
|
+
except Exception as error:
|
|
198
|
+
normalized = to_error(error)
|
|
199
|
+
message = str(normalized.args[0]) if normalized.args else ""
|
|
200
|
+
self._logger.warn("initial presence send failed", {"message": message})
|
|
201
|
+
|
|
202
|
+
(
|
|
203
|
+
registration_info,
|
|
204
|
+
signed_pre_key,
|
|
205
|
+
server_has_pre_keys,
|
|
206
|
+
rotation_ts,
|
|
207
|
+
) = await asyncio.gather(
|
|
208
|
+
self._signal_store.get_registration_info(),
|
|
209
|
+
self._signal_store.get_signed_pre_key(),
|
|
210
|
+
self._pre_key_store.get_server_has_pre_keys(),
|
|
211
|
+
self._signal_store.get_signed_pre_key_rotation_ts(),
|
|
212
|
+
)
|
|
213
|
+
prefetched: SignalDigestPrefetchedLocalKeyBundle | None = (
|
|
214
|
+
SignalDigestPrefetchedLocalKeyBundle(
|
|
215
|
+
registration_info=registration_info,
|
|
216
|
+
signed_pre_key=signed_pre_key,
|
|
217
|
+
)
|
|
218
|
+
if registration_info is not None and signed_pre_key is not None
|
|
219
|
+
else None
|
|
220
|
+
)
|
|
221
|
+
await self._upload_pre_keys_if_missing(server_has_pre_keys, prefetched)
|
|
222
|
+
await self._validate_digest_and_recover_pre_keys(prefetched)
|
|
223
|
+
await self._rotate_signed_pre_key_if_due(rotation_ts)
|
|
224
|
+
await self._flush_dangling_receipts()
|
|
225
|
+
await self._send_active_mode_iq()
|
|
226
|
+
|
|
227
|
+
async def _send_active_mode_iq(self) -> None:
|
|
228
|
+
try:
|
|
229
|
+
await self._runtime.query_with_context(
|
|
230
|
+
"passive.active",
|
|
231
|
+
build_passive_mode_iq_node("active"),
|
|
232
|
+
float(_defaults.IQ_TIMEOUT_MS),
|
|
233
|
+
)
|
|
234
|
+
except Exception as error:
|
|
235
|
+
normalized = to_error(error)
|
|
236
|
+
message = str(normalized.args[0]) if normalized.args else ""
|
|
237
|
+
self._logger.warn("passive active iq failed", {"message": message})
|
|
238
|
+
|
|
239
|
+
async def _validate_digest_and_recover_pre_keys(
|
|
240
|
+
self,
|
|
241
|
+
prefetched: SignalDigestPrefetchedLocalKeyBundle | None = None,
|
|
242
|
+
) -> None:
|
|
243
|
+
try:
|
|
244
|
+
validation: SignalDigestValidationResult = (
|
|
245
|
+
await self._signal_digest_sync.validate_local_key_bundle(prefetched)
|
|
246
|
+
)
|
|
247
|
+
if validation.valid:
|
|
248
|
+
self._logger.debug(
|
|
249
|
+
"signal digest validated",
|
|
250
|
+
{"preKeyCount": validation.pre_key_count},
|
|
251
|
+
)
|
|
252
|
+
return
|
|
253
|
+
self._logger.warn(
|
|
254
|
+
"signal digest validation failed",
|
|
255
|
+
{
|
|
256
|
+
"reason": validation.reason,
|
|
257
|
+
"shouldReupload": validation.should_reupload,
|
|
258
|
+
"preKeyCount": validation.pre_key_count,
|
|
259
|
+
},
|
|
260
|
+
)
|
|
261
|
+
if not validation.should_reupload:
|
|
262
|
+
return
|
|
263
|
+
await asyncio.gather(
|
|
264
|
+
self._pre_key_store.set_server_has_pre_keys(False),
|
|
265
|
+
self._runtime.persist_server_has_pre_keys(False),
|
|
266
|
+
)
|
|
267
|
+
await self._upload_pre_keys_if_missing(False, prefetched)
|
|
268
|
+
except Exception as error:
|
|
269
|
+
normalized = to_error(error)
|
|
270
|
+
message = str(normalized.args[0]) if normalized.args else ""
|
|
271
|
+
self._logger.warn(
|
|
272
|
+
"signal digest validation failed with exception", {"message": message}
|
|
273
|
+
)
|
|
274
|
+
|
|
275
|
+
async def _upload_pre_keys_if_missing(
|
|
276
|
+
self,
|
|
277
|
+
server_has_pre_keys_hint: bool | None = None,
|
|
278
|
+
prefetched: SignalDigestPrefetchedLocalKeyBundle | None = None,
|
|
279
|
+
) -> None:
|
|
280
|
+
if server_has_pre_keys_hint is None:
|
|
281
|
+
server_has_pre_keys = await self._pre_key_store.get_server_has_pre_keys()
|
|
282
|
+
else:
|
|
283
|
+
server_has_pre_keys = server_has_pre_keys_hint
|
|
284
|
+
if server_has_pre_keys:
|
|
285
|
+
self._logger.trace("prekey upload skipped: server already has prekeys")
|
|
286
|
+
return
|
|
287
|
+
resolved = (
|
|
288
|
+
prefetched
|
|
289
|
+
if prefetched is not None
|
|
290
|
+
else await self._resolve_local_key_bundle()
|
|
291
|
+
)
|
|
292
|
+
if resolved is None:
|
|
293
|
+
self._logger.warn("prekey upload skipped: registration info is missing")
|
|
294
|
+
return
|
|
295
|
+
pre_keys = await self._pre_key_store.get_or_gen_pre_keys(
|
|
296
|
+
SIGNAL_UPLOAD_PREKEYS_COUNT, generate_pre_key_pair
|
|
297
|
+
)
|
|
298
|
+
if len(pre_keys) == 0:
|
|
299
|
+
raise ValueError("no prekey available for upload")
|
|
300
|
+
last_pre_key_id = pre_keys[-1].key_id
|
|
301
|
+
upload_node = build_pre_key_upload_iq(
|
|
302
|
+
resolved.registration_info, resolved.signed_pre_key, list(pre_keys)
|
|
303
|
+
)
|
|
304
|
+
response = await self._runtime.query_with_context(
|
|
305
|
+
"prekeys.upload",
|
|
306
|
+
upload_node,
|
|
307
|
+
float(_defaults.IQ_TIMEOUT_MS),
|
|
308
|
+
{"count": len(pre_keys), "lastPreKeyId": last_pre_key_id},
|
|
309
|
+
WaPassiveQueryOptions(use_system_id=True)
|
|
310
|
+
if self._mobile_primary()
|
|
311
|
+
else None,
|
|
312
|
+
)
|
|
313
|
+
if response.attrs.get("type") == WA_IQ_TYPES["RESULT"]:
|
|
314
|
+
await self._pre_key_store.mark_key_as_uploaded(last_pre_key_id)
|
|
315
|
+
await asyncio.gather(
|
|
316
|
+
self._pre_key_store.set_server_has_pre_keys(True),
|
|
317
|
+
self._runtime.persist_server_has_pre_keys(True),
|
|
318
|
+
)
|
|
319
|
+
self._logger.info(
|
|
320
|
+
"uploaded prekeys to server",
|
|
321
|
+
{"count": len(pre_keys), "lastPreKeyId": last_pre_key_id},
|
|
322
|
+
)
|
|
323
|
+
return
|
|
324
|
+
failure = parse_pre_key_upload_failure(response)
|
|
325
|
+
self._logger.warn(
|
|
326
|
+
"upload prekeys failed",
|
|
327
|
+
{
|
|
328
|
+
"count": len(pre_keys),
|
|
329
|
+
"lastPreKeyId": last_pre_key_id,
|
|
330
|
+
"errorCode": failure.error_code,
|
|
331
|
+
"errorText": failure.error_text,
|
|
332
|
+
},
|
|
333
|
+
)
|
|
334
|
+
|
|
335
|
+
async def _rotate_signed_pre_key_if_due(self, rotation_ts_hint: int | None) -> None:
|
|
336
|
+
# The TS original re-reads the stamp when the hint is `undefined`;
|
|
337
|
+
# this private method has a single call site that always passes the
|
|
338
|
+
# gathered value, so the hint is required here.
|
|
339
|
+
try:
|
|
340
|
+
now_ms = int(time.time() * 1000)
|
|
341
|
+
last_rotation_ts = rotation_ts_hint
|
|
342
|
+
if last_rotation_ts is None:
|
|
343
|
+
await self._signal_store.set_signed_pre_key_rotation_ts(now_ms)
|
|
344
|
+
self._logger.trace("signal rotate key skipped on first run")
|
|
345
|
+
return
|
|
346
|
+
elapsed_ms = now_ms - last_rotation_ts
|
|
347
|
+
if elapsed_ms < self._signed_pre_key_rotation_interval_ms:
|
|
348
|
+
self._logger.trace(
|
|
349
|
+
"signal rotate key skipped: interval not reached",
|
|
350
|
+
{
|
|
351
|
+
"remainingMs": self._signed_pre_key_rotation_interval_ms
|
|
352
|
+
- elapsed_ms
|
|
353
|
+
},
|
|
354
|
+
)
|
|
355
|
+
return
|
|
356
|
+
result = await self._signal_rotate_key.rotate_signed_pre_key()
|
|
357
|
+
next_rotation_ts = self._resolve_rotation_timestamp(
|
|
358
|
+
now_ms, result.error_code
|
|
359
|
+
)
|
|
360
|
+
await self._signal_store.set_signed_pre_key_rotation_ts(next_rotation_ts)
|
|
361
|
+
if result.should_digest_key:
|
|
362
|
+
await self._validate_digest_and_recover_pre_keys()
|
|
363
|
+
except Exception as error:
|
|
364
|
+
normalized = to_error(error)
|
|
365
|
+
message = str(normalized.args[0]) if normalized.args else ""
|
|
366
|
+
self._logger.warn("signal rotate key failed", {"message": message})
|
|
367
|
+
|
|
368
|
+
async def _resolve_local_key_bundle(
|
|
369
|
+
self,
|
|
370
|
+
) -> SignalDigestPrefetchedLocalKeyBundle | None:
|
|
371
|
+
registration_info, signed_pre_key = await asyncio.gather(
|
|
372
|
+
self._signal_store.get_registration_info(),
|
|
373
|
+
self._signal_store.get_signed_pre_key(),
|
|
374
|
+
)
|
|
375
|
+
if registration_info is None or signed_pre_key is None:
|
|
376
|
+
return None
|
|
377
|
+
return SignalDigestPrefetchedLocalKeyBundle(
|
|
378
|
+
registration_info=registration_info, signed_pre_key=signed_pre_key
|
|
379
|
+
)
|
|
380
|
+
|
|
381
|
+
def _resolve_rotation_timestamp(self, now_ms: int, error_code: int | None) -> int:
|
|
382
|
+
if error_code is not None and error_code >= 500:
|
|
383
|
+
retry_in_ms = min(
|
|
384
|
+
self._signed_pre_key_server_error_backoff_ms,
|
|
385
|
+
self._signed_pre_key_rotation_interval_ms,
|
|
386
|
+
)
|
|
387
|
+
self._logger.warn(
|
|
388
|
+
"signal rotate key scheduled with server error backoff",
|
|
389
|
+
{"errorCode": error_code, "retryInMs": retry_in_ms},
|
|
390
|
+
)
|
|
391
|
+
return now_ms - self._signed_pre_key_rotation_interval_ms + retry_in_ms
|
|
392
|
+
return now_ms
|
|
393
|
+
|
|
394
|
+
async def _flush_dangling_receipts(self) -> None:
|
|
395
|
+
pending = list(self._runtime.take_dangling_receipts())
|
|
396
|
+
if not pending:
|
|
397
|
+
return
|
|
398
|
+
self._logger.info("flushing dangling receipts", {"count": len(pending)})
|
|
399
|
+
cursor = 0
|
|
400
|
+
while cursor < len(pending):
|
|
401
|
+
batch_end = min(cursor + 4, len(pending))
|
|
402
|
+
results = await asyncio.gather(
|
|
403
|
+
*(
|
|
404
|
+
self._runtime.send_node_direct(pending[i])
|
|
405
|
+
for i in range(cursor, batch_end)
|
|
406
|
+
),
|
|
407
|
+
return_exceptions=True,
|
|
408
|
+
)
|
|
409
|
+
transient_count = 0
|
|
410
|
+
for offset, result in enumerate(results):
|
|
411
|
+
if not isinstance(result, BaseException):
|
|
412
|
+
continue
|
|
413
|
+
node = pending[cursor + offset]
|
|
414
|
+
normalized = to_error(result)
|
|
415
|
+
if self._runtime.should_queue_dangling_receipt(node, normalized):
|
|
416
|
+
self._runtime.requeue_dangling_receipt(node)
|
|
417
|
+
transient_count += 1
|
|
418
|
+
else:
|
|
419
|
+
message = str(normalized.args[0]) if normalized.args else ""
|
|
420
|
+
self._logger.warn(
|
|
421
|
+
"dropping dangling receipt due non-retryable send error",
|
|
422
|
+
{
|
|
423
|
+
"id": node.attrs.get("id"),
|
|
424
|
+
"to": node.attrs.get("to"),
|
|
425
|
+
"message": message,
|
|
426
|
+
},
|
|
427
|
+
)
|
|
428
|
+
if transient_count > 0:
|
|
429
|
+
for i in range(batch_end, len(pending)):
|
|
430
|
+
self._runtime.requeue_dangling_receipt(pending[i])
|
|
431
|
+
self._logger.warn(
|
|
432
|
+
"stopped dangling receipt flush due transient send error",
|
|
433
|
+
{"remaining": transient_count + (len(pending) - batch_end)},
|
|
434
|
+
)
|
|
435
|
+
return
|
|
436
|
+
cursor = batch_end
|
|
437
|
+
self._logger.info("dangling receipts flushed")
|
|
438
|
+
|
|
439
|
+
|
|
440
|
+
__all__ = [
|
|
441
|
+
"WaPassiveAppStateSync",
|
|
442
|
+
"WaPassiveDigestSync",
|
|
443
|
+
"WaPassiveQueryOptions",
|
|
444
|
+
"WaPassiveRotateKey",
|
|
445
|
+
"WaPassiveTasksCoordinator",
|
|
446
|
+
"WaPassiveTasksRuntime",
|
|
447
|
+
]
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
"""Presence coordinator (mirrors ``WaPresenceCoordinator``).
|
|
2
|
+
|
|
3
|
+
Broadcasts own presence, sends chatstate hints, and subscribes to peer
|
|
4
|
+
presence (attaching a receiver-mode privacy token for 1:1 chats).
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from __future__ import annotations
|
|
8
|
+
|
|
9
|
+
from collections.abc import Awaitable, Callable
|
|
10
|
+
from typing import Protocol
|
|
11
|
+
|
|
12
|
+
from zapy._transport.node.builders.chatstate import (
|
|
13
|
+
BuildChatstateNodeInput,
|
|
14
|
+
build_chatstate_node,
|
|
15
|
+
)
|
|
16
|
+
from zapy._transport.node.builders.presence import (
|
|
17
|
+
BuildPresenceNodeInput,
|
|
18
|
+
BuildPresenceSubscribeNodeInput,
|
|
19
|
+
build_presence_node,
|
|
20
|
+
build_presence_subscribe_node,
|
|
21
|
+
is_group_jid,
|
|
22
|
+
)
|
|
23
|
+
from zapy._transport.types import BinaryNode
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class WaPresenceCredentialsLike(Protocol):
|
|
27
|
+
"""Credentials surface read by the presence coordinator."""
|
|
28
|
+
|
|
29
|
+
me_display_name: str | None
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
class WaPresenceCoordinator(Protocol):
|
|
33
|
+
"""Presence surface: broadcast own state, chatstate, and subscribe."""
|
|
34
|
+
|
|
35
|
+
async def send(self, type: str | None = None) -> None: ...
|
|
36
|
+
async def send_chatstate(
|
|
37
|
+
self, jid: str, *, state: str, media: str | None = None
|
|
38
|
+
) -> None: ...
|
|
39
|
+
async def subscribe(
|
|
40
|
+
self,
|
|
41
|
+
jid: str,
|
|
42
|
+
*,
|
|
43
|
+
name: str | None = None,
|
|
44
|
+
context: str | None = None,
|
|
45
|
+
) -> None: ...
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def create_presence_coordinator(
|
|
49
|
+
*,
|
|
50
|
+
send_node: Callable[[BinaryNode], Awaitable[None]],
|
|
51
|
+
get_current_credentials: Callable[[], WaPresenceCredentialsLike | None],
|
|
52
|
+
resolve_privacy_token_node: Callable[[str], Awaitable[BinaryNode | None]],
|
|
53
|
+
) -> WaPresenceCoordinator:
|
|
54
|
+
"""Build a presence coordinator from its node-send dependency."""
|
|
55
|
+
|
|
56
|
+
class _Coordinator:
|
|
57
|
+
async def send(self, type: str | None = None) -> None:
|
|
58
|
+
credentials = get_current_credentials()
|
|
59
|
+
await send_node(
|
|
60
|
+
build_presence_node(
|
|
61
|
+
BuildPresenceNodeInput(
|
|
62
|
+
type=type,
|
|
63
|
+
name=credentials.me_display_name
|
|
64
|
+
if credentials is not None
|
|
65
|
+
else None,
|
|
66
|
+
)
|
|
67
|
+
)
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
async def send_chatstate(
|
|
71
|
+
self, jid: str, *, state: str, media: str | None = None
|
|
72
|
+
) -> None:
|
|
73
|
+
await send_node(
|
|
74
|
+
build_chatstate_node(
|
|
75
|
+
BuildChatstateNodeInput(jid=jid, state=state, media=media)
|
|
76
|
+
)
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
async def subscribe(
|
|
80
|
+
self,
|
|
81
|
+
jid: str,
|
|
82
|
+
*,
|
|
83
|
+
name: str | None = None,
|
|
84
|
+
context: str | None = None,
|
|
85
|
+
) -> None:
|
|
86
|
+
privacy_token_node = (
|
|
87
|
+
None if is_group_jid(jid) else await resolve_privacy_token_node(jid)
|
|
88
|
+
)
|
|
89
|
+
await send_node(
|
|
90
|
+
build_presence_subscribe_node(
|
|
91
|
+
BuildPresenceSubscribeNodeInput(
|
|
92
|
+
jid=jid,
|
|
93
|
+
name=name,
|
|
94
|
+
context=context,
|
|
95
|
+
privacy_token_node=privacy_token_node,
|
|
96
|
+
)
|
|
97
|
+
)
|
|
98
|
+
)
|
|
99
|
+
|
|
100
|
+
return _Coordinator()
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
__all__ = ["WaPresenceCoordinator", "create_presence_coordinator"]
|