diff options
author | Felix Ableitner <me@nutomic.com> | 2020-07-03 14:20:28 +0200 |
---|---|---|
committer | Felix Ableitner <me@nutomic.com> | 2020-07-08 18:01:04 +0200 |
commit | c9338027f26170dffc95a052ecfc3def1bf3a729 (patch) | |
tree | b8232ba826f4ef016d61efbb9f4c22201d95e5ac /server/src/apub/shared_inbox.rs | |
parent | d03c435563be5a4ba564749785e90067aee41858 (diff) |
Migrate user and group to new activitystreams library
Diffstat (limited to 'server/src/apub/shared_inbox.rs')
-rw-r--r-- | server/src/apub/shared_inbox.rs | 88 |
1 files changed, 44 insertions, 44 deletions
diff --git a/server/src/apub/shared_inbox.rs b/server/src/apub/shared_inbox.rs index 66773252..fa9794b2 100644 --- a/server/src/apub/shared_inbox.rs +++ b/server/src/apub/shared_inbox.rs @@ -335,7 +335,7 @@ async fn receive_create_post( pool: &DbPool, chat_server: ChatServerParam, ) -> Result<HttpResponse, LemmyError> { - let page = create + let mut page = create .create_props .get_object_base_box() .to_owned() @@ -353,7 +353,7 @@ async fn receive_create_post( insert_activity(user.id, create, false, pool).await?; - let post = PostForm::from_apub(&page, client, pool).await?; + let post = PostForm::from_apub(&mut page, client, pool).await?; let inserted_post = blocking(pool, move |conn| Post::create(conn, &post)).await??; @@ -381,7 +381,7 @@ async fn receive_create_comment( pool: &DbPool, chat_server: ChatServerParam, ) -> Result<HttpResponse, LemmyError> { - let note = create + let mut note = create .create_props .get_object_base_box() .to_owned() @@ -399,7 +399,7 @@ async fn receive_create_comment( insert_activity(user.id, create, false, pool).await?; - let comment = CommentForm::from_apub(¬e, client, pool).await?; + let comment = CommentForm::from_apub(&mut note, client, pool).await?; let inserted_comment = blocking(pool, move |conn| Comment::create(conn, &comment)).await??; @@ -440,7 +440,7 @@ async fn receive_update_post( pool: &DbPool, chat_server: ChatServerParam, ) -> Result<HttpResponse, LemmyError> { - let page = update + let mut page = update .update_props .get_object_base_box() .to_owned() @@ -458,7 +458,7 @@ async fn receive_update_post( insert_activity(user.id, update, false, pool).await?; - let post = PostForm::from_apub(&page, client, pool).await?; + let post = PostForm::from_apub(&mut page, client, pool).await?; let post_id = get_or_fetch_and_insert_remote_post(&post.ap_id, client, pool) .await? @@ -486,7 +486,7 @@ async fn receive_like_post( pool: &DbPool, chat_server: ChatServerParam, ) -> Result<HttpResponse, LemmyError> { - let page = like + let mut page = like .like_props .get_object_base_box() .to_owned() @@ -500,7 +500,7 @@ async fn receive_like_post( insert_activity(user.id, like, false, pool).await?; - let post = PostForm::from_apub(&page, client, pool).await?; + let post = PostForm::from_apub(&mut page, client, pool).await?; let post_id = get_or_fetch_and_insert_remote_post(&post.ap_id, client, pool) .await? @@ -537,7 +537,7 @@ async fn receive_dislike_post( pool: &DbPool, chat_server: ChatServerParam, ) -> Result<HttpResponse, LemmyError> { - let page = dislike + let mut page = dislike .dislike_props .get_object_base_box() .to_owned() @@ -555,7 +555,7 @@ async fn receive_dislike_post( insert_activity(user.id, dislike, false, pool).await?; - let post = PostForm::from_apub(&page, client, pool).await?; + let post = PostForm::from_apub(&mut page, client, pool).await?; let post_id = get_or_fetch_and_insert_remote_post(&post.ap_id, client, pool) .await? @@ -592,7 +592,7 @@ async fn receive_update_comment( pool: &DbPool, chat_server: ChatServerParam, ) -> Result<HttpResponse, LemmyError> { - let note = update + let mut note = update .update_props .get_object_base_box() .to_owned() @@ -610,7 +610,7 @@ async fn receive_update_comment( insert_activity(user.id, update, false, pool).await?; - let comment = CommentForm::from_apub(¬e, client, pool).await?; + let comment = CommentForm::from_apub(&mut note, client, pool).await?; let comment_id = get_or_fetch_and_insert_remote_comment(&comment.ap_id, client, pool) .await? @@ -651,7 +651,7 @@ async fn receive_like_comment( pool: &DbPool, chat_server: ChatServerParam, ) -> Result<HttpResponse, LemmyError> { - let note = like + let mut note = like .like_props .get_object_base_box() .to_owned() @@ -665,7 +665,7 @@ async fn receive_like_comment( insert_activity(user.id, like, false, pool).await?; - let comment = CommentForm::from_apub(¬e, client, pool).await?; + let comment = CommentForm::from_apub(&mut note, client, pool).await?; let comment_id = get_or_fetch_and_insert_remote_comment(&comment.ap_id, client, pool) .await? @@ -709,7 +709,7 @@ async fn receive_dislike_comment( pool: &DbPool, chat_server: ChatServerParam, ) -> Result<HttpResponse, LemmyError> { - let note = dislike + let mut note = dislike .dislike_props .get_object_base_box() .to_owned() @@ -727,7 +727,7 @@ async fn receive_dislike_comment( insert_activity(user.id, dislike, false, pool).await?; - let comment = CommentForm::from_apub(¬e, client, pool).await?; + let comment = CommentForm::from_apub(&mut note, client, pool).await?; let comment_id = get_or_fetch_and_insert_remote_comment(&comment.ap_id, client, pool) .await? @@ -777,7 +777,7 @@ async fn receive_delete_community( .unwrap() .to_string(); - let group = delete + let mut group = delete .delete_props .get_object_base_box() .to_owned() @@ -789,7 +789,7 @@ async fn receive_delete_community( insert_activity(user.id, delete, false, pool).await?; - let community_actor_id = CommunityForm::from_apub(&group, client, pool) + let community_actor_id = CommunityForm::from_apub(&mut group, client, pool) .await? .actor_id; @@ -854,7 +854,7 @@ async fn receive_remove_community( .unwrap() .to_string(); - let group = remove + let mut group = remove .remove_props .get_object_base_box() .to_owned() @@ -866,7 +866,7 @@ async fn receive_remove_community( insert_activity(mod_.id, remove, false, pool).await?; - let community_actor_id = CommunityForm::from_apub(&group, client, pool) + let community_actor_id = CommunityForm::from_apub(&mut group, client, pool) .await? .actor_id; @@ -931,7 +931,7 @@ async fn receive_delete_post( .unwrap() .to_string(); - let page = delete + let mut page = delete .delete_props .get_object_base_box() .to_owned() @@ -943,7 +943,7 @@ async fn receive_delete_post( insert_activity(user.id, delete, false, pool).await?; - let post_ap_id = PostForm::from_apub(&page, client, pool).await?.ap_id; + let post_ap_id = PostForm::from_apub(&mut page, client, pool).await?.ap_id; let post = get_or_fetch_and_insert_remote_post(&post_ap_id, client, pool).await?; @@ -997,7 +997,7 @@ async fn receive_remove_post( .unwrap() .to_string(); - let page = remove + let mut page = remove .remove_props .get_object_base_box() .to_owned() @@ -1009,7 +1009,7 @@ async fn receive_remove_post( insert_activity(mod_.id, remove, false, pool).await?; - let post_ap_id = PostForm::from_apub(&page, client, pool).await?.ap_id; + let post_ap_id = PostForm::from_apub(&mut page, client, pool).await?.ap_id; let post = get_or_fetch_and_insert_remote_post(&post_ap_id, client, pool).await?; @@ -1063,7 +1063,7 @@ async fn receive_delete_comment( .unwrap() .to_string(); - let note = delete + let mut note = delete .delete_props .get_object_base_box() .to_owned() @@ -1075,7 +1075,7 @@ async fn receive_delete_comment( insert_activity(user.id, delete, false, pool).await?; - let comment_ap_id = CommentForm::from_apub(¬e, client, pool).await?.ap_id; + let comment_ap_id = CommentForm::from_apub(&mut note, client, pool).await?.ap_id; let comment = get_or_fetch_and_insert_remote_comment(&comment_ap_id, client, pool).await?; @@ -1131,7 +1131,7 @@ async fn receive_remove_comment( .unwrap() .to_string(); - let note = remove + let mut note = remove .remove_props .get_object_base_box() .to_owned() @@ -1143,7 +1143,7 @@ async fn receive_remove_comment( insert_activity(mod_.id, remove, false, pool).await?; - let comment_ap_id = CommentForm::from_apub(¬e, client, pool).await?.ap_id; + let comment_ap_id = CommentForm::from_apub(&mut note, client, pool).await?.ap_id; let comment = get_or_fetch_and_insert_remote_comment(&comment_ap_id, client, pool).await?; @@ -1259,7 +1259,7 @@ async fn receive_undo_delete_comment( .unwrap() .to_string(); - let note = delete + let mut note = delete .delete_props .get_object_base_box() .to_owned() @@ -1271,7 +1271,7 @@ async fn receive_undo_delete_comment( insert_activity(user.id, delete, false, pool).await?; - let comment_ap_id = CommentForm::from_apub(¬e, client, pool).await?.ap_id; + let comment_ap_id = CommentForm::from_apub(&mut note, client, pool).await?.ap_id; let comment = get_or_fetch_and_insert_remote_comment(&comment_ap_id, client, pool).await?; @@ -1327,7 +1327,7 @@ async fn receive_undo_remove_comment( .unwrap() .to_string(); - let note = remove + let mut note = remove .remove_props .get_object_base_box() .to_owned() @@ -1339,7 +1339,7 @@ async fn receive_undo_remove_comment( insert_activity(mod_.id, remove, false, pool).await?; - let comment_ap_id = CommentForm::from_apub(¬e, client, pool).await?.ap_id; + let comment_ap_id = CommentForm::from_apub(&mut note, client, pool).await?.ap_id; let comment = get_or_fetch_and_insert_remote_comment(&comment_ap_id, client, pool).await?; @@ -1395,7 +1395,7 @@ async fn receive_undo_delete_post( .unwrap() .to_string(); - let page = delete + let mut page = delete .delete_props .get_object_base_box() .to_owned() @@ -1407,7 +1407,7 @@ async fn receive_undo_delete_post( insert_activity(user.id, delete, false, pool).await?; - let post_ap_id = PostForm::from_apub(&page, client, pool).await?.ap_id; + let post_ap_id = PostForm::from_apub(&mut page, client, pool).await?.ap_id; let post = get_or_fetch_and_insert_remote_post(&post_ap_id, client, pool).await?; @@ -1461,7 +1461,7 @@ async fn receive_undo_remove_post( .unwrap() .to_string(); - let page = remove + let mut page = remove .remove_props .get_object_base_box() .to_owned() @@ -1473,7 +1473,7 @@ async fn receive_undo_remove_post( insert_activity(mod_.id, remove, false, pool).await?; - let post_ap_id = PostForm::from_apub(&page, client, pool).await?.ap_id; + let post_ap_id = PostForm::from_apub(&mut page, client, pool).await?.ap_id; let post = get_or_fetch_and_insert_remote_post(&post_ap_id, client, pool).await?; @@ -1527,7 +1527,7 @@ async fn receive_undo_delete_community( .unwrap() .to_string(); - let group = delete + let mut group = delete .delete_props .get_object_base_box() .to_owned() @@ -1539,7 +1539,7 @@ async fn receive_undo_delete_community( insert_activity(user.id, delete, false, pool).await?; - let community_actor_id = CommunityForm::from_apub(&group, client, pool) + let community_actor_id = CommunityForm::from_apub(&mut group, client, pool) .await? .actor_id; @@ -1604,7 +1604,7 @@ async fn receive_undo_remove_community( .unwrap() .to_string(); - let group = remove + let mut group = remove .remove_props .get_object_base_box() .to_owned() @@ -1616,7 +1616,7 @@ async fn receive_undo_remove_community( insert_activity(mod_.id, remove, false, pool).await?; - let community_actor_id = CommunityForm::from_apub(&group, client, pool) + let community_actor_id = CommunityForm::from_apub(&mut group, client, pool) .await? .actor_id; @@ -1704,7 +1704,7 @@ async fn receive_undo_like_comment( pool: &DbPool, chat_server: ChatServerParam, ) -> Result<HttpResponse, LemmyError> { - let note = like + let mut note = like .like_props .get_object_base_box() .to_owned() @@ -1718,7 +1718,7 @@ async fn receive_undo_like_comment( insert_activity(user.id, like, false, pool).await?; - let comment = CommentForm::from_apub(¬e, client, pool).await?; + let comment = CommentForm::from_apub(&mut note, client, pool).await?; let comment_id = get_or_fetch_and_insert_remote_comment(&comment.ap_id, client, pool) .await? @@ -1758,7 +1758,7 @@ async fn receive_undo_like_post( pool: &DbPool, chat_server: ChatServerParam, ) -> Result<HttpResponse, LemmyError> { - let page = like + let mut page = like .like_props .get_object_base_box() .to_owned() @@ -1772,7 +1772,7 @@ async fn receive_undo_like_post( insert_activity(user.id, like, false, pool).await?; - let post = PostForm::from_apub(&page, client, pool).await?; + let post = PostForm::from_apub(&mut page, client, pool).await?; let post_id = get_or_fetch_and_insert_remote_post(&post.ap_id, client, pool) .await? |