diff options
author | nutomic <nutomic@noreply.yerbamate.dev> | 2020-07-10 18:15:41 +0000 |
---|---|---|
committer | dessalines <dessalines@noreply.yerbamate.dev> | 2020-07-10 18:15:41 +0000 |
commit | 80aef61aed29d25099835ee4769bb8e1e363eb47 (patch) | |
tree | 8c83a360256c615db2ab749aeb29d73ae30895a0 /server/src/apub/shared_inbox.rs | |
parent | debbd316c271f8867917a9eb8c4caa5c26093d66 (diff) |
Split code into cargo workspaces (#67)
More fixes
- fixed docker builds
- fixed mentions regex test
- fixed DATABASE_URL stuff
- change schema path in diesel.toml
Address review comments
- add jsonb column back into activity table
- remove authors field from cargo.toml
- adjust LEMMY_DATABASE_URL env var usage
- rename all occurences of LEMMY_DATABASE_URL to DATABASE_URL
Decouple utils and db
Split code into cargo workspaces
Co-authored-by: Felix Ableitner <me@nutomic.com>
Reviewed-on: https://yerbamate.dev/LemmyNet/lemmy/pulls/67
Diffstat (limited to 'server/src/apub/shared_inbox.rs')
-rw-r--r-- | server/src/apub/shared_inbox.rs | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/server/src/apub/shared_inbox.rs b/server/src/apub/shared_inbox.rs index fa9794b2..75ce3415 100644 --- a/server/src/apub/shared_inbox.rs +++ b/server/src/apub/shared_inbox.rs @@ -5,6 +5,7 @@ use crate::{ post::PostResponse, }, apub::{ + community::do_announce, extensions::signatures::verify, fetcher::{ get_or_fetch_and_insert_remote_comment, @@ -12,25 +13,13 @@ use crate::{ get_or_fetch_and_upsert_remote_community, get_or_fetch_and_upsert_remote_user, }, + insert_activity, FromApub, GroupExt, PageExt, }, blocking, - db::{ - activity::insert_activity, - comment::{Comment, CommentForm, CommentLike, CommentLikeForm}, - comment_view::CommentView, - community::{Community, CommunityForm}, - community_view::CommunityView, - post::{Post, PostForm, PostLike, PostLikeForm}, - post_view::PostView, - Crud, - Likeable, - }, - naive_now, routes::{ChatServerParam, DbPoolParam}, - scrape_text_for_mentions, websocket::{ server::{SendComment, SendCommunityRoomMessage, SendPost}, UserOperation, @@ -46,6 +35,18 @@ use activitystreams::{ BaseBox, }; use actix_web::{client::Client, web, HttpRequest, HttpResponse}; +use lemmy_db::{ + comment::{Comment, CommentForm, CommentLike, CommentLikeForm}, + comment_view::CommentView, + community::{Community, CommunityForm}, + community_view::CommunityView, + naive_now, + post::{Post, PostForm, PostLike, PostLikeForm}, + post_view::PostView, + Crud, + Likeable, +}; +use lemmy_utils::scrape_text_for_mentions; use log::debug; use serde::{Deserialize, Serialize}; use std::fmt::Debug; @@ -234,7 +235,7 @@ where if community.local { let sending_user = get_or_fetch_and_upsert_remote_user(sender, client, pool).await?; - Community::do_announce(activity, &community, &sending_user, client, pool).await + do_announce(activity, &community, &sending_user, client, pool).await } else { Ok(HttpResponse::NotFound().finish()) } |