Reformat and remove stale debugging
This commit is contained in:
@@ -621,6 +621,7 @@ class SignalClient(ClientBase):
|
||||
async def _drain_runtime_commands(self):
|
||||
"""Process queued runtime commands (e.g., web UI sends via composite router)."""
|
||||
from core.clients import transport
|
||||
|
||||
# Process a small burst each loop to keep sends responsive.
|
||||
for _ in range(5):
|
||||
command = transport.pop_runtime_command(self.service)
|
||||
@@ -631,6 +632,7 @@ class SignalClient(ClientBase):
|
||||
async def _execute_runtime_command(self, command):
|
||||
"""Execute a single runtime command like send_message_raw."""
|
||||
from core.clients import transport
|
||||
|
||||
command_id = str((command or {}).get("id") or "").strip()
|
||||
action = str((command or {}).get("action") or "").strip()
|
||||
payload = dict((command or {}).get("payload") or {})
|
||||
@@ -672,7 +674,9 @@ class SignalClient(ClientBase):
|
||||
return
|
||||
|
||||
if action == "notify_xmpp_sent":
|
||||
person_identifier_id = str(payload.get("person_identifier_id") or "").strip()
|
||||
person_identifier_id = str(
|
||||
payload.get("person_identifier_id") or ""
|
||||
).strip()
|
||||
text = str(payload.get("text") or "")
|
||||
if not person_identifier_id:
|
||||
transport.set_runtime_command_result(
|
||||
@@ -683,7 +687,9 @@ class SignalClient(ClientBase):
|
||||
return
|
||||
try:
|
||||
identifier = await sync_to_async(
|
||||
lambda: PersonIdentifier.objects.filter(id=person_identifier_id).select_related("user", "person").first()
|
||||
lambda: PersonIdentifier.objects.filter(id=person_identifier_id)
|
||||
.select_related("user", "person")
|
||||
.first()
|
||||
)()
|
||||
if identifier is None:
|
||||
transport.set_runtime_command_result(
|
||||
|
||||
Reference in New Issue
Block a user