From 292cfe901113b365db7aa3fad2082b6a66db214a Mon Sep 17 00:00:00 2001 From: alemi Date: Wed, 29 May 2024 04:43:02 +0200 Subject: [PATCH] fix: context is an oid --- src/routes/activitypub/context.rs | 4 ++-- src/server/context.rs | 10 +--------- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/src/routes/activitypub/context.rs b/src/routes/activitypub/context.rs index 42422ea8..3ffd3783 100644 --- a/src/routes/activitypub/context.rs +++ b/src/routes/activitypub/context.rs @@ -9,7 +9,7 @@ pub async fn get( AuthIdentity(auth): AuthIdentity, ) -> crate::Result> { let local_context_id = url!(ctx, "/context/{id}"); - let context = ctx.context_id(&id); + let context = ctx.oid(&id); let count = model::addressing::Entity::find_addressed(auth.my_id()) .filter(auth.filter_condition()) @@ -26,7 +26,7 @@ pub async fn page( Query(page): Query, AuthIdentity(auth): AuthIdentity, ) -> crate::Result> { - let context = ctx.context_id(&id); + let context = ctx.oid(&id); crate::server::builders::paginate( url!(ctx, "/context/{id}/page"), diff --git a/src/server/context.rs b/src/server/context.rs index e62e9761..5fa6bd79 100644 --- a/src/server/context.rs +++ b/src/server/context.rs @@ -76,6 +76,7 @@ impl Context { &self.0.actor } + #[allow(unused)] pub fn instance(&self) -> &model::instance::Model { &self.0.instance } @@ -123,15 +124,6 @@ impl Context { uriproxy::uri(self.base(), UriClass::Activity, id) } - // TODO remove this!! - //#[deprecated = "context is id of first post in thread"] - pub fn context_id(&self, id: &str) -> String { - if id.starts_with("tag:") { - return id.to_string(); - } - uriproxy::uri(self.base(), UriClass::Context, id) - } - /// get bare id, which is uuid for local stuff and +{uri|base64} for remote stuff pub fn id(&self, full_id: &str) -> String { if self.is_local(full_id) {