summaryrefslogtreecommitdiff
path: root/src/channel/snapshot.rs
diff options
context:
space:
mode:
authorOwen Jacobson <owen@grimoire.ca>2025-05-13 23:03:56 -0400
committerOwen Jacobson <owen@grimoire.ca>2025-05-13 23:03:56 -0400
commitad4ac3e10d2a3e5569c1b36f87d6a5f78a9cf863 (patch)
treeceb0b6dcff5b0d530d6effa261a1314a9651731a /src/channel/snapshot.rs
parent48b4e4ebc4558cf6790c0a9043c46f16b0cbc285 (diff)
Make creation time an intrinsic fact about channels, the way it is for events.
To make unread handling of empty channels coherent (and to make it possible to mark an empty channel as having been read), they need to be associated with a specific point in time. This change exposes their creation time in the snapshot - it was already part of the event view, though the client doesn't know that yet.
Diffstat (limited to 'src/channel/snapshot.rs')
-rw-r--r--src/channel/snapshot.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/channel/snapshot.rs b/src/channel/snapshot.rs
index 046ac38..96801b8 100644
--- a/src/channel/snapshot.rs
+++ b/src/channel/snapshot.rs
@@ -2,10 +2,12 @@ use super::{
Id,
event::{Created, Event},
};
-use crate::{clock::DateTime, name::Name};
+use crate::{clock::DateTime, event::Instant, name::Name};
#[derive(Clone, Debug, Eq, PartialEq, serde::Serialize)]
pub struct Channel {
+ #[serde(flatten)]
+ pub created: Instant,
pub id: Id,
pub name: Name,
#[serde(skip_serializing_if = "Option::is_none")]