type Message.from as Ident

This commit is contained in:
damocles 2026-07-22 20:12:50 +02:00 committed by mara
commit 4989bcdb5e
6 changed files with 43 additions and 24 deletions

View file

@ -321,7 +321,7 @@ async fn handle_recv(
messages: deliveries
.into_iter()
.map(|d| hive_sh4re::DeliveredMessage {
from: d.message.from,
from: d.message.from.to_string(),
body: d.message.body,
id: d.id,
redelivered: d.redelivered,
@ -347,7 +347,7 @@ fn handle_wake(
body: &str,
) -> hive_core_agent_sock::Response {
match coord.broker.send(&Message {
from: from.to_owned(),
from: hive_sh4re::trusted_sender(from),
to: agent.to_owned(),
body: body.to_owned(),
in_reply_to: None,
@ -490,7 +490,7 @@ fn handle_operator_msg(
body: &str,
) -> hive_core_agent_sock::Response {
match coord.broker.send(&Message {
from: hive_sh4re::OPERATOR_RECIPIENT.to_owned(),
from: hive_sh4re::trusted_sender(hive_sh4re::OPERATOR_RECIPIENT),
to: agent.to_owned(),
body: body.to_owned(),
in_reply_to: None,
@ -955,7 +955,7 @@ pub(crate) fn fan_out_send(
continue;
}
if let Err(e) = coord.broker.send(&Message {
from: from.to_owned(),
from: hive_sh4re::trusted_sender(from),
to: target.clone(),
body: body.to_owned(),
in_reply_to,
@ -1040,7 +1040,7 @@ pub(crate) fn handle_send(
}
}
match coord.broker.send(&Message {
from: agent.to_owned(),
from: hive_sh4re::trusted_sender(agent),
to: resolved,
body: body.to_owned(),
in_reply_to,