diff --git a/public_html/admin/index.php b/public_html/admin/index.php index 6d06942..297fa65 100644 --- a/public_html/admin/index.php +++ b/public_html/admin/index.php @@ -837,6 +837,24 @@ if ($action) { $raw = curl_exec($ch); curl_close($ch); j(json_decode($raw, true) ?: ['error'=>'failed']); + // Added 2026-07-07: fetch a single outbox item WITH its body — outbox_list + // deliberately omits body for list-view performance, but VIEW needs the full text. + case 'outbox_get': + $id = (int)($_GET['id'] ?? 0); if (!$id) bad('Missing id'); + $ch = curl_init('http://127.0.0.1:7474/comms/sent/' . $id); + curl_setopt_array($ch, [CURLOPT_RETURNTRANSFER=>true, CURLOPT_TIMEOUT=>5]); + $raw = curl_exec($ch); curl_close($ch); + j(json_decode($raw, true) ?: ['error'=>'failed']); + + // Added 2026-07-07: closes the "compose creates a draft but nothing can ever + // send it" gap — dispatches a queued draft through the real send path. + case 'outbox_send': + $id = (int)($_GET['id'] ?? 0); if (!$id) bad('Missing id'); + $ch = curl_init('http://127.0.0.1:7474/comms/sent/' . $id . '/send'); + curl_setopt_array($ch, [CURLOPT_RETURNTRANSFER=>true, CURLOPT_TIMEOUT=>30, CURLOPT_POST=>true, CURLOPT_POSTFIELDS=>'']); + $raw = curl_exec($ch); curl_close($ch); + j(json_decode($raw, true) ?: ['error'=>'failed']); + case 'send_reply': $id = (int)($_GET['id'] ?? 0); if (!$id) bad('Missing triage id'); $content = $_GET['content'] ?? ''; @@ -4370,6 +4388,7 @@ async function loadOutbox() {
${esc(m.body||'(no body)')}
`, null, null);