diff options
| author | Owen Jacobson <owen@grimoire.ca> | 2024-09-27 18:17:02 -0400 |
|---|---|---|
| committer | Owen Jacobson <owen@grimoire.ca> | 2024-09-27 19:59:22 -0400 |
| commit | eff129bc1f29bcb1b2b9d10c6b49ab886edc83d6 (patch) | |
| tree | b82892a6cf40f771998a85e5530012bab80157dc /src/app.rs | |
| parent | 68e3dce3c2e588376c6510783e908941360ac80e (diff) | |
Make `/api/events` a firehose endpoint.
It now includes events for all channels. Clients are responsible for filtering.
The schema for channel events has changed; it now includes a channel name and ID, in the same format as the sender's name and ID. They also now include a `"type"` field, whose only valid value (as of this writing) is `"message"`.
This is groundwork for delivering message deletion (expiry) events to clients, and notifying clients of channel lifecycle events.
Diffstat (limited to 'src/app.rs')
| -rw-r--r-- | src/app.rs | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -13,9 +13,9 @@ pub struct App { } impl App { - pub async fn from(db: SqlitePool) -> Result<Self, sqlx::Error> { - let broadcaster = Broadcaster::from_database(&db).await?; - Ok(Self { db, broadcaster }) + pub fn from(db: SqlitePool) -> Self { + let broadcaster = Broadcaster::default(); + Self { db, broadcaster } } } @@ -29,6 +29,6 @@ impl App { } pub const fn channels(&self) -> Channels { - Channels::new(&self.db, &self.broadcaster) + Channels::new(&self.db) } } |
