]> Untitled Git - lemmy.git/commitdiff
update activitystreams lib
authorFelix <me@nutomic.com>
Thu, 30 Apr 2020 16:30:01 +0000 (18:30 +0200)
committerFelix <me@nutomic.com>
Thu, 30 Apr 2020 16:30:01 +0000 (18:30 +0200)
server/Cargo.lock
server/Cargo.toml
server/src/apub/mod.rs
server/src/apub/shared_inbox.rs

index 56e81b4763ea22c2e18e916c230612cf21483242..714422b64f49d29c45da7f670478e1d8f26dc771 100644 (file)
@@ -2,9 +2,9 @@
 # It is not intended for manual editing.
 [[package]]
 name = "activitystreams"
-version = "0.5.0"
+version = "0.6.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ae98a55a86fc3150f278b225644cd46b5359f4d75067eae6dc3a52b409c537fb"
+checksum = "dd5b29a0f2c64cc56f2b79ec29cab68a9dab3b714d811a55668d072f18a8638e"
 dependencies = [
  "activitystreams-derive",
  "chrono",
@@ -17,9 +17,9 @@ dependencies = [
 
 [[package]]
 name = "activitystreams-derive"
-version = "0.5.0"
+version = "0.6.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "20d0384ae423a1df266f216e351ce9b40e8d369467d9242c086121154b4327dd"
+checksum = "985d3ca1ee226e83f4118e0235bc11d9fce39c4eec8d53739a21b01dd0b3f30f"
 dependencies = [
  "proc-macro2",
  "quote",
index 2777dd2c7d4021ce7a2c14dcd3c2a4fa90a8a027..ab76d06fa11b1f85daf0da7f7a260a3f6c9f226e 100644 (file)
@@ -8,7 +8,7 @@ edition = "2018"
 diesel = { version = "1.4.4", features = ["postgres","chrono","r2d2","64-column-tables","serde_json"] }
 diesel_migrations = "1.4.0"
 dotenv = "0.15.0"
-activitystreams = "0.5.0-alpha.16"
+activitystreams = "0.6.0"
 bcrypt = "0.6.2"
 chrono = { version = "0.4.7", features = ["serde"] }
 failure = "0.1.5"
index f72eb17e3bf981b7e128cf0193b2e434e45eb4ac..03c43bdc23b09f3ecdc3c5a16cbcd2723068633d 100644 (file)
@@ -67,7 +67,6 @@ use chrono::NaiveDateTime;
 use fetcher::{get_or_fetch_and_upsert_remote_community, get_or_fetch_and_upsert_remote_user};
 use signatures::verify;
 use signatures::{sign, PublicKey, PublicKeyExtension};
-use activitystreams::primitives::XsdString;
 
 type GroupExt = Ext<Ext<Group, ApActorProperties>, PublicKeyExtension>;
 type PersonExt = Ext<Ext<Person, ApActorProperties>, PublicKeyExtension>;
@@ -171,13 +170,13 @@ fn create_tombstone(
     tombstone
       .object_props
       .set_id(object_id)?
-      .set_published(convert_datetime(published));
+      .set_published(convert_datetime(published))?;
     if let Some(updated) = updated {
       tombstone
         .object_props
         .set_updated(convert_datetime(updated))?;
     }
-    tombstone.tombstone_props.set_former_type_object_box(XsdString::from_string(former_type))?;
+    tombstone.tombstone_props.set_former_type_xsd_string(former_type)?;
     Ok(tombstone)
   } else {
     Err(format_err!(
index 692e6f2b1929a65bd0afc9a5493a731698f1e844..7d3826f22f54f58c0113378764d430e5fbe8abe5 100644 (file)
@@ -82,7 +82,7 @@ fn receive_create_post(
     .to_owned()
     .unwrap()
     .to_owned()
-    .to_concrete::<Page>()?;
+    .into_concrete::<Page>()?;
 
   let user_uri = create
     .create_props
@@ -131,7 +131,7 @@ fn receive_create_comment(
     .to_owned()
     .unwrap()
     .to_owned()
-    .to_concrete::<Note>()?;
+    .into_concrete::<Note>()?;
 
   let user_uri = create
     .create_props
@@ -185,7 +185,7 @@ fn receive_update_post(
     .to_owned()
     .unwrap()
     .to_owned()
-    .to_concrete::<Page>()?;
+    .into_concrete::<Page>()?;
 
   let user_uri = update
     .update_props
@@ -235,7 +235,7 @@ fn receive_like_post(
     .to_owned()
     .unwrap()
     .to_owned()
-    .to_concrete::<Page>()?;
+    .into_concrete::<Page>()?;
 
   let user_uri = like.like_props.get_actor_xsd_any_uri().unwrap().to_string();
 
@@ -288,7 +288,7 @@ fn receive_dislike_post(
     .to_owned()
     .unwrap()
     .to_owned()
-    .to_concrete::<Page>()?;
+    .into_concrete::<Page>()?;
 
   let user_uri = dislike
     .dislike_props
@@ -345,7 +345,7 @@ fn receive_update_comment(
     .to_owned()
     .unwrap()
     .to_owned()
-    .to_concrete::<Note>()?;
+    .into_concrete::<Note>()?;
 
   let user_uri = update
     .update_props
@@ -400,7 +400,7 @@ fn receive_like_comment(
     .to_owned()
     .unwrap()
     .to_owned()
-    .to_concrete::<Note>()?;
+    .into_concrete::<Note>()?;
 
   let user_uri = like.like_props.get_actor_xsd_any_uri().unwrap().to_string();
 
@@ -458,7 +458,7 @@ fn receive_dislike_comment(
     .to_owned()
     .unwrap()
     .to_owned()
-    .to_concrete::<Note>()?;
+    .into_concrete::<Note>()?;
 
   let user_uri = dislike
     .dislike_props
@@ -520,11 +520,10 @@ fn receive_delete(
     .to_owned()
     .unwrap()
     .to_owned()
-    .to_concrete::<Tombstone>()?;
-  // TODO: not sure how to handle formerType (should be a string)
-  // https://www.w3.org/TR/activitystreams-vocabulary/#dfn-formertype
-  let former_type: &str = tombstone.tombstone_props.get_former_type_object_box().unwrap().to_concrete::<String>();
-  match former_type {
+    .into_concrete::<Tombstone>()?;
+  let former_type = tombstone.tombstone_props.get_former_type_xsd_string().unwrap().to_string();
+  // TODO: handle these
+  match former_type.as_str() {
     "Group" => {},
     d => return Err(format_err!("Delete type {} not supported", d)),
   }