fix: context is an oid
This commit is contained in:
parent
e6a687d427
commit
292cfe9011
2 changed files with 3 additions and 11 deletions
|
@ -9,7 +9,7 @@ pub async fn get(
|
|||
AuthIdentity(auth): AuthIdentity,
|
||||
) -> crate::Result<JsonLD<serde_json::Value>> {
|
||||
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<Pagination>,
|
||||
AuthIdentity(auth): AuthIdentity,
|
||||
) -> crate::Result<JsonLD<serde_json::Value>> {
|
||||
let context = ctx.context_id(&id);
|
||||
let context = ctx.oid(&id);
|
||||
|
||||
crate::server::builders::paginate(
|
||||
url!(ctx, "/context/{id}/page"),
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue