add optional in_reply_to field on send for conversation threading

This commit is contained in:
damocles 2026-05-20 13:01:02 +02:00
parent 03db764101
commit 67b47872e0
9 changed files with 90 additions and 16 deletions

View file

@ -90,7 +90,7 @@ fn manager_recv_timeout(wait_seconds: Option<u64>) -> std::time::Duration {
#[allow(clippy::too_many_lines)]
async fn dispatch(req: &ManagerRequest, coord: &Arc<Coordinator>) -> ManagerResponse {
match req {
ManagerRequest::Send { to, body } => {
ManagerRequest::Send { to, body, in_reply_to } => {
if let Err(message) = crate::limits::check_size("send", body) {
return ManagerResponse::Err { message };
}
@ -108,6 +108,7 @@ async fn dispatch(req: &ManagerRequest, coord: &Arc<Coordinator>) -> ManagerResp
from: MANAGER_AGENT.to_owned(),
to: to.clone(),
body: body.clone(),
in_reply_to: *in_reply_to,
}) {
Ok(()) => ManagerResponse::Ok,
Err(e) => ManagerResponse::Err {
@ -120,6 +121,7 @@ async fn dispatch(req: &ManagerRequest, coord: &Arc<Coordinator>) -> ManagerResp
from: hive_sh4re::OPERATOR_RECIPIENT.to_owned(),
to: MANAGER_AGENT.to_owned(),
body: body.clone(),
in_reply_to: None,
}) {
Ok(()) => ManagerResponse::Ok,
Err(e) => ManagerResponse::Err {
@ -153,6 +155,7 @@ async fn dispatch(req: &ManagerRequest, coord: &Arc<Coordinator>) -> ManagerResp
body: d.message.body,
id: d.id,
redelivered: d.redelivered,
in_reply_to: d.message.in_reply_to,
})
.collect(),
},