From: Felix Ableitner Date: Sat, 1 Aug 2020 13:25:17 +0000 (+0200) Subject: Update activitystreams to 0.7.0-alpha.3 (from crates.io) X-Git-Url: http://these/git/%7B%60%24%7BrepoUrl%7D/blob/master/docs/static/%7BrepoUrl%7D?a=commitdiff_plain;h=9a004c45350ffd738991bd206a10e9251fe3ed4b;p=lemmy.git Update activitystreams to 0.7.0-alpha.3 (from crates.io) --- diff --git a/server/Cargo.lock b/server/Cargo.lock index 3f19827b..90687982 100644 --- a/server/Cargo.lock +++ b/server/Cargo.lock @@ -1,26 +1,28 @@ # 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" +name = "activitystreams" +version = "0.7.0-alpha.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3490e8e9d7744aada19fb2fb4e2564f8c22fd080a3561093ac91ed7d10bfe78" dependencies = [ - "activitystreams-new", + "chrono", + "mime", "serde 1.0.114", "serde_json", + "thiserror", + "url", ] [[package]] -name = "activitystreams-new" -version = "0.1.0" -source = "git+https://yerbamate.dev/asonix/activitystreams-new?branch=main#857d5167dfa13054dd0d21d3d54f8147eea0d546" +name = "activitystreams-ext" +version = "0.1.0-alpha.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb8e19a0810cc25df3535061a08b7d8f8a734d309ea4411c57a9767e4a2ffa0e" dependencies = [ - "chrono", - "mime", + "activitystreams", "serde 1.0.114", "serde_json", - "thiserror", - "url", ] [[package]] @@ -1726,8 +1728,8 @@ dependencies = [ name = "lemmy_server" version = "0.0.1" dependencies = [ + "activitystreams", "activitystreams-ext", - "activitystreams-new", "actix", "actix-files", "actix-rt", diff --git a/server/Cargo.toml b/server/Cargo.toml index 3a652f29..d245cf4d 100644 --- a/server/Cargo.toml +++ b/server/Cargo.toml @@ -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"]} diff --git a/server/src/apub/activities.rs b/server/src/apub/activities.rs index a622c691..9fdfe37f 100644 --- a/server/src/apub/activities.rs +++ b/server/src/apub/activities.rs @@ -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}; diff --git a/server/src/apub/comment.rs b/server/src/apub/comment.rs index 650c6057..05b40dbe 100644 --- a/server/src/apub/comment.rs +++ b/server/src/apub/comment.rs @@ -21,7 +21,7 @@ use crate::{ DbPool, LemmyError, }; -use activitystreams_new::{ +use activitystreams::{ activity::{ kind::{CreateType, DeleteType, DislikeType, LikeType, RemoveType, UndoType, UpdateType}, Create, diff --git a/server/src/apub/community.rs b/server/src/apub/community.rs index 584ef310..96f0f84c 100644 --- a/server/src/apub/community.rs +++ b/server/src/apub/community.rs @@ -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); diff --git a/server/src/apub/extensions/group_extensions.rs b/server/src/apub/extensions/group_extensions.rs index 7dc42c4a..3099a273 100644 --- a/server/src/apub/extensions/group_extensions.rs +++ b/server/src/apub/extensions/group_extensions.rs @@ -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}; diff --git a/server/src/apub/extensions/page_extension.rs b/server/src/apub/extensions/page_extension.rs index 3b0b89b5..aa3d0160 100644 --- a/server/src/apub/extensions/page_extension.rs +++ b/server/src/apub/extensions/page_extension.rs @@ -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)] diff --git a/server/src/apub/extensions/signatures.rs b/server/src/apub/extensions/signatures.rs index 5a1cdeb8..e37bde25 100644 --- a/server/src/apub/extensions/signatures.rs +++ b/server/src/apub/extensions/signatures.rs @@ -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}, diff --git a/server/src/apub/fetcher.rs b/server/src/apub/fetcher.rs index e2d505df..51f3a50b 100644 --- a/server/src/apub/fetcher.rs +++ b/server/src/apub/fetcher.rs @@ -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::(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?; diff --git a/server/src/apub/inbox/activities/announce.rs b/server/src/apub/inbox/activities/announce.rs index 78a005fb..8ca4856f 100644 --- a/server/src/apub/inbox/activities/announce.rs +++ b/server/src/apub/inbox/activities/announce.rs @@ -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( diff --git a/server/src/apub/inbox/activities/create.rs b/server/src/apub/inbox/activities/create.rs index 0f5595cd..f8a92c1c 100644 --- a/server/src/apub/inbox/activities/create.rs +++ b/server/src/apub/inbox/activities/create.rs @@ -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}, diff --git a/server/src/apub/inbox/activities/delete.rs b/server/src/apub/inbox/activities/delete.rs index b4fe0de4..4fb56d32 100644 --- a/server/src/apub/inbox/activities/delete.rs +++ b/server/src/apub/inbox/activities/delete.rs @@ -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}, diff --git a/server/src/apub/inbox/activities/dislike.rs b/server/src/apub/inbox/activities/dislike.rs index cb12724d..1e67d192 100644 --- a/server/src/apub/inbox/activities/dislike.rs +++ b/server/src/apub/inbox/activities/dislike.rs @@ -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}, diff --git a/server/src/apub/inbox/activities/like.rs b/server/src/apub/inbox/activities/like.rs index da92bbff..9061773d 100644 --- a/server/src/apub/inbox/activities/like.rs +++ b/server/src/apub/inbox/activities/like.rs @@ -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}, diff --git a/server/src/apub/inbox/activities/remove.rs b/server/src/apub/inbox/activities/remove.rs index af3d144b..485d2861 100644 --- a/server/src/apub/inbox/activities/remove.rs +++ b/server/src/apub/inbox/activities/remove.rs @@ -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}, diff --git a/server/src/apub/inbox/activities/undo.rs b/server/src/apub/inbox/activities/undo.rs index 33236484..6c90fc81 100644 --- a/server/src/apub/inbox/activities/undo.rs +++ b/server/src/apub/inbox/activities/undo.rs @@ -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}, diff --git a/server/src/apub/inbox/activities/update.rs b/server/src/apub/inbox/activities/update.rs index 5da262e1..9af1a2d3 100644 --- a/server/src/apub/inbox/activities/update.rs +++ b/server/src/apub/inbox/activities/update.rs @@ -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}, diff --git a/server/src/apub/inbox/community_inbox.rs b/server/src/apub/inbox/community_inbox.rs index 8088ec5c..337a8990 100644 --- a/server/src/apub/inbox/community_inbox.rs +++ b/server/src/apub/inbox/community_inbox.rs @@ -9,7 +9,7 @@ use crate::{ routes::{ChatServerParam, DbPoolParam}, LemmyError, }; -use activitystreams_new::{ +use activitystreams::{ activity::{Follow, Undo}, prelude::*, }; diff --git a/server/src/apub/inbox/shared_inbox.rs b/server/src/apub/inbox/shared_inbox.rs index 3a2d1c43..9e0cdb3d 100644 --- a/server/src/apub/inbox/shared_inbox.rs +++ b/server/src/apub/inbox/shared_inbox.rs @@ -23,7 +23,7 @@ use crate::{ DbPool, LemmyError, }; -use activitystreams_new::{ +use activitystreams::{ activity::{ActorAndObject, ActorAndObjectRef}, base::{AsBase, Extends}, object::AsObject, diff --git a/server/src/apub/inbox/user_inbox.rs b/server/src/apub/inbox/user_inbox.rs index be99d81a..b46f6702 100644 --- a/server/src/apub/inbox/user_inbox.rs +++ b/server/src/apub/inbox/user_inbox.rs @@ -12,7 +12,7 @@ use crate::{ DbPool, LemmyError, }; -use activitystreams_new::{ +use activitystreams::{ activity::{Accept, Create, Delete, Undo, Update}, object::Note, prelude::*, diff --git a/server/src/apub/mod.rs b/server/src/apub/mod.rs index feb1f30f..0af19dcd 100644 --- a/server/src/apub/mod.rs +++ b/server/src/apub/mod.rs @@ -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; diff --git a/server/src/apub/post.rs b/server/src/apub/post.rs index 39e4faf3..4b687b0a 100644 --- a/server/src/apub/post.rs +++ b/server/src/apub/post.rs @@ -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, diff --git a/server/src/apub/private_message.rs b/server/src/apub/private_message.rs index f58a6bfe..69f552d3 100644 --- a/server/src/apub/private_message.rs +++ b/server/src/apub/private_message.rs @@ -12,7 +12,7 @@ use crate::{ DbPool, LemmyError, }; -use activitystreams_new::{ +use activitystreams::{ activity::{ kind::{CreateType, DeleteType, UndoType, UpdateType}, Create, diff --git a/server/src/apub/user.rs b/server/src/apub/user.rs index 46320860..54e4552f 100644 --- a/server/src/apub/user.rs +++ b/server/src/apub/user.rs @@ -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,