From b0e18da1b57452ae4a101a5b9b0da4a9c306139a Mon Sep 17 00:00:00 2001 From: Zomatree Date: Wed, 22 Jul 2026 04:39:32 +0100 Subject: [PATCH] fix: update events Signed-off-by: Zomatree --- crates/core/database/src/events/client.rs | 2 ++ crates/core/database/src/models/channel_webhooks/model.rs | 2 ++ crates/core/database/src/models/channels/model.rs | 8 ++------ 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/crates/core/database/src/events/client.rs b/crates/core/database/src/events/client.rs index 041868c8..8a50ff76 100644 --- a/crates/core/database/src/events/client.rs +++ b/crates/core/database/src/events/client.rs @@ -319,6 +319,7 @@ pub enum EventV1 { /// Update existing webhook WebhookUpdate { id: String, + channel_id: String, data: PartialWebhook, remove: Vec, }, @@ -326,6 +327,7 @@ pub enum EventV1 { /// Delete webhook WebhookDelete { id: String, + channel_id: String, }, /// Auth events diff --git a/crates/core/database/src/models/channel_webhooks/model.rs b/crates/core/database/src/models/channel_webhooks/model.rs index cdf94db4..1314bf57 100644 --- a/crates/core/database/src/models/channel_webhooks/model.rs +++ b/crates/core/database/src/models/channel_webhooks/model.rs @@ -96,6 +96,7 @@ impl Webhook { EventV1::WebhookUpdate { id: self.id.clone(), + channel_id: self.channel_id.clone(), data: partial.into(), remove: remove.into_iter().map(|v| v.into()).collect(), } @@ -116,6 +117,7 @@ impl Webhook { EventV1::WebhookDelete { id: self.id.clone(), + channel_id: self.channel_id.clone(), } .p(self.channel_id.clone()) .await; diff --git a/crates/core/database/src/models/channels/model.rs b/crates/core/database/src/models/channels/model.rs index 74b56e11..a36ed3ec 100644 --- a/crates/core/database/src/models/channels/model.rs +++ b/crates/core/database/src/models/channels/model.rs @@ -462,7 +462,6 @@ impl Channel { match self { Channel::TextChannel { id, - server, role_permissions, .. } => { @@ -480,7 +479,7 @@ impl Channel { .into(), clear: vec![], } - .p(server.clone()) + .p(id.clone()) .await; Ok(()) @@ -510,10 +509,7 @@ impl Channel { data: partial.into(), clear: remove.into_iter().map(|v| v.into()).collect(), } - .p(match self { - Self::TextChannel { server, .. } => server.clone(), - _ => id, - }) + .p(id) .await; Ok(())