From 3bdd78f3419df30713aeb7ed5c4cd0a40e4784e7 Mon Sep 17 00:00:00 2001 From: Felix Ableitner Date: Mon, 1 Mar 2021 14:08:41 +0100 Subject: [PATCH] Rename `lemmy_structs` to `lemmy_api_structs` --- Cargo.lock | 48 +++++++++---------- Cargo.toml | 4 +- crates/api/Cargo.toml | 3 +- crates/api/src/comment.rs | 2 +- crates/api/src/community.rs | 2 +- crates/api/src/lib.rs | 10 +++- crates/api/src/post.rs | 2 +- crates/api/src/routes.rs | 2 +- crates/api/src/site.rs | 2 +- crates/api/src/user.rs | 2 +- crates/api/src/websocket.rs | 2 +- crates/{structs => api_structs}/Cargo.toml | 5 +- .../{structs => api_structs}/src/comment.rs | 0 .../{structs => api_structs}/src/community.rs | 0 crates/{structs => api_structs}/src/lib.rs | 0 crates/{structs => api_structs}/src/post.rs | 0 crates/{structs => api_structs}/src/site.rs | 0 crates/{structs => api_structs}/src/user.rs | 0 .../{structs => api_structs}/src/websocket.rs | 0 crates/apub/Cargo.toml | 3 +- crates/apub/src/activities/receive/comment.rs | 2 +- .../src/activities/receive/comment_undo.rs | 2 +- .../apub/src/activities/receive/community.rs | 2 +- crates/apub/src/activities/receive/post.rs | 2 +- .../apub/src/activities/receive/post_undo.rs | 2 +- .../src/activities/receive/private_message.rs | 2 +- crates/apub/src/activities/send/comment.rs | 2 +- crates/apub/src/activities/send/community.rs | 2 +- crates/apub/src/activities/send/post.rs | 2 +- .../src/activities/send/private_message.rs | 2 +- crates/apub/src/activities/send/user.rs | 2 +- crates/apub/src/fetcher/community.rs | 2 +- crates/apub/src/fetcher/objects.rs | 2 +- crates/apub/src/fetcher/search.rs | 2 +- crates/apub/src/fetcher/user.rs | 2 +- crates/apub/src/http/comment.rs | 2 +- crates/apub/src/http/community.rs | 2 +- crates/apub/src/http/mod.rs | 2 +- crates/apub/src/http/post.rs | 2 +- crates/apub/src/http/user.rs | 2 +- crates/apub/src/inbox/community_inbox.rs | 2 +- crates/apub/src/inbox/mod.rs | 2 +- .../apub/src/inbox/receive_for_community.rs | 2 +- crates/apub/src/inbox/shared_inbox.rs | 2 +- crates/apub/src/inbox/user_inbox.rs | 2 +- crates/apub/src/lib.rs | 2 +- crates/apub/src/objects/comment.rs | 2 +- crates/apub/src/objects/community.rs | 2 +- crates/apub/src/objects/mod.rs | 2 +- crates/apub/src/objects/post.rs | 2 +- crates/apub/src/objects/private_message.rs | 2 +- crates/apub/src/objects/user.rs | 2 +- crates/routes/Cargo.toml | 2 +- crates/routes/src/feeds.rs | 2 +- crates/routes/src/nodeinfo.rs | 2 +- crates/routes/src/webfinger.rs | 2 +- crates/websocket/Cargo.toml | 3 +- crates/websocket/src/chat_server.rs | 2 +- crates/websocket/src/messages.rs | 2 +- src/main.rs | 2 +- 60 files changed, 86 insertions(+), 82 deletions(-) rename crates/{structs => api_structs}/Cargo.toml (87%) rename crates/{structs => api_structs}/src/comment.rs (100%) rename crates/{structs => api_structs}/src/community.rs (100%) rename crates/{structs => api_structs}/src/lib.rs (100%) rename crates/{structs => api_structs}/src/post.rs (100%) rename crates/{structs => api_structs}/src/site.rs (100%) rename crates/{structs => api_structs}/src/user.rs (100%) rename crates/{structs => api_structs}/src/websocket.rs (100%) diff --git a/Cargo.lock b/Cargo.lock index cdf7f679c..13d67faa5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1734,13 +1734,13 @@ dependencies = [ "http-signature-normalization-actix", "itertools", "lazy_static", + "lemmy_api_structs", "lemmy_apub", "lemmy_db_queries", "lemmy_db_schema", "lemmy_db_views", "lemmy_db_views_actor", "lemmy_db_views_moderator", - "lemmy_structs", "lemmy_utils", "lemmy_websocket", "log", @@ -1758,6 +1758,25 @@ dependencies = [ "uuid", ] +[[package]] +name = "lemmy_api_structs" +version = "0.1.0" +dependencies = [ + "actix-web", + "chrono", + "diesel", + "lemmy_db_queries", + "lemmy_db_schema", + "lemmy_db_views", + "lemmy_db_views_actor", + "lemmy_db_views_moderator", + "lemmy_utils", + "log", + "serde 1.0.123", + "serde_json", + "url", +] + [[package]] name = "lemmy_apub" version = "0.1.0" @@ -1782,11 +1801,11 @@ dependencies = [ "http-signature-normalization-reqwest", "itertools", "lazy_static", + "lemmy_api_structs", "lemmy_db_queries", "lemmy_db_schema", "lemmy_db_views", "lemmy_db_views_actor", - "lemmy_structs", "lemmy_utils", "lemmy_websocket", "log", @@ -1884,11 +1903,11 @@ dependencies = [ "chrono", "diesel", "lazy_static", + "lemmy_api_structs", "lemmy_db_queries", "lemmy_db_schema", "lemmy_db_views", "lemmy_db_views_actor", - "lemmy_structs", "lemmy_utils", "lemmy_websocket", "log", @@ -1916,6 +1935,7 @@ dependencies = [ "env_logger", "http-signature-normalization-actix", "lemmy_api", + "lemmy_api_structs", "lemmy_apub", "lemmy_db_queries", "lemmy_db_schema", @@ -1923,7 +1943,6 @@ dependencies = [ "lemmy_db_views_actor", "lemmy_db_views_moderator", "lemmy_routes", - "lemmy_structs", "lemmy_utils", "lemmy_websocket", "log", @@ -1936,25 +1955,6 @@ dependencies = [ "url", ] -[[package]] -name = "lemmy_structs" -version = "0.1.0" -dependencies = [ - "actix-web", - "chrono", - "diesel", - "lemmy_db_queries", - "lemmy_db_schema", - "lemmy_db_views", - "lemmy_db_views_actor", - "lemmy_db_views_moderator", - "lemmy_utils", - "log", - "serde 1.0.123", - "serde_json", - "url", -] - [[package]] name = "lemmy_utils" version = "0.1.0" @@ -1998,9 +1998,9 @@ dependencies = [ "background-jobs", "chrono", "diesel", + "lemmy_api_structs", "lemmy_db_queries", "lemmy_db_schema", - "lemmy_structs", "lemmy_utils", "log", "rand 0.8.3", diff --git a/Cargo.toml b/Cargo.toml index ab7d90198..f76128cb4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,7 +19,7 @@ members = [ "crates/db_views", "crates/db_views_actor", "crates/db_views_actor", - "crates/structs", + "crates/api_structs", "crates/websocket", "crates/routes" ] @@ -33,7 +33,7 @@ lemmy_db_queries = { path = "./crates/db_queries" } lemmy_db_views = { path = "./crates/db_views" } lemmy_db_views_moderator = { path = "./crates/db_views_moderator" } lemmy_db_views_actor = { path = "./crates/db_views_actor" } -lemmy_structs = { path = "./crates/structs" } +lemmy_api_structs = { path = "crates/api_structs" } lemmy_websocket = { path = "./crates/websocket" } lemmy_routes = { path = "./crates/routes" } diesel = "1.4.5" diff --git a/crates/api/Cargo.toml b/crates/api/Cargo.toml index 299121a6e..5ab339584 100644 --- a/crates/api/Cargo.toml +++ b/crates/api/Cargo.toml @@ -1,7 +1,6 @@ [package] name = "lemmy_api" version = "0.1.0" -authors = ["Felix Ableitner "] edition = "2018" [lib] @@ -17,7 +16,7 @@ lemmy_db_schema = { path = "../db_schema" } lemmy_db_views = { path = "../db_views" } lemmy_db_views_moderator = { path = "../db_views_moderator" } lemmy_db_views_actor = { path = "../db_views_actor" } -lemmy_structs = { path = "../structs" } +lemmy_api_structs = { path = "../api_structs" } lemmy_websocket = { path = "../websocket" } diesel = "1.4.5" bcrypt = "0.9.0" diff --git a/crates/api/src/comment.rs b/crates/api/src/comment.rs index 02acc7f85..cb8b2d515 100644 --- a/crates/api/src/comment.rs +++ b/crates/api/src/comment.rs @@ -9,6 +9,7 @@ use crate::{ Perform, }; use actix_web::web::Data; +use lemmy_api_structs::{blocking, comment::*, send_local_notifs}; use lemmy_apub::{generate_apub_endpoint, ApubLikeableType, ApubObjectType, EndpointType}; use lemmy_db_queries::{ source::comment::Comment_, @@ -24,7 +25,6 @@ use lemmy_db_views::{ comment_report_view::{CommentReportQueryBuilder, CommentReportView}, comment_view::{CommentQueryBuilder, CommentView}, }; -use lemmy_structs::{blocking, comment::*, send_local_notifs}; use lemmy_utils::{ utils::{remove_slurs, scrape_text_for_mentions}, ApiError, diff --git a/crates/api/src/community.rs b/crates/api/src/community.rs index 128d8b303..4bfbaeb4a 100644 --- a/crates/api/src/community.rs +++ b/crates/api/src/community.rs @@ -9,6 +9,7 @@ use crate::{ }; use actix_web::web::Data; use anyhow::Context; +use lemmy_api_structs::{blocking, community::*}; use lemmy_apub::{ generate_apub_endpoint, generate_followers_url, @@ -43,7 +44,6 @@ use lemmy_db_views_actor::{ community_view::{CommunityQueryBuilder, CommunityView}, user_view::UserViewSafe, }; -use lemmy_structs::{blocking, community::*}; use lemmy_utils::{ apub::generate_actor_keypair, location_info, diff --git a/crates/api/src/lib.rs b/crates/api/src/lib.rs index 5642c4b9c..871e8e9d8 100644 --- a/crates/api/src/lib.rs +++ b/crates/api/src/lib.rs @@ -1,4 +1,13 @@ use actix_web::{web, web::Data}; +use lemmy_api_structs::{ + blocking, + comment::*, + community::*, + post::*, + site::*, + user::*, + websocket::*, +}; use lemmy_db_queries::{ source::{ community::{CommunityModerator_, Community_}, @@ -18,7 +27,6 @@ use lemmy_db_views_actor::{ community_user_ban_view::CommunityUserBanView, community_view::CommunityView, }; -use lemmy_structs::{blocking, comment::*, community::*, post::*, site::*, user::*, websocket::*}; use lemmy_utils::{claims::Claims, settings::Settings, ApiError, ConnectionId, LemmyError}; use lemmy_websocket::{serialize_websocket_message, LemmyContext, UserOperation}; use serde::Deserialize; diff --git a/crates/api/src/post.rs b/crates/api/src/post.rs index 4ef07ae56..e905cd5cf 100644 --- a/crates/api/src/post.rs +++ b/crates/api/src/post.rs @@ -9,6 +9,7 @@ use crate::{ Perform, }; use actix_web::web::Data; +use lemmy_api_structs::{blocking, post::*}; use lemmy_apub::{generate_apub_endpoint, ApubLikeableType, ApubObjectType, EndpointType}; use lemmy_db_queries::{ source::post::Post_, @@ -36,7 +37,6 @@ use lemmy_db_views_actor::{ community_moderator_view::CommunityModeratorView, community_view::CommunityView, }; -use lemmy_structs::{blocking, post::*}; use lemmy_utils::{ request::fetch_iframely_and_pictrs_data, utils::{check_slurs, check_slurs_opt, is_valid_post_title}, diff --git a/crates/api/src/routes.rs b/crates/api/src/routes.rs index 7ca609f1a..a64e0bffd 100644 --- a/crates/api/src/routes.rs +++ b/crates/api/src/routes.rs @@ -1,6 +1,6 @@ use crate::Perform; use actix_web::{error::ErrorBadRequest, *}; -use lemmy_structs::{comment::*, community::*, post::*, site::*, user::*, websocket::*}; +use lemmy_api_structs::{comment::*, community::*, post::*, site::*, user::*, websocket::*}; use lemmy_utils::rate_limit::RateLimit; use lemmy_websocket::{routes::chat_route, LemmyContext}; use serde::Deserialize; diff --git a/crates/api/src/site.rs b/crates/api/src/site.rs index b545a72ea..716b67237 100644 --- a/crates/api/src/site.rs +++ b/crates/api/src/site.rs @@ -9,6 +9,7 @@ use crate::{ }; use actix_web::web::Data; use anyhow::Context; +use lemmy_api_structs::{blocking, site::*, user::Register}; use lemmy_apub::fetcher::search::search_by_apub_id; use lemmy_db_queries::{diesel_option_overwrite, source::site::Site_, Crud, SearchType, SortType}; use lemmy_db_schema::{ @@ -38,7 +39,6 @@ use lemmy_db_views_moderator::{ mod_remove_post_view::ModRemovePostView, mod_sticky_post_view::ModStickyPostView, }; -use lemmy_structs::{blocking, site::*, user::Register}; use lemmy_utils::{ location_info, settings::Settings, diff --git a/crates/api/src/user.rs b/crates/api/src/user.rs index c6877fe0d..d6395e6b7 100644 --- a/crates/api/src/user.rs +++ b/crates/api/src/user.rs @@ -12,6 +12,7 @@ use anyhow::Context; use bcrypt::verify; use captcha::{gen, Difficulty}; use chrono::Duration; +use lemmy_api_structs::{blocking, send_email_to_user, user::*}; use lemmy_apub::{ generate_apub_endpoint, generate_followers_url, @@ -65,7 +66,6 @@ use lemmy_db_views_actor::{ user_mention_view::{UserMentionQueryBuilder, UserMentionView}, user_view::UserViewSafe, }; -use lemmy_structs::{blocking, send_email_to_user, user::*}; use lemmy_utils::{ apub::generate_actor_keypair, claims::Claims, diff --git a/crates/api/src/websocket.rs b/crates/api/src/websocket.rs index 4342f15b8..58933712d 100644 --- a/crates/api/src/websocket.rs +++ b/crates/api/src/websocket.rs @@ -1,6 +1,6 @@ use crate::{get_user_from_jwt, Perform}; use actix_web::web::Data; -use lemmy_structs::websocket::*; +use lemmy_api_structs::websocket::*; use lemmy_utils::{ConnectionId, LemmyError}; use lemmy_websocket::{ messages::{JoinCommunityRoom, JoinModRoom, JoinPostRoom, JoinUserRoom}, diff --git a/crates/structs/Cargo.toml b/crates/api_structs/Cargo.toml similarity index 87% rename from crates/structs/Cargo.toml rename to crates/api_structs/Cargo.toml index de4f38cbf..fc91e759a 100644 --- a/crates/structs/Cargo.toml +++ b/crates/api_structs/Cargo.toml @@ -1,11 +1,10 @@ [package] -name = "lemmy_structs" +name = "lemmy_api_structs" version = "0.1.0" -authors = ["Felix Ableitner "] edition = "2018" [lib] -name = "lemmy_structs" +name = "lemmy_api_structs" path = "src/lib.rs" doctest = false diff --git a/crates/structs/src/comment.rs b/crates/api_structs/src/comment.rs similarity index 100% rename from crates/structs/src/comment.rs rename to crates/api_structs/src/comment.rs diff --git a/crates/structs/src/community.rs b/crates/api_structs/src/community.rs similarity index 100% rename from crates/structs/src/community.rs rename to crates/api_structs/src/community.rs diff --git a/crates/structs/src/lib.rs b/crates/api_structs/src/lib.rs similarity index 100% rename from crates/structs/src/lib.rs rename to crates/api_structs/src/lib.rs diff --git a/crates/structs/src/post.rs b/crates/api_structs/src/post.rs similarity index 100% rename from crates/structs/src/post.rs rename to crates/api_structs/src/post.rs diff --git a/crates/structs/src/site.rs b/crates/api_structs/src/site.rs similarity index 100% rename from crates/structs/src/site.rs rename to crates/api_structs/src/site.rs diff --git a/crates/structs/src/user.rs b/crates/api_structs/src/user.rs similarity index 100% rename from crates/structs/src/user.rs rename to crates/api_structs/src/user.rs diff --git a/crates/structs/src/websocket.rs b/crates/api_structs/src/websocket.rs similarity index 100% rename from crates/structs/src/websocket.rs rename to crates/api_structs/src/websocket.rs diff --git a/crates/apub/Cargo.toml b/crates/apub/Cargo.toml index 9dd9bc82f..d294cbd9d 100644 --- a/crates/apub/Cargo.toml +++ b/crates/apub/Cargo.toml @@ -1,7 +1,6 @@ [package] name = "lemmy_apub" version = "0.1.0" -authors = ["Felix Ableitner "] edition = "2018" [lib] @@ -15,7 +14,7 @@ lemmy_db_queries = { path = "../db_queries" } lemmy_db_schema = { path = "../db_schema" } lemmy_db_views = { path = "../db_views" } lemmy_db_views_actor = { path = "../db_views_actor" } -lemmy_structs = { path = "../structs" } +lemmy_api_structs = { path = "../api_structs" } lemmy_websocket = { path = "../websocket" } diesel = "1.4.5" activitystreams = "0.7.0-alpha.10" diff --git a/crates/apub/src/activities/receive/comment.rs b/crates/apub/src/activities/receive/comment.rs index 6136f63bb..591b6f33a 100644 --- a/crates/apub/src/activities/receive/comment.rs +++ b/crates/apub/src/activities/receive/comment.rs @@ -4,13 +4,13 @@ use activitystreams::{ base::ExtendsExt, }; use anyhow::Context; +use lemmy_api_structs::{blocking, comment::CommentResponse, send_local_notifs}; use lemmy_db_queries::{source::comment::Comment_, Crud, Likeable}; use lemmy_db_schema::source::{ comment::{Comment, CommentLike, CommentLikeForm}, post::Post, }; use lemmy_db_views::comment_view::CommentView; -use lemmy_structs::{blocking, comment::CommentResponse, send_local_notifs}; use lemmy_utils::{location_info, utils::scrape_text_for_mentions, LemmyError}; use lemmy_websocket::{messages::SendComment, LemmyContext, UserOperation}; diff --git a/crates/apub/src/activities/receive/comment_undo.rs b/crates/apub/src/activities/receive/comment_undo.rs index 5dc021ad3..702717155 100644 --- a/crates/apub/src/activities/receive/comment_undo.rs +++ b/crates/apub/src/activities/receive/comment_undo.rs @@ -1,9 +1,9 @@ use crate::activities::receive::get_actor_as_user; use activitystreams::activity::{Dislike, Like}; +use lemmy_api_structs::{blocking, comment::CommentResponse}; use lemmy_db_queries::{source::comment::Comment_, Likeable}; use lemmy_db_schema::source::comment::{Comment, CommentLike}; use lemmy_db_views::comment_view::CommentView; -use lemmy_structs::{blocking, comment::CommentResponse}; use lemmy_utils::LemmyError; use lemmy_websocket::{messages::SendComment, LemmyContext, UserOperation}; diff --git a/crates/apub/src/activities/receive/community.rs b/crates/apub/src/activities/receive/community.rs index 54a8cdb7a..854e75f26 100644 --- a/crates/apub/src/activities/receive/community.rs +++ b/crates/apub/src/activities/receive/community.rs @@ -4,10 +4,10 @@ use activitystreams::{ base::{AnyBase, ExtendsExt}, }; use anyhow::Context; +use lemmy_api_structs::{blocking, community::CommunityResponse}; use lemmy_db_queries::{source::community::Community_, ApubObject}; use lemmy_db_schema::source::community::Community; use lemmy_db_views_actor::community_view::CommunityView; -use lemmy_structs::{blocking, community::CommunityResponse}; use lemmy_utils::{location_info, LemmyError}; use lemmy_websocket::{messages::SendCommunityRoomMessage, LemmyContext, UserOperation}; use url::Url; diff --git a/crates/apub/src/activities/receive/post.rs b/crates/apub/src/activities/receive/post.rs index 426358646..0fb6c8807 100644 --- a/crates/apub/src/activities/receive/post.rs +++ b/crates/apub/src/activities/receive/post.rs @@ -4,10 +4,10 @@ use activitystreams::{ prelude::*, }; use anyhow::Context; +use lemmy_api_structs::{blocking, post::PostResponse}; use lemmy_db_queries::{source::post::Post_, Likeable}; use lemmy_db_schema::source::post::{Post, PostLike, PostLikeForm}; use lemmy_db_views::post_view::PostView; -use lemmy_structs::{blocking, post::PostResponse}; use lemmy_utils::{location_info, LemmyError}; use lemmy_websocket::{messages::SendPost, LemmyContext, UserOperation}; diff --git a/crates/apub/src/activities/receive/post_undo.rs b/crates/apub/src/activities/receive/post_undo.rs index 0b9d6f4a4..312010a9e 100644 --- a/crates/apub/src/activities/receive/post_undo.rs +++ b/crates/apub/src/activities/receive/post_undo.rs @@ -1,9 +1,9 @@ use crate::activities::receive::get_actor_as_user; use activitystreams::activity::{Dislike, Like}; +use lemmy_api_structs::{blocking, post::PostResponse}; use lemmy_db_queries::{source::post::Post_, Likeable}; use lemmy_db_schema::source::post::{Post, PostLike}; use lemmy_db_views::post_view::PostView; -use lemmy_structs::{blocking, post::PostResponse}; use lemmy_utils::LemmyError; use lemmy_websocket::{messages::SendPost, LemmyContext, UserOperation}; diff --git a/crates/apub/src/activities/receive/private_message.rs b/crates/apub/src/activities/receive/private_message.rs index 160b20ece..98c25a588 100644 --- a/crates/apub/src/activities/receive/private_message.rs +++ b/crates/apub/src/activities/receive/private_message.rs @@ -13,10 +13,10 @@ use activitystreams::{ public, }; use anyhow::{anyhow, Context}; +use lemmy_api_structs::{blocking, user::PrivateMessageResponse}; use lemmy_db_queries::source::private_message::PrivateMessage_; use lemmy_db_schema::source::private_message::PrivateMessage; use lemmy_db_views::private_message_view::PrivateMessageView; -use lemmy_structs::{blocking, user::PrivateMessageResponse}; use lemmy_utils::{location_info, LemmyError}; use lemmy_websocket::{messages::SendUserRoomMessage, LemmyContext, UserOperation}; use url::Url; diff --git a/crates/apub/src/activities/send/comment.rs b/crates/apub/src/activities/send/comment.rs index f007cda42..f33de2ba7 100644 --- a/crates/apub/src/activities/send/comment.rs +++ b/crates/apub/src/activities/send/comment.rs @@ -26,9 +26,9 @@ use activitystreams::{ }; use anyhow::anyhow; use itertools::Itertools; +use lemmy_api_structs::{blocking, WebFingerResponse}; use lemmy_db_queries::{Crud, DbPool}; use lemmy_db_schema::source::{comment::Comment, community::Community, post::Post, user::User_}; -use lemmy_structs::{blocking, WebFingerResponse}; use lemmy_utils::{ request::{retry, RecvError}, settings::Settings, diff --git a/crates/apub/src/activities/send/community.rs b/crates/apub/src/activities/send/community.rs index a574c7b85..3e77248f8 100644 --- a/crates/apub/src/activities/send/community.rs +++ b/crates/apub/src/activities/send/community.rs @@ -23,10 +23,10 @@ use activitystreams::{ }; use anyhow::Context; use itertools::Itertools; +use lemmy_api_structs::blocking; use lemmy_db_queries::DbPool; use lemmy_db_schema::source::community::Community; use lemmy_db_views_actor::community_follower_view::CommunityFollowerView; -use lemmy_structs::blocking; use lemmy_utils::{location_info, LemmyError}; use lemmy_websocket::LemmyContext; use url::Url; diff --git a/crates/apub/src/activities/send/post.rs b/crates/apub/src/activities/send/post.rs index ce74d20a5..44f5b895f 100644 --- a/crates/apub/src/activities/send/post.rs +++ b/crates/apub/src/activities/send/post.rs @@ -21,9 +21,9 @@ use activitystreams::{ prelude::*, public, }; +use lemmy_api_structs::blocking; use lemmy_db_queries::Crud; use lemmy_db_schema::source::{community::Community, post::Post, user::User_}; -use lemmy_structs::blocking; use lemmy_utils::LemmyError; use lemmy_websocket::LemmyContext; diff --git a/crates/apub/src/activities/send/private_message.rs b/crates/apub/src/activities/send/private_message.rs index 31184a702..322eee5f7 100644 --- a/crates/apub/src/activities/send/private_message.rs +++ b/crates/apub/src/activities/send/private_message.rs @@ -16,9 +16,9 @@ use activitystreams::{ }, prelude::*, }; +use lemmy_api_structs::blocking; use lemmy_db_queries::Crud; use lemmy_db_schema::source::{private_message::PrivateMessage, user::User_}; -use lemmy_structs::blocking; use lemmy_utils::LemmyError; use lemmy_websocket::LemmyContext; diff --git a/crates/apub/src/activities/send/user.rs b/crates/apub/src/activities/send/user.rs index 1847ec5c5..1dc62e0bc 100644 --- a/crates/apub/src/activities/send/user.rs +++ b/crates/apub/src/activities/send/user.rs @@ -13,12 +13,12 @@ use activitystreams::{ base::{AnyBase, BaseExt, ExtendsExt}, object::ObjectExt, }; +use lemmy_api_structs::blocking; use lemmy_db_queries::{ApubObject, DbPool, Followable}; use lemmy_db_schema::source::{ community::{Community, CommunityFollower, CommunityFollowerForm}, user::User_, }; -use lemmy_structs::blocking; use lemmy_utils::LemmyError; use lemmy_websocket::LemmyContext; use url::Url; diff --git a/crates/apub/src/fetcher/community.rs b/crates/apub/src/fetcher/community.rs index cb9ec8651..fb545ed6a 100644 --- a/crates/apub/src/fetcher/community.rs +++ b/crates/apub/src/fetcher/community.rs @@ -16,9 +16,9 @@ use activitystreams::{ }; use anyhow::Context; use diesel::result::Error::NotFound; +use lemmy_api_structs::blocking; use lemmy_db_queries::{source::community::Community_, ApubObject, Joinable}; use lemmy_db_schema::source::community::{Community, CommunityModerator, CommunityModeratorForm}; -use lemmy_structs::blocking; use lemmy_utils::{location_info, LemmyError}; use lemmy_websocket::LemmyContext; use log::debug; diff --git a/crates/apub/src/fetcher/objects.rs b/crates/apub/src/fetcher/objects.rs index df33bf740..6e0369bde 100644 --- a/crates/apub/src/fetcher/objects.rs +++ b/crates/apub/src/fetcher/objects.rs @@ -1,9 +1,9 @@ use crate::{fetcher::fetch::fetch_remote_object, objects::FromApub, NoteExt, PageExt}; use anyhow::anyhow; use diesel::result::Error::NotFound; +use lemmy_api_structs::blocking; use lemmy_db_queries::{ApubObject, Crud}; use lemmy_db_schema::source::{comment::Comment, post::Post}; -use lemmy_structs::blocking; use lemmy_utils::LemmyError; use lemmy_websocket::LemmyContext; use log::debug; diff --git a/crates/apub/src/fetcher/search.rs b/crates/apub/src/fetcher/search.rs index a831ac404..6cbc42dc6 100644 --- a/crates/apub/src/fetcher/search.rs +++ b/crates/apub/src/fetcher/search.rs @@ -15,6 +15,7 @@ use crate::{ }; use activitystreams::base::BaseExt; use anyhow::{anyhow, Context}; +use lemmy_api_structs::{blocking, site::SearchResponse}; use lemmy_db_queries::{ source::{ comment::Comment_, @@ -34,7 +35,6 @@ use lemmy_db_schema::source::{ }; use lemmy_db_views::{comment_view::CommentView, post_view::PostView}; use lemmy_db_views_actor::{community_view::CommunityView, user_view::UserViewSafe}; -use lemmy_structs::{blocking, site::SearchResponse}; use lemmy_utils::{settings::Settings, LemmyError}; use lemmy_websocket::LemmyContext; use log::debug; diff --git a/crates/apub/src/fetcher/user.rs b/crates/apub/src/fetcher/user.rs index 21cdfb348..e3ef41c74 100644 --- a/crates/apub/src/fetcher/user.rs +++ b/crates/apub/src/fetcher/user.rs @@ -5,9 +5,9 @@ use crate::{ }; use anyhow::anyhow; use diesel::result::Error::NotFound; +use lemmy_api_structs::blocking; use lemmy_db_queries::{source::user::User, ApubObject}; use lemmy_db_schema::source::user::User_; -use lemmy_structs::blocking; use lemmy_utils::LemmyError; use lemmy_websocket::LemmyContext; use log::debug; diff --git a/crates/apub/src/http/comment.rs b/crates/apub/src/http/comment.rs index 44397db60..d4287224c 100644 --- a/crates/apub/src/http/comment.rs +++ b/crates/apub/src/http/comment.rs @@ -4,9 +4,9 @@ use crate::{ }; use actix_web::{body::Body, web, web::Path, HttpResponse}; use diesel::result::Error::NotFound; +use lemmy_api_structs::blocking; use lemmy_db_queries::Crud; use lemmy_db_schema::source::comment::Comment; -use lemmy_structs::blocking; use lemmy_utils::LemmyError; use lemmy_websocket::LemmyContext; use serde::Deserialize; diff --git a/crates/apub/src/http/community.rs b/crates/apub/src/http/community.rs index 964ac2a15..2306286a7 100644 --- a/crates/apub/src/http/community.rs +++ b/crates/apub/src/http/community.rs @@ -9,10 +9,10 @@ use activitystreams::{ collection::{CollectionExt, OrderedCollection, UnorderedCollection}, }; use actix_web::{body::Body, web, HttpResponse}; +use lemmy_api_structs::blocking; use lemmy_db_queries::source::{activity::Activity_, community::Community_}; use lemmy_db_schema::source::{activity::Activity, community::Community}; use lemmy_db_views_actor::community_follower_view::CommunityFollowerView; -use lemmy_structs::blocking; use lemmy_utils::LemmyError; use lemmy_websocket::LemmyContext; use serde::Deserialize; diff --git a/crates/apub/src/http/mod.rs b/crates/apub/src/http/mod.rs index f0ffbcb1e..ae8a3632a 100644 --- a/crates/apub/src/http/mod.rs +++ b/crates/apub/src/http/mod.rs @@ -1,9 +1,9 @@ use crate::APUB_JSON_CONTENT_TYPE; use actix_web::{body::Body, web, HttpResponse}; use http::StatusCode; +use lemmy_api_structs::blocking; use lemmy_db_queries::source::activity::Activity_; use lemmy_db_schema::source::activity::Activity; -use lemmy_structs::blocking; use lemmy_utils::{settings::Settings, LemmyError}; use lemmy_websocket::LemmyContext; use serde::{Deserialize, Serialize}; diff --git a/crates/apub/src/http/post.rs b/crates/apub/src/http/post.rs index 66adae3ac..8bdded2a0 100644 --- a/crates/apub/src/http/post.rs +++ b/crates/apub/src/http/post.rs @@ -4,9 +4,9 @@ use crate::{ }; use actix_web::{body::Body, web, HttpResponse}; use diesel::result::Error::NotFound; +use lemmy_api_structs::blocking; use lemmy_db_queries::Crud; use lemmy_db_schema::source::post::Post; -use lemmy_structs::blocking; use lemmy_utils::LemmyError; use lemmy_websocket::LemmyContext; use serde::Deserialize; diff --git a/crates/apub/src/http/user.rs b/crates/apub/src/http/user.rs index 7c7653e57..77c40d855 100644 --- a/crates/apub/src/http/user.rs +++ b/crates/apub/src/http/user.rs @@ -9,9 +9,9 @@ use activitystreams::{ collection::{CollectionExt, OrderedCollection}, }; use actix_web::{body::Body, web, HttpResponse}; +use lemmy_api_structs::blocking; use lemmy_db_queries::source::user::User; use lemmy_db_schema::source::user::User_; -use lemmy_structs::blocking; use lemmy_utils::LemmyError; use lemmy_websocket::LemmyContext; use serde::Deserialize; diff --git a/crates/apub/src/inbox/community_inbox.rs b/crates/apub/src/inbox/community_inbox.rs index f9056a770..f003fb16f 100644 --- a/crates/apub/src/inbox/community_inbox.rs +++ b/crates/apub/src/inbox/community_inbox.rs @@ -26,13 +26,13 @@ use activitystreams::{ }; use actix_web::{web, HttpRequest, HttpResponse}; use anyhow::{anyhow, Context}; +use lemmy_api_structs::blocking; use lemmy_db_queries::{source::community::Community_, ApubObject, DbPool, Followable}; use lemmy_db_schema::source::{ community::{Community, CommunityFollower, CommunityFollowerForm}, user::User_, }; use lemmy_db_views_actor::community_user_ban_view::CommunityUserBanView; -use lemmy_structs::blocking; use lemmy_utils::{location_info, LemmyError}; use lemmy_websocket::LemmyContext; use log::info; diff --git a/crates/apub/src/inbox/mod.rs b/crates/apub/src/inbox/mod.rs index 765d5dff4..4f5b04633 100644 --- a/crates/apub/src/inbox/mod.rs +++ b/crates/apub/src/inbox/mod.rs @@ -12,13 +12,13 @@ use activitystreams::{ }; use actix_web::HttpRequest; use anyhow::{anyhow, Context}; +use lemmy_api_structs::blocking; use lemmy_db_queries::{ source::{activity::Activity_, community::Community_}, ApubObject, DbPool, }; use lemmy_db_schema::source::{activity::Activity, community::Community, user::User_}; -use lemmy_structs::blocking; use lemmy_utils::{location_info, settings::Settings, LemmyError}; use lemmy_websocket::LemmyContext; use serde::Serialize; diff --git a/crates/apub/src/inbox/receive_for_community.rs b/crates/apub/src/inbox/receive_for_community.rs index 6c087fc80..9f8a6d6c1 100644 --- a/crates/apub/src/inbox/receive_for_community.rs +++ b/crates/apub/src/inbox/receive_for_community.rs @@ -43,9 +43,9 @@ use activitystreams::{ }; use anyhow::Context; use diesel::result::Error::NotFound; +use lemmy_api_structs::blocking; use lemmy_db_queries::Crud; use lemmy_db_schema::source::site::Site; -use lemmy_structs::blocking; use lemmy_utils::{location_info, LemmyError}; use lemmy_websocket::LemmyContext; use strum_macros::EnumString; diff --git a/crates/apub/src/inbox/shared_inbox.rs b/crates/apub/src/inbox/shared_inbox.rs index 93df6e728..8c197a85f 100644 --- a/crates/apub/src/inbox/shared_inbox.rs +++ b/crates/apub/src/inbox/shared_inbox.rs @@ -15,9 +15,9 @@ use crate::{ use activitystreams::{activity::ActorAndObject, prelude::*}; use actix_web::{web, HttpRequest, HttpResponse}; use anyhow::Context; +use lemmy_api_structs::blocking; use lemmy_db_queries::{ApubObject, DbPool}; use lemmy_db_schema::source::community::Community; -use lemmy_structs::blocking; use lemmy_utils::{location_info, LemmyError}; use lemmy_websocket::LemmyContext; use serde::{Deserialize, Serialize}; diff --git a/crates/apub/src/inbox/user_inbox.rs b/crates/apub/src/inbox/user_inbox.rs index 5657faf1e..467bee77c 100644 --- a/crates/apub/src/inbox/user_inbox.rs +++ b/crates/apub/src/inbox/user_inbox.rs @@ -48,13 +48,13 @@ use activitystreams::{ use actix_web::{web, HttpRequest, HttpResponse}; use anyhow::{anyhow, Context}; use diesel::NotFound; +use lemmy_api_structs::blocking; use lemmy_db_queries::{source::user::User, ApubObject, Followable}; use lemmy_db_schema::source::{ community::{Community, CommunityFollower}, private_message::PrivateMessage, user::User_, }; -use lemmy_structs::blocking; use lemmy_utils::{location_info, LemmyError}; use lemmy_websocket::LemmyContext; use log::debug; diff --git a/crates/apub/src/lib.rs b/crates/apub/src/lib.rs index 388d57e6a..c010a29bd 100644 --- a/crates/apub/src/lib.rs +++ b/crates/apub/src/lib.rs @@ -24,6 +24,7 @@ use activitystreams::{ use activitystreams_ext::{Ext1, Ext2}; use anyhow::{anyhow, Context}; use diesel::NotFound; +use lemmy_api_structs::blocking; use lemmy_db_queries::{source::activity::Activity_, ApubObject, DbPool}; use lemmy_db_schema::source::{ activity::Activity, @@ -33,7 +34,6 @@ use lemmy_db_schema::source::{ private_message::PrivateMessage, user::User_, }; -use lemmy_structs::blocking; use lemmy_utils::{location_info, settings::Settings, LemmyError}; use lemmy_websocket::LemmyContext; use serde::Serialize; diff --git a/crates/apub/src/objects/comment.rs b/crates/apub/src/objects/comment.rs index 8452f3787..6c218190a 100644 --- a/crates/apub/src/objects/comment.rs +++ b/crates/apub/src/objects/comment.rs @@ -21,13 +21,13 @@ use activitystreams::{ public, }; use anyhow::{anyhow, Context}; +use lemmy_api_structs::blocking; use lemmy_db_queries::{Crud, DbPool}; use lemmy_db_schema::source::{ comment::{Comment, CommentForm}, post::Post, user::User_, }; -use lemmy_structs::blocking; use lemmy_utils::{ location_info, utils::{convert_datetime, remove_slurs}, diff --git a/crates/apub/src/objects/community.rs b/crates/apub/src/objects/community.rs index 827eae294..f516768ba 100644 --- a/crates/apub/src/objects/community.rs +++ b/crates/apub/src/objects/community.rs @@ -22,13 +22,13 @@ use activitystreams::{ }; use activitystreams_ext::Ext2; use anyhow::Context; +use lemmy_api_structs::blocking; use lemmy_db_queries::DbPool; use lemmy_db_schema::{ naive_now, source::community::{Community, CommunityForm}, }; use lemmy_db_views_actor::community_moderator_view::CommunityModeratorView; -use lemmy_structs::blocking; use lemmy_utils::{ location_info, utils::{check_slurs, check_slurs_opt, convert_datetime}, diff --git a/crates/apub/src/objects/mod.rs b/crates/apub/src/objects/mod.rs index a35ad7d13..42e8bb628 100644 --- a/crates/apub/src/objects/mod.rs +++ b/crates/apub/src/objects/mod.rs @@ -12,9 +12,9 @@ use activitystreams::{ use anyhow::{anyhow, Context}; use chrono::NaiveDateTime; use diesel::result::Error::NotFound; +use lemmy_api_structs::blocking; use lemmy_db_queries::{ApubObject, Crud, DbPool}; use lemmy_db_schema::source::community::Community; -use lemmy_structs::blocking; use lemmy_utils::{ location_info, settings::Settings, diff --git a/crates/apub/src/objects/post.rs b/crates/apub/src/objects/post.rs index 2cac67ea4..841b38069 100644 --- a/crates/apub/src/objects/post.rs +++ b/crates/apub/src/objects/post.rs @@ -22,13 +22,13 @@ use activitystreams::{ }; use activitystreams_ext::Ext1; use anyhow::Context; +use lemmy_api_structs::blocking; use lemmy_db_queries::{Crud, DbPool}; use lemmy_db_schema::source::{ community::Community, post::{Post, PostForm}, user::User_, }; -use lemmy_structs::blocking; use lemmy_utils::{ location_info, request::fetch_iframely_and_pictrs_data, diff --git a/crates/apub/src/objects/private_message.rs b/crates/apub/src/objects/private_message.rs index df91b03f0..0bb753e28 100644 --- a/crates/apub/src/objects/private_message.rs +++ b/crates/apub/src/objects/private_message.rs @@ -19,12 +19,12 @@ use activitystreams::{ prelude::*, }; use anyhow::Context; +use lemmy_api_structs::blocking; use lemmy_db_queries::{Crud, DbPool}; use lemmy_db_schema::source::{ private_message::{PrivateMessage, PrivateMessageForm}, user::User_, }; -use lemmy_structs::blocking; use lemmy_utils::{location_info, utils::convert_datetime, LemmyError}; use lemmy_websocket::LemmyContext; use url::Url; diff --git a/crates/apub/src/objects/user.rs b/crates/apub/src/objects/user.rs index 7a85b20a9..aad895674 100644 --- a/crates/apub/src/objects/user.rs +++ b/crates/apub/src/objects/user.rs @@ -18,12 +18,12 @@ use activitystreams::{ }; use activitystreams_ext::Ext1; use anyhow::Context; +use lemmy_api_structs::blocking; use lemmy_db_queries::{ApubObject, DbPool}; use lemmy_db_schema::{ naive_now, source::user::{UserForm, User_}, }; -use lemmy_structs::blocking; use lemmy_utils::{ location_info, settings::Settings, diff --git a/crates/routes/Cargo.toml b/crates/routes/Cargo.toml index b71ffca70..80b94aa7e 100644 --- a/crates/routes/Cargo.toml +++ b/crates/routes/Cargo.toml @@ -13,7 +13,7 @@ lemmy_db_queries = { path = "../db_queries" } lemmy_db_views = { path = "../db_views" } lemmy_db_views_actor = { path = "../db_views_actor" } lemmy_db_schema = { path = "../db_schema" } -lemmy_structs = { path = "../structs" } +lemmy_api_structs = { path = "../api_structs" } diesel = "1.4.5" actix = "0.10.0" actix-web = { version = "3.3.2", default-features = false, features = ["rustls"] } diff --git a/crates/routes/src/feeds.rs b/crates/routes/src/feeds.rs index 837e1489a..b8858f3f9 100644 --- a/crates/routes/src/feeds.rs +++ b/crates/routes/src/feeds.rs @@ -2,6 +2,7 @@ use actix_web::{error::ErrorBadRequest, *}; use anyhow::anyhow; use chrono::{DateTime, NaiveDateTime, Utc}; use diesel::PgConnection; +use lemmy_api_structs::blocking; use lemmy_db_queries::{ source::{community::Community_, user::User}, ListingType, @@ -14,7 +15,6 @@ use lemmy_db_views::{ site_view::SiteView, }; use lemmy_db_views_actor::user_mention_view::{UserMentionQueryBuilder, UserMentionView}; -use lemmy_structs::blocking; use lemmy_utils::{claims::Claims, settings::Settings, utils::markdown_to_html, LemmyError}; use lemmy_websocket::LemmyContext; use rss::{ diff --git a/crates/routes/src/nodeinfo.rs b/crates/routes/src/nodeinfo.rs index 46ef7ce4d..058ba8816 100644 --- a/crates/routes/src/nodeinfo.rs +++ b/crates/routes/src/nodeinfo.rs @@ -1,7 +1,7 @@ use actix_web::{body::Body, error::ErrorBadRequest, *}; use anyhow::anyhow; +use lemmy_api_structs::blocking; use lemmy_db_views::site_view::SiteView; -use lemmy_structs::blocking; use lemmy_utils::{settings::Settings, version, LemmyError}; use lemmy_websocket::LemmyContext; use serde::{Deserialize, Serialize}; diff --git a/crates/routes/src/webfinger.rs b/crates/routes/src/webfinger.rs index 4059e0f89..5c5387d58 100644 --- a/crates/routes/src/webfinger.rs +++ b/crates/routes/src/webfinger.rs @@ -1,8 +1,8 @@ use actix_web::{error::ErrorBadRequest, web::Query, *}; use anyhow::anyhow; +use lemmy_api_structs::{blocking, WebFingerLink, WebFingerResponse}; use lemmy_db_queries::source::{community::Community_, user::User}; use lemmy_db_schema::source::{community::Community, user::User_}; -use lemmy_structs::{blocking, WebFingerLink, WebFingerResponse}; use lemmy_utils::{ settings::Settings, LemmyError, diff --git a/crates/websocket/Cargo.toml b/crates/websocket/Cargo.toml index 3116d71e7..b957e9446 100644 --- a/crates/websocket/Cargo.toml +++ b/crates/websocket/Cargo.toml @@ -1,7 +1,6 @@ [package] name = "lemmy_websocket" version = "0.1.0" -authors = ["Felix Ableitner "] edition = "2018" [lib] @@ -11,7 +10,7 @@ doctest = false [dependencies] lemmy_utils = { path = "../utils" } -lemmy_structs = { path = "../structs" } +lemmy_api_structs = { path = "../api_structs" } lemmy_db_queries = { path = "../db_queries" } lemmy_db_schema = { path = "../db_schema" } reqwest = { version = "0.10.10", features = ["json"] } diff --git a/crates/websocket/src/chat_server.rs b/crates/websocket/src/chat_server.rs index fa1d90185..9978d1ec6 100644 --- a/crates/websocket/src/chat_server.rs +++ b/crates/websocket/src/chat_server.rs @@ -6,7 +6,7 @@ use diesel::{ r2d2::{ConnectionManager, Pool}, PgConnection, }; -use lemmy_structs::{comment::*, post::*}; +use lemmy_api_structs::{comment::*, post::*}; use lemmy_utils::{ location_info, rate_limit::RateLimit, diff --git a/crates/websocket/src/messages.rs b/crates/websocket/src/messages.rs index 4349b01b6..89f3f2b3e 100644 --- a/crates/websocket/src/messages.rs +++ b/crates/websocket/src/messages.rs @@ -1,6 +1,6 @@ use crate::UserOperation; use actix::{prelude::*, Recipient}; -use lemmy_structs::{comment::CommentResponse, post::PostResponse}; +use lemmy_api_structs::{comment::CommentResponse, post::PostResponse}; use lemmy_utils::{CommunityId, ConnectionId, IpAddr, PostId, UserId}; use serde::{Deserialize, Serialize}; diff --git a/src/main.rs b/src/main.rs index 4ebedb4f8..a18201c73 100644 --- a/src/main.rs +++ b/src/main.rs @@ -8,11 +8,11 @@ use diesel::{ PgConnection, }; use lemmy_api::match_websocket_operation; +use lemmy_api_structs::blocking; use lemmy_apub::activity_queue::create_activity_queue; use lemmy_db_queries::get_database_url_from_env; use lemmy_routes::{feeds, images, nodeinfo, webfinger}; use lemmy_server::{code_migrations::run_advanced_migrations, scheduled_tasks}; -use lemmy_structs::blocking; use lemmy_utils::{ rate_limit::{rate_limiter::RateLimiter, RateLimit}, settings::Settings,