dashboard: fan out op-send when recipient is *

This commit is contained in:
müde 2026-05-17 11:09:20 +02:00
parent 6ce85bd6f2
commit 9703753a4c
2 changed files with 15 additions and 3 deletions

View file

@ -1054,7 +1054,14 @@ async fn post_op_send(State(state): State<AppState>, Form(form): Form<OpSendForm
if body.is_empty() {
return error_response("op-send: `body` required");
}
if let Err(e) = state.coord.broker.send(&hive_sh4re::Message {
if to == "*" {
let errors = state
.coord
.broadcast_send(hive_sh4re::OPERATOR_RECIPIENT, &body);
if !errors.is_empty() {
return error_response(&format!("op-send broadcast partial fail: {}", errors.join("; ")));
}
} else if let Err(e) = state.coord.broker.send(&hive_sh4re::Message {
from: hive_sh4re::OPERATOR_RECIPIENT.to_owned(),
to: to.clone(),
body,