From 9311cf25ded85b8cdbcf79a74b4578e3a78c8ca6 Mon Sep 17 00:00:00 2001 From: alemi Date: Fri, 5 Jul 2024 00:31:42 +0200 Subject: [PATCH] fix: fetch relay usr or else we cant know internal --- upub/cli/src/relay.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/upub/cli/src/relay.rs b/upub/cli/src/relay.rs index dd7d10f2..b86e2a39 100644 --- a/upub/cli/src/relay.rs +++ b/upub/cli/src/relay.rs @@ -1,6 +1,6 @@ use apb::{ActivityMut, BaseMut, ObjectMut}; use sea_orm::{ActiveValue::{NotSet, Set}, DbErr, EntityTrait, QueryFilter, ColumnTrait}; -use upub::traits::fetch::PullError; +use upub::traits::{fetch::PullError, Fetcher}; #[derive(Debug, Clone, clap::Subcommand)] /// available actions to take on relays @@ -40,10 +40,7 @@ pub async fn relay(ctx: upub::Context, action: RelayCommand) -> Result<(), PullE | RelayCommand::Accept { actor } | RelayCommand::Unfollow { actor } | RelayCommand::Remove { actor } - => - upub::model::actor::Entity::ap_to_internal(actor, ctx.db()) - .await? - .ok_or_else(|| DbErr::RecordNotFound(actor.clone()))?, + => ctx.fetch_user(actor, ctx.db()).await?.internal, }; match action {