From 144f2b2be7b077b79276119bbefa2917f7bc3a59 Mon Sep 17 00:00:00 2001 From: alemi Date: Mon, 27 May 2024 18:11:34 +0200 Subject: [PATCH] fix: internal checks must return at least a column --- src/server/context.rs | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/src/server/context.rs b/src/server/context.rs index 2b023864..90b9938c 100644 --- a/src/server/context.rs +++ b/src/server/context.rs @@ -181,16 +181,37 @@ impl Context { } pub async fn is_local_internal_object(&self, internal: i64) -> crate::Result { - Ok(model::object::Entity::find_by_id(internal).select_only().one(self.db()).await?.is_some()) + Ok( + model::object::Entity::find_by_id(internal) + .select_only() + .select_column(model::object::Column::Internal) + .one(self.db()) + .await? + .is_some() + ) } pub async fn is_local_internal_activity(&self, internal: i64) -> crate::Result { - Ok(model::activity::Entity::find_by_id(internal).select_only().one(self.db()).await?.is_some()) + Ok( + model::activity::Entity::find_by_id(internal) + .select_only() + .select_column(model::activity::Column::Internal) + .one(self.db()) + .await? + .is_some() + ) } #[allow(unused)] pub async fn is_local_internal_actor(&self, internal: i64) -> crate::Result { - Ok(model::actor::Entity::find_by_id(internal).select_only().one(self.db()).await?.is_some()) + Ok( + model::actor::Entity::find_by_id(internal) + .select_only() + .select_column(model::actor::Column::Internal) + .one(self.db()) + .await? + .is_some() + ) } pub async fn expand_addressing(&self, targets: Vec) -> crate::Result> {