diff options
| author | Owen Jacobson <owen@grimoire.ca> | 2024-10-08 22:43:22 -0400 |
|---|---|---|
| committer | Owen Jacobson <owen@grimoire.ca> | 2024-10-09 11:45:31 -0400 |
| commit | 9e171096a72d3e63626df7b09970476aba28eb06 (patch) | |
| tree | 7272c065fdb85148dc5c90d937fc7d13fc716ccf /src/channel/history.rs | |
| parent | 653e2de752a97e377fc9963ba60d9408e7089528 (diff) | |
Use a two-tier hierarchy for events.
This will make it much easier to slot in new event types (login events!).
Diffstat (limited to 'src/channel/history.rs')
| -rw-r--r-- | src/channel/history.rs | 16 |
1 files changed, 7 insertions, 9 deletions
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<Event> { - self.deleted.map(|instant| Event { - instant, - kind: Deleted { + self.deleted.map(|instant| { + Deleted { + instant, id: self.channel.id.clone(), } - .into(), + .into() }) } } |
