From f0d7d793cab361a75ba3829cb2a5dfb1016b6b1a Mon Sep 17 00:00:00 2001 From: Riley Apeldoorn Date: Fri, 3 May 2024 17:16:59 +0200 Subject: [PATCH] Use LEGACY fetch mode for better compat --- lib/fetch/src/client.rs | 4 ++-- lib/fetch/src/object.rs | 8 ++++---- lib/puppy/src/lib.rs | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/fetch/src/client.rs b/lib/fetch/src/client.rs index 7cebb09..aef41c6 100644 --- a/lib/fetch/src/client.rs +++ b/lib/fetch/src/client.rs @@ -48,7 +48,7 @@ impl Client { .body(()) .unwrap(); - key.sign(Options::MODERN, &req) + key.sign(Options::LEGACY, &req) .map_err(FetchError::Sig)? .commit(&mut req); @@ -82,7 +82,7 @@ impl Client { .unwrap(); println!("[{system}]: using modern config"); - key.sign(Options::MODERN, &req) + key.sign(Options::LEGACY, &req) .expect("signing error") .commit(&mut req); diff --git a/lib/fetch/src/object.rs b/lib/fetch/src/object.rs index 4449062..caffc69 100644 --- a/lib/fetch/src/object.rs +++ b/lib/fetch/src/object.rs @@ -23,8 +23,8 @@ where ], "id": self.id.to_string(), "actor": self.actor.to_string(), + "object": self.object.to_json_ld(), "type": self.kind.to_string(), - "object": self.object.to_json_ld() }) } } @@ -69,7 +69,7 @@ impl Actor { pub enum Object { Activity(Activity), Actor(Actor), - Object { + Other { id: String, kind: String, content: Option, @@ -82,14 +82,14 @@ impl Object { match self { Object::Activity(a) => &a.id, Object::Actor(a) => &a.id, - Object::Object { id, .. } => id, + Object::Other { id, .. } => id, } } pub fn to_json_ld(&self) -> Value { match self { Object::Activity(a) => a.to_json_ld(), Object::Actor(a) => a.to_json_ld(), - Object::Object { id, kind, content, summary } => json!({ + Object::Other { id, kind, content, summary } => json!({ "id": id.to_string(), "type": kind, "content": content, diff --git a/lib/puppy/src/lib.rs b/lib/puppy/src/lib.rs index 39102bd..fc5a12d 100644 --- a/lib/puppy/src/lib.rs +++ b/lib/puppy/src/lib.rs @@ -76,7 +76,7 @@ pub fn get_local_ap_object(tx: &Transaction<'_>, key: Key) -> Result