MCPcopy Create free account
hub / github.com/Roy3838/Observer / remote_send

Function remote_send

api/remote.py:619–634  ·  view source on GitHub ↗

OUT: one item of the tab's MCP conversation, to every session named. Items arrive in order, one request each: a message (text, optionally with one image), and finally `done`. Every item but `done` keeps the session busy, which keeps typing up between them.

(body: RemoteSendRequest, request: Request)

Source from the content-addressed store, hash-verified

617
618@remote_router.post("/remote/send", tags=["Remote"])
619async def remote_send(body: RemoteSendRequest, request: Request):
620 """
621 OUT: one item of the tab's MCP conversation, to every session named. Items arrive in
622 order, one request each: a message (text, optionally with one image), and finally
623 `done`. Every item but `done` keeps the session busy, which keeps typing up between them.
624 """
625 from messaging import assert_content_allowed
626
627 sessions, user = await _sessions(request, body.whatsapp, body.telegram)
628 assert_content_allowed(body.text)
629 sent: dict[str, str] = {}
630 for channel, code in sessions.items():
631 await _set_busy(code, channel, not body.done)
632 if body.text or body.image:
633 sent[channel] = await _send_item(channel, code, body, user)
634 return {"sent": sent}
635
636
637# --- Status, for the settings card ---

Callers

nothing calls this directly

Calls 4

assert_content_allowedFunction · 0.90
_sessionsFunction · 0.85
_set_busyFunction · 0.85
_send_itemFunction · 0.85

Tested by

no test coverage detected