fix unread count: sent messages don't count as unread
Track outgoing messages separately (own counter) so they appear in the log but don't inflate unread counts. Reset on recv. Co-Developed-By: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
e104a16f61
commit
53a2dbac37
3 changed files with 22 additions and 5 deletions
|
|
@ -260,9 +260,13 @@ impl channel_server::Server for ChannelServerImpl {
|
|||
|
||||
let ts = now() as u64;
|
||||
append_history(&format!("{ts} [agent] {message}"));
|
||||
state.borrow_mut().push_message(
|
||||
format!("[agent] {}", message), 0, "telegram.agent"
|
||||
);
|
||||
{
|
||||
let channel = "telegram.agent".to_string();
|
||||
state.borrow_mut().channel_logs
|
||||
.entry(channel)
|
||||
.or_insert_with(ChannelLog::new)
|
||||
.push_own(format!("[agent] {}", message));
|
||||
}
|
||||
Ok(())
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue