use super::{Target, rows};
use crate::inboxview::InboxEntry;
impl crate::app::AppModel {
pub fn echoed(
&self,
rows: Vec<crate::nav::convs::ConvRow>,
now_unix: i64,
) -> Vec<crate::nav::convs::ConvRow> {
let Some(ws) = self.focused_workspace() else {
return rows;
};
rows::with_echo(self.started.as_ref(), &ws, rows, now_unix)
}
pub fn echoed_pending(&self, agent: &str, pending: Vec<InboxEntry>) -> Vec<InboxEntry> {
let Some(ws) = self.focused_workspace() else {
return pending;
};
let mine = self
.started
.as_ref()
.filter(|echo| echo.ws == ws && echo.target == Target::Agent(agent.to_owned()));
match mine {
Some(echo) => pending.into_iter().chain([echo.deposit()]).collect(),
None => pending,
}
}
}