]> Untitled Git - lemmy.git/commitdiff
migrate tombstone
authorFelix Ableitner <me@nutomic.com>
Wed, 3 Jun 2020 15:10:16 +0000 (17:10 +0200)
committerFelix Ableitner <me@nutomic.com>
Wed, 3 Jun 2020 15:10:16 +0000 (17:10 +0200)
server/src/apub/comment.rs
server/src/apub/community.rs
server/src/apub/mod.rs
server/src/apub/post.rs
server/src/apub/private_message.rs
server/src/apub/user.rs

index 7c77a1c7885a46812cb76173c64b31e14d0d54a6..d18908d0e84a270720e70a097f15999b5c07532f 100644 (file)
@@ -28,8 +28,9 @@ use activitystreams::{
   activity::{Create, Delete, Dislike, Like, Remove, Undo, Update},
   context,
   link::Mention,
-  object::{kind::NoteType, properties::ObjectProperties, Note, Tombstone},
+  object::{kind::NoteType, properties::ObjectProperties, Note},
 };
+use activitystreams_new::object::Tombstone;
 use actix_web::{body::Body, web::Path, HttpResponse, Result};
 use diesel::PgConnection;
 use failure::Error;
index a81e21cfa321e3c66cc5046477cadea6a0d39264..79615aca74d2f6e39d6bd2e2e862d9a6f2213982 100644 (file)
@@ -28,12 +28,13 @@ use activitystreams::{
   collection::UnorderedCollection,
   context,
   endpoint::EndpointProperties,
-  object::{properties::ObjectProperties, Tombstone},
+  object::properties::ObjectProperties,
   Activity,
   Base,
   BaseBox,
 };
 use activitystreams_ext::Ext3;
+use activitystreams_new::object::Tombstone;
 use actix_web::{body::Body, web::Path, HttpResponse, Result};
 use diesel::PgConnection;
 use failure::{Error, _core::fmt::Debug};
index 805e6a0c3236b7f121aa8241ee50452463566f79..5260e3098a7bbddb65be3f8d186ce7f4d4d5244a 100644 (file)
@@ -25,9 +25,14 @@ use crate::{
 use activitystreams::{
   activity::Follow,
   actor::{properties::ApActorProperties, Group, Person},
-  object::{Page, Tombstone},
+  object::Page,
 };
 use activitystreams_ext::{Ext1, Ext2, Ext3};
+use activitystreams_new::{
+  base::BaseExt,
+  object::{Tombstone, TombstoneExt},
+  primitives::XsdString,
+};
 use actix_web::{body::Body, HttpResponse, Result};
 use chrono::NaiveDateTime;
 use diesel::PgConnection;
@@ -132,12 +137,10 @@ fn create_tombstone(
 ) -> Result<Tombstone, Error> {
   if deleted {
     if let Some(updated) = updated {
-      let mut tombstone = Tombstone::default();
-      tombstone.object_props.set_id(object_id)?;
-      tombstone
-        .tombstone_props
-        .set_former_type_xsd_string(former_type)?
-        .set_deleted(convert_datetime(updated))?;
+      let mut tombstone = Tombstone::new();
+      tombstone.set_id(object_id.parse()?);
+      tombstone.set_former_type(former_type.parse::<XsdString>()?);
+      tombstone.set_deleted(convert_datetime(updated).into());
       Ok(tombstone)
     } else {
       Err(format_err!(
index f53af309123c2b673809bdd8493abc03355a34b3..3f86d34d1132ae21ace8a9f8ee835ed55c8503e9 100644 (file)
@@ -27,10 +27,11 @@ use crate::{
 use activitystreams::{
   activity::{Create, Delete, Dislike, Like, Remove, Undo, Update},
   context,
-  object::{kind::PageType, properties::ObjectProperties, AnyImage, Image, Page, Tombstone},
+  object::{kind::PageType, properties::ObjectProperties, AnyImage, Image, Page},
   BaseBox,
 };
 use activitystreams_ext::Ext1;
+use activitystreams_new::object::Tombstone;
 use actix_web::{body::Body, web::Path, HttpResponse, Result};
 use diesel::PgConnection;
 use failure::Error;
index a222b1fef4ea172ba866ef9ead9a3779b6ce8131..a700043ba4ba32f6612530092c6a6d726e0a1586 100644 (file)
@@ -18,8 +18,9 @@ use crate::{
 use activitystreams::{
   activity::{Create, Delete, Undo, Update},
   context,
-  object::{kind::NoteType, properties::ObjectProperties, Note, Tombstone},
+  object::{kind::NoteType, properties::ObjectProperties, Note},
 };
+use activitystreams_new::object::Tombstone;
 use actix_web::Result;
 use diesel::PgConnection;
 use failure::Error;
index 0a651d1fe356c80140778b4b2efe9e2db230df73..77b012fddc0f6dba4919510994e379954e9ae56c 100644 (file)
@@ -21,9 +21,10 @@ use activitystreams::{
   actor::{properties::ApActorProperties, Person},
   context,
   endpoint::EndpointProperties,
-  object::{properties::ObjectProperties, AnyImage, Image, Tombstone},
+  object::{properties::ObjectProperties, AnyImage, Image},
 };
 use activitystreams_ext::Ext2;
+use activitystreams_new::object::Tombstone;
 use actix_web::{body::Body, web::Path, HttpResponse, Result};
 use diesel::PgConnection;
 use failure::Error;