summaryrefslogtreecommitdiff
path: root/src/message/history.rs
diff options
context:
space:
mode:
authorOwen Jacobson <owen@grimoire.ca>2025-08-21 23:47:15 -0400
committerOwen Jacobson <owen@grimoire.ca>2025-08-24 04:50:49 -0400
commit53944ef14af4d37c08464cb1bb9f3a8f09277194 (patch)
tree8458167c1608222a914ce0bdcc1fb5f966cf4f95 /src/message/history.rs
parentfd6a74e8ca1f5ded2a760b8ac644124862d80d54 (diff)
Collapse redundant "deleted_at" timestaps and "deleted" event instants.
These were separated as there wasn't an obvious way to serialize two fields with the same _type_ with different _prefixes_. Turns out this is a common problem, and someone's written a crate for it that remaps the names for you.
Diffstat (limited to 'src/message/history.rs')
-rw-r--r--src/message/history.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/message/history.rs b/src/message/history.rs
index 7585e1c..d4d4500 100644
--- a/src/message/history.rs
+++ b/src/message/history.rs
@@ -4,12 +4,11 @@ use super::{
Id, Message,
event::{Deleted, Event, Sent},
};
-use crate::event::{Instant, Sequence};
+use crate::event::Sequence;
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct History {
pub message: Message,
- pub deleted: Option<Instant>,
}
// State interface
@@ -43,7 +42,7 @@ impl History {
}
fn deleted(&self) -> Option<Event> {
- self.deleted.map(|instant| {
+ self.message.deleted.map(|instant| {
Deleted {
instant,
id: self.message.id.clone(),