From 9e171096a72d3e63626df7b09970476aba28eb06 Mon Sep 17 00:00:00 2001 From: Owen Jacobson Date: Tue, 8 Oct 2024 22:43:22 -0400 Subject: Use a two-tier hierarchy for events. This will make it much easier to slot in new event types (login events!). --- src/channel/history.rs | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'src/channel/history.rs') diff --git a/src/channel/history.rs b/src/channel/history.rs index 0499927..78b3437 100644 --- a/src/channel/history.rs +++ b/src/channel/history.rs @@ -40,22 +40,20 @@ impl History { } fn created(&self) -> Event { - Event { + Created { instant: self.created, - kind: Created { - channel: self.channel.clone(), - } - .into(), + channel: self.channel.clone(), } + .into() } fn deleted(&self) -> Option { - self.deleted.map(|instant| Event { - instant, - kind: Deleted { + self.deleted.map(|instant| { + Deleted { + instant, id: self.channel.id.clone(), } - .into(), + .into() }) } } -- cgit v1.2.3