From 72ed8a6dd2ae5f2b54a40433ab7fb03d27c07a13 Mon Sep 17 00:00:00 2001 From: Conrad Irwin Date: Tue, 17 Oct 2023 19:03:02 -0600 Subject: [PATCH] Allow guests to chat --- crates/collab/src/db/queries/messages.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/crates/collab/src/db/queries/messages.rs b/crates/collab/src/db/queries/messages.rs index 06e954103d..de7334425f 100644 --- a/crates/collab/src/db/queries/messages.rs +++ b/crates/collab/src/db/queries/messages.rs @@ -9,7 +9,7 @@ impl Database { user_id: UserId, ) -> Result<()> { self.transaction(|tx| async move { - self.check_user_is_channel_member(channel_id, user_id, &*tx) + self.check_user_is_channel_participant(channel_id, user_id, &*tx) .await?; channel_chat_participant::ActiveModel { id: ActiveValue::NotSet, @@ -77,7 +77,7 @@ impl Database { before_message_id: Option, ) -> Result> { self.transaction(|tx| async move { - self.check_user_is_channel_member(channel_id, user_id, &*tx) + self.check_user_is_channel_participant(channel_id, user_id, &*tx) .await?; let mut condition = @@ -125,6 +125,9 @@ impl Database { nonce: u128, ) -> Result<(MessageId, Vec, Vec)> { self.transaction(|tx| async move { + self.check_user_is_channel_participant(channel_id, user_id, &*tx) + .await?; + let mut rows = channel_chat_participant::Entity::find() .filter(channel_chat_participant::Column::ChannelId.eq(channel_id)) .stream(&*tx)