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)
| 617 | |
| 618 | @remote_router.post("/remote/send", tags=["Remote"]) |
| 619 | async 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 --- |
nothing calls this directly
no test coverage detected