Update activitystreams to 0.7.0-alpha.3 (from crates.io)

This commit is contained in:
Felix Ableitner 2020-08-01 15:25:17 +02:00
parent dc4ac6345c
commit 9a004c4535
24 changed files with 48 additions and 45 deletions

30
server/Cargo.lock generated vendored
View file

@ -1,19 +1,10 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
[[package]]
name = "activitystreams-ext"
version = "0.1.0"
source = "git+https://yerbamate.dev/asonix/activitystreams-ext?branch=main#2799a4c606467a2f577e1f45f93c6828ec83cfdf"
dependencies = [
"activitystreams-new",
"serde 1.0.114",
"serde_json",
]
[[package]]
name = "activitystreams-new"
version = "0.1.0"
source = "git+https://yerbamate.dev/asonix/activitystreams-new?branch=main#857d5167dfa13054dd0d21d3d54f8147eea0d546"
name = "activitystreams"
version = "0.7.0-alpha.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e3490e8e9d7744aada19fb2fb4e2564f8c22fd080a3561093ac91ed7d10bfe78"
dependencies = [
"chrono",
"mime",
@ -23,6 +14,17 @@ dependencies = [
"url",
]
[[package]]
name = "activitystreams-ext"
version = "0.1.0-alpha.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bb8e19a0810cc25df3535061a08b7d8f8a734d309ea4411c57a9767e4a2ffa0e"
dependencies = [
"activitystreams",
"serde 1.0.114",
"serde_json",
]
[[package]]
name = "actix"
version = "0.10.0-alpha.3"
@ -1726,8 +1728,8 @@ dependencies = [
name = "lemmy_server"
version = "0.0.1"
dependencies = [
"activitystreams",
"activitystreams-ext",
"activitystreams-new",
"actix",
"actix-files",
"actix-rt",

4
server/Cargo.toml vendored
View file

@ -18,8 +18,8 @@ lemmy_db = { path = "./lemmy_db" }
diesel = "1.4.4"
diesel_migrations = "1.4.0"
dotenv = "0.15.0"
activitystreams-new = { git = "https://yerbamate.dev/asonix/activitystreams-new", branch = "main" }
activitystreams-ext = { git = "https://yerbamate.dev/asonix/activitystreams-ext", branch = "main" }
activitystreams = "0.7.0-alpha.3"
activitystreams-ext = "0.1.0-alpha.2"
bcrypt = "0.8.0"
chrono = { version = "0.4.7", features = ["serde"] }
serde_json = { version = "1.0.52", features = ["preserve_order"]}

View file

@ -10,7 +10,7 @@ use crate::{
DbPool,
LemmyError,
};
use activitystreams_new::base::AnyBase;
use activitystreams::base::AnyBase;
use actix_web::client::Client;
use lemmy_db::{community::Community, user::User_};
use lemmy_utils::{get_apub_protocol_string, settings::Settings};

View file

@ -21,7 +21,7 @@ use crate::{
DbPool,
LemmyError,
};
use activitystreams_new::{
use activitystreams::{
activity::{
kind::{CreateType, DeleteType, DislikeType, LikeType, RemoveType, UndoType, UpdateType},
Create,

View file

@ -18,8 +18,7 @@ use crate::{
DbPool,
LemmyError,
};
use activitystreams_ext::Ext2;
use activitystreams_new::{
use activitystreams::{
activity::{
kind::{AcceptType, AnnounceType, DeleteType, LikeType, RemoveType, UndoType},
Accept,
@ -37,6 +36,7 @@ use activitystreams_new::{
prelude::*,
public,
};
use activitystreams_ext::Ext2;
use actix_web::{body::Body, client::Client, web, HttpResponse};
use itertools::Itertools;
use lemmy_db::{
@ -403,7 +403,7 @@ pub async fn get_apub_community_followers(
})
.await??;
let mut collection = UnorderedCollection::new(vec![]);
let mut collection = UnorderedCollection::new();
collection
.set_context(context())
// TODO: this needs its own ID
@ -433,8 +433,9 @@ pub async fn get_apub_community_outbox(
}
let len = pages.len();
let mut collection = OrderedCollection::new(pages);
let mut collection = OrderedCollection::new();
collection
.set_many_items(pages)
.set_context(context())
.set_id(community.get_outbox_url()?)
.set_total_items(len as u64);

View file

@ -1,6 +1,6 @@
use crate::LemmyError;
use activitystreams::unparsed::UnparsedMutExt;
use activitystreams_ext::UnparsedExtension;
use activitystreams_new::unparsed::UnparsedMutExt;
use diesel::PgConnection;
use lemmy_db::{category::Category, Crud};
use serde::{Deserialize, Serialize};

View file

@ -1,5 +1,5 @@
use activitystreams::unparsed::UnparsedMutExt;
use activitystreams_ext::UnparsedExtension;
use activitystreams_new::unparsed::UnparsedMutExt;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, Default, Deserialize, Serialize)]

View file

@ -1,6 +1,6 @@
use crate::{apub::ActorType, LemmyError};
use activitystreams::unparsed::UnparsedMutExt;
use activitystreams_ext::UnparsedExtension;
use activitystreams_new::unparsed::UnparsedMutExt;
use actix_web::{client::ClientRequest, HttpRequest};
use http_signature_normalization_actix::{
digest::{DigestClient, SignExt},

View file

@ -15,7 +15,7 @@ use crate::{
DbPool,
LemmyError,
};
use activitystreams_new::{base::BaseExt, collection::OrderedCollection, object::Note, prelude::*};
use activitystreams::{base::BaseExt, collection::OrderedCollection, object::Note, prelude::*};
use actix_web::client::Client;
use chrono::NaiveDateTime;
use diesel::{result::Error::NotFound, PgConnection};
@ -348,7 +348,7 @@ async fn fetch_remote_community(
// fetch outbox (maybe make this conditional)
let outbox =
fetch_remote_object::<OrderedCollection>(client, &community.get_outbox_url()?).await?;
let outbox_items = outbox.items().clone();
let outbox_items = outbox.items().unwrap().clone();
for o in outbox_items.many().unwrap() {
let page = PageExt::from_any_base(o)?.unwrap();
let post = PostForm::from_apub(&page, client, pool).await?;

View file

@ -15,7 +15,7 @@ use crate::{
DbPool,
LemmyError,
};
use activitystreams_new::{activity::*, base::AnyBase, prelude::ExtendsExt};
use activitystreams::{activity::*, base::AnyBase, prelude::ExtendsExt};
use actix_web::{client::Client, HttpResponse};
pub async fn receive_announce(

View file

@ -21,7 +21,7 @@ use crate::{
DbPool,
LemmyError,
};
use activitystreams_new::{activity::Create, base::AnyBase, object::Note, prelude::*};
use activitystreams::{activity::Create, base::AnyBase, object::Note, prelude::*};
use actix_web::{client::Client, HttpResponse};
use lemmy_db::{
comment::{Comment, CommentForm},

View file

@ -20,7 +20,7 @@ use crate::{
DbPool,
LemmyError,
};
use activitystreams_new::{activity::Delete, base::AnyBase, object::Note, prelude::*};
use activitystreams::{activity::Delete, base::AnyBase, object::Note, prelude::*};
use actix_web::{client::Client, HttpResponse};
use lemmy_db::{
comment::{Comment, CommentForm},

View file

@ -19,7 +19,7 @@ use crate::{
DbPool,
LemmyError,
};
use activitystreams_new::{activity::Dislike, base::AnyBase, object::Note, prelude::*};
use activitystreams::{activity::Dislike, base::AnyBase, object::Note, prelude::*};
use actix_web::{client::Client, HttpResponse};
use lemmy_db::{
comment::{CommentForm, CommentLike, CommentLikeForm},

View file

@ -19,7 +19,7 @@ use crate::{
DbPool,
LemmyError,
};
use activitystreams_new::{activity::Like, base::AnyBase, object::Note, prelude::*};
use activitystreams::{activity::Like, base::AnyBase, object::Note, prelude::*};
use actix_web::{client::Client, HttpResponse};
use lemmy_db::{
comment::{CommentForm, CommentLike, CommentLikeForm},

View file

@ -20,7 +20,7 @@ use crate::{
DbPool,
LemmyError,
};
use activitystreams_new::{activity::Remove, base::AnyBase, object::Note, prelude::*};
use activitystreams::{activity::Remove, base::AnyBase, object::Note, prelude::*};
use actix_web::{client::Client, HttpResponse};
use lemmy_db::{
comment::{Comment, CommentForm},

View file

@ -20,7 +20,7 @@ use crate::{
DbPool,
LemmyError,
};
use activitystreams_new::{activity::*, base::AnyBase, object::Note, prelude::*};
use activitystreams::{activity::*, base::AnyBase, object::Note, prelude::*};
use actix_web::{client::Client, HttpResponse};
use lemmy_db::{
comment::{Comment, CommentForm, CommentLike, CommentLikeForm},

View file

@ -22,7 +22,7 @@ use crate::{
DbPool,
LemmyError,
};
use activitystreams_new::{activity::Update, base::AnyBase, object::Note, prelude::*};
use activitystreams::{activity::Update, base::AnyBase, object::Note, prelude::*};
use actix_web::{client::Client, HttpResponse};
use lemmy_db::{
comment::{Comment, CommentForm},

View file

@ -9,7 +9,7 @@ use crate::{
routes::{ChatServerParam, DbPoolParam},
LemmyError,
};
use activitystreams_new::{
use activitystreams::{
activity::{Follow, Undo},
prelude::*,
};

View file

@ -23,7 +23,7 @@ use crate::{
DbPool,
LemmyError,
};
use activitystreams_new::{
use activitystreams::{
activity::{ActorAndObject, ActorAndObjectRef},
base::{AsBase, Extends},
object::AsObject,

View file

@ -12,7 +12,7 @@ use crate::{
DbPool,
LemmyError,
};
use activitystreams_new::{
use activitystreams::{
activity::{Accept, Create, Delete, Undo, Update},
object::Note,
prelude::*,

View file

@ -20,13 +20,13 @@ use crate::{
DbPool,
LemmyError,
};
use activitystreams_ext::{Ext1, Ext2};
use activitystreams_new::{
use activitystreams::{
activity::Follow,
actor::{ApActor, Group, Person},
object::{Page, Tombstone},
prelude::*,
};
use activitystreams_ext::{Ext1, Ext2};
use actix_web::{body::Body, client::Client, HttpResponse};
use chrono::NaiveDateTime;
use failure::_core::fmt::Debug;

View file

@ -18,8 +18,7 @@ use crate::{
DbPool,
LemmyError,
};
use activitystreams_ext::Ext1;
use activitystreams_new::{
use activitystreams::{
activity::{
kind::{CreateType, DeleteType, DislikeType, LikeType, RemoveType, UndoType, UpdateType},
Create,
@ -35,6 +34,7 @@ use activitystreams_new::{
prelude::*,
public,
};
use activitystreams_ext::Ext1;
use actix_web::{body::Body, client::Client, web, HttpResponse};
use lemmy_db::{
community::Community,

View file

@ -12,7 +12,7 @@ use crate::{
DbPool,
LemmyError,
};
use activitystreams_new::{
use activitystreams::{
activity::{
kind::{CreateType, DeleteType, UndoType, UpdateType},
Create,

View file

@ -13,8 +13,7 @@ use crate::{
DbPool,
LemmyError,
};
use activitystreams_ext::Ext1;
use activitystreams_new::{
use activitystreams::{
activity::{
kind::{FollowType, UndoType},
Follow,
@ -25,6 +24,7 @@ use activitystreams_new::{
object::{Image, Tombstone},
prelude::*,
};
use activitystreams_ext::Ext1;
use actix_web::{body::Body, client::Client, web, HttpResponse};
use lemmy_db::{
naive_now,