From: Felix Ableitner Date: Mon, 1 Mar 2021 13:08:41 +0000 (+0100) Subject: Rename `lemmy_structs` to `lemmy_api_structs` X-Git-Url: http://these/git/%7B%60%24%7BwebArchiveUrl%7D/%22%7B%7D/%22https:/hacktivis.me/%22?a=commitdiff_plain;h=3bdd78f3419df30713aeb7ed5c4cd0a40e4784e7;p=lemmy.git Rename `lemmy_structs` to `lemmy_api_structs` --- diff --git a/Cargo.lock b/Cargo.lock index cdf7f679..13d67faa 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 ab7d9019..f76128cb 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 299121a6..5ab33958 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 02acc7f8..cb8b2d51 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 128d8b30..4bfbaeb4 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 5642c4b9..871e8e9d 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 4ef07ae5..e905cd5c 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 7ca609f1..a64e0bff 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 b545a72e..716b6723 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 c6877fe0..d6395e6b 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 4342f15b..58933712 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 de4f38cb..fc91e759 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 9dd9bc82..d294cbd9 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 6136f63b..591b6f33 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 5dc021ad..70271715 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 54a8cdb7..854e75f2 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 42635864..0fb6c880 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 0b9d6f4a..312010a9 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 160b20ec..98c25a58 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 f007cda4..f33de2ba 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 a574c7b8..3e77248f 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 ce74d20a..44f5b895 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 31184a70..322eee5f 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 1847ec5c..1dc62e0b 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 cb9ec865..fb545ed6 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 df33bf74..6e0369bd 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 a831ac40..6cbc42dc 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 21cdfb34..e3ef41c7 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 44397db6..d4287224 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 964ac2a1..2306286a 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 f0ffbcb1..ae8a3632 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 66adae3a..8bdded2a 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 7c7653e5..77c40d85 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 f9056a77..f003fb16 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 765d5dff..4f5b0463 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 6c087fc8..9f8a6d6c 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 93df6e72..8c197a85 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 5657faf1..467bee77 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 388d57e6..c010a29b 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 8452f378..6c218190 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 827eae29..f516768b 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 a35ad7d1..42e8bb62 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 2cac67ea..841b3806 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 df91b03f..0bb753e2 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 7a85b20a..aad89567 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 b71ffca7..80b94aa7 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 837e1489..b8858f3f 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 46ef7ce4..058ba881 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 4059e0f8..5c5387d5 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 3116d71e..b957e944 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 fa1d9018..9978d1ec 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 4349b01b..89f3f2b3 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 4ebedb4f..a18201c7 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,