]> Untitled Git - lemmy.git/commitdiff
Re-organizing source tables into a different folder.
authorDessalines <tyhou13@gmx.com>
Sun, 13 Dec 2020 17:04:42 +0000 (12:04 -0500)
committerDessalines <tyhou13@gmx.com>
Sun, 13 Dec 2020 17:04:42 +0000 (12:04 -0500)
71 files changed:
lemmy_api/src/claims.rs
lemmy_api/src/comment.rs
lemmy_api/src/community.rs
lemmy_api/src/lib.rs
lemmy_api/src/post.rs
lemmy_api/src/site.rs
lemmy_api/src/user.rs
lemmy_apub/src/activities/receive/comment.rs
lemmy_apub/src/activities/receive/comment_undo.rs
lemmy_apub/src/activities/receive/community.rs
lemmy_apub/src/activities/receive/mod.rs
lemmy_apub/src/activities/receive/post.rs
lemmy_apub/src/activities/receive/post_undo.rs
lemmy_apub/src/activities/receive/private_message.rs
lemmy_apub/src/activities/send/comment.rs
lemmy_apub/src/activities/send/community.rs
lemmy_apub/src/activities/send/post.rs
lemmy_apub/src/activities/send/private_message.rs
lemmy_apub/src/activities/send/user.rs
lemmy_apub/src/activity_queue.rs
lemmy_apub/src/extensions/group_extensions.rs
lemmy_apub/src/fetcher.rs
lemmy_apub/src/http/comment.rs
lemmy_apub/src/http/community.rs
lemmy_apub/src/http/mod.rs
lemmy_apub/src/http/post.rs
lemmy_apub/src/http/user.rs
lemmy_apub/src/inbox/community_inbox.rs
lemmy_apub/src/inbox/mod.rs
lemmy_apub/src/inbox/receive_for_community.rs
lemmy_apub/src/inbox/shared_inbox.rs
lemmy_apub/src/inbox/user_inbox.rs
lemmy_apub/src/lib.rs
lemmy_apub/src/objects/comment.rs
lemmy_apub/src/objects/community.rs
lemmy_apub/src/objects/post.rs
lemmy_apub/src/objects/private_message.rs
lemmy_apub/src/objects/user.rs
lemmy_db/src/aggregates/community_aggregates.rs
lemmy_db/src/aggregates/post_aggregates.rs
lemmy_db/src/aggregates/site_aggregates.rs
lemmy_db/src/aggregates/user_aggregates.rs
lemmy_db/src/comment_report.rs
lemmy_db/src/comment_view.rs
lemmy_db/src/lib.rs
lemmy_db/src/post_report.rs
lemmy_db/src/source/activity.rs [moved from lemmy_db/src/activity.rs with 98% similarity]
lemmy_db/src/source/category.rs [moved from lemmy_db/src/category.rs with 94% similarity]
lemmy_db/src/source/comment.rs [moved from lemmy_db/src/comment.rs with 99% similarity]
lemmy_db/src/source/community.rs [moved from lemmy_db/src/community.rs with 98% similarity]
lemmy_db/src/source/mod.rs [new file with mode: 0644]
lemmy_db/src/source/moderator.rs [moved from lemmy_db/src/moderator.rs with 99% similarity]
lemmy_db/src/source/password_reset_request.rs [moved from lemmy_db/src/password_reset_request.rs with 98% similarity]
lemmy_db/src/source/post.rs [moved from lemmy_db/src/post.rs with 99% similarity]
lemmy_db/src/source/private_message.rs [moved from lemmy_db/src/private_message.rs with 99% similarity]
lemmy_db/src/source/site.rs [moved from lemmy_db/src/site.rs with 100% similarity]
lemmy_db/src/source/user.rs [moved from lemmy_db/src/user.rs with 98% similarity]
lemmy_db/src/source/user_mention.rs [moved from lemmy_db/src/user_mention.rs with 98% similarity]
lemmy_db/src/views/community_follower_view.rs
lemmy_db/src/views/community_moderator_view.rs
lemmy_db/src/views/community_user_ban_view.rs
lemmy_db/src/views/community_view.rs
lemmy_db/src/views/post_view.rs
lemmy_db/src/views/site_view.rs
lemmy_db/src/views/user_view.rs
lemmy_structs/src/lib.rs
lemmy_structs/src/site.rs
src/code_migrations.rs
src/routes/feeds.rs
src/routes/webfinger.rs
tests/integration_test.rs

index f475f1dfe763d4a8d8aa4bf5cdbeae78308c7118..4a0ab12b81c93509b983af031df54c3354e74ed6 100644 (file)
@@ -1,5 +1,5 @@
 use jsonwebtoken::{decode, encode, DecodingKey, EncodingKey, Header, TokenData, Validation};
-use lemmy_db::user::User_;
+use lemmy_db::source::user::User_;
 use lemmy_utils::settings::Settings;
 use serde::{Deserialize, Serialize};
 
index 5ad62f146f2ae498ebeb7e9ba512bbe03fec2ac2..fe5fe859aa81657f1258bd29367ec53d6cb046d0 100644 (file)
@@ -10,12 +10,9 @@ use crate::{
 use actix_web::web::Data;
 use lemmy_apub::{ApubLikeableType, ApubObjectType};
 use lemmy_db::{
-  comment::*,
   comment_report::*,
   comment_view::*,
-  moderator::*,
-  post::*,
-  user::*,
+  source::{comment::*, moderator::*, post::*, user::*},
   views::site_view::SiteView,
   Crud,
   Likeable,
index fe7748f945f9fcdafe750d51cc517dd9bb21daa9..b704d24b98ca568b6d35941d9762c01f8f333b9b 100644 (file)
@@ -10,14 +10,10 @@ use actix_web::web::Data;
 use anyhow::Context;
 use lemmy_apub::ActorType;
 use lemmy_db::{
-  comment::Comment,
   comment_view::CommentQueryBuilder,
-  community::*,
   diesel_option_overwrite,
-  moderator::*,
   naive_now,
-  post::Post,
-  site::*,
+  source::{comment::Comment, community::*, moderator::*, post::Post, site::*},
   views::{
     community_follower_view::CommunityFollowerView,
     community_moderator_view::CommunityModeratorView,
index 13998dc4dc98489c63b316a2b023d3bd63371a0f..92287f8d3139916ab173d9ac0ef2819d9647f125 100644 (file)
@@ -1,9 +1,11 @@
 use crate::claims::Claims;
 use actix_web::{web, web::Data};
 use lemmy_db::{
-  community::{Community, CommunityModerator},
-  post::Post,
-  user::User_,
+  source::{
+    community::{Community, CommunityModerator},
+    post::Post,
+    user::User_,
+  },
   views::community_user_ban_view::CommunityUserBanView,
   Crud,
   DbPool,
index 66c174e7d549c7f818883e270d651bfe32bc5938..2b3b4b5b4e04084658179a693fd7f0dbf34b1f11 100644 (file)
@@ -11,10 +11,9 @@ use actix_web::web::Data;
 use lemmy_apub::{ApubLikeableType, ApubObjectType};
 use lemmy_db::{
   comment_view::*,
-  moderator::*,
   naive_now,
-  post::*,
   post_report::*,
+  source::{moderator::*, post::*},
   views::{
     community_moderator_view::CommunityModeratorView,
     community_view::CommunityView,
index f1ef6e26974bd6cf9c58721d55d2353938765250..98c501f1a04f2d012b8894542366000c89d882cb 100644 (file)
@@ -11,13 +11,11 @@ use anyhow::Context;
 use lemmy_apub::fetcher::search_by_apub_id;
 use lemmy_db::{
   aggregates::site_aggregates::SiteAggregates,
-  category::*,
   comment_view::*,
   diesel_option_overwrite,
-  moderator::*,
   moderator_views::*,
   naive_now,
-  site::*,
+  source::{category::*, moderator::*, site::*},
   views::{
     community_view::CommunityQueryBuilder,
     post_view::PostQueryBuilder,
index b8131fa31bfbb949931f416ad3fa2f06d09fe77a..e8099af89d883e7ea729ee9c2023af73b12ce75a 100644 (file)
@@ -15,21 +15,23 @@ use captcha::{gen, Difficulty};
 use chrono::Duration;
 use lemmy_apub::ApubObjectType;
 use lemmy_db::{
-  comment::*,
   comment_report::CommentReportView,
   comment_view::*,
-  community::*,
   diesel_option_overwrite,
-  moderator::*,
   naive_now,
-  password_reset_request::*,
-  post::*,
   post_report::PostReportView,
-  private_message::*,
   private_message_view::*,
-  site::*,
-  user::*,
-  user_mention::*,
+  source::{
+    comment::*,
+    community::*,
+    moderator::*,
+    password_reset_request::*,
+    post::*,
+    private_message::*,
+    site::*,
+    user::*,
+    user_mention::*,
+  },
   user_mention_view::*,
   views::{
     community_follower_view::CommunityFollowerView,
index ff0fb8199f96bd8ab436f088462dee2de9154084..f545a0426cee94ec3692c367225316976a9f125b 100644 (file)
@@ -5,9 +5,11 @@ use activitystreams::{
 };
 use anyhow::Context;
 use lemmy_db::{
-  comment::{Comment, CommentLike, CommentLikeForm},
   comment_view::CommentView,
-  post::Post,
+  source::{
+    comment::{Comment, CommentLike, CommentLikeForm},
+    post::Post,
+  },
   Likeable,
 };
 use lemmy_structs::{blocking, comment::CommentResponse, send_local_notifs};
index 2ee8c6ea7bb529cb40131293da8612267a515829..bf91fe3dd9ad461f8bfdfa72f3f373312e637b40 100644 (file)
@@ -1,8 +1,8 @@
 use crate::activities::receive::get_actor_as_user;
 use activitystreams::activity::{Dislike, Like};
 use lemmy_db::{
-  comment::{Comment, CommentLike},
   comment_view::CommentView,
+  source::comment::{Comment, CommentLike},
   Likeable,
 };
 use lemmy_structs::{blocking, comment::CommentResponse};
index 16b0c4e3cfb0fecdb525bbe645d9d2444d08eba4..cacb54eefab5cfc677a6a9ffbf29ee8c991b5ef9 100644 (file)
@@ -4,7 +4,7 @@ use activitystreams::{
   base::{AnyBase, ExtendsExt},
 };
 use anyhow::Context;
-use lemmy_db::{community::Community, views::community_view::CommunityView, ApubObject};
+use lemmy_db::{source::community::Community, views::community_view::CommunityView, ApubObject};
 use lemmy_structs::{blocking, community::CommunityResponse};
 use lemmy_utils::{location_info, LemmyError};
 use lemmy_websocket::{messages::SendCommunityRoomMessage, LemmyContext, UserOperation};
index 1f17fe9f3bc958b1cd772ad1db7f712b0c43e977..a66ddfb950a2bb6ac2c1a8181c92e181058074a2 100644 (file)
@@ -5,7 +5,7 @@ use activitystreams::{
   error::DomainError,
 };
 use anyhow::{anyhow, Context};
-use lemmy_db::user::User_;
+use lemmy_db::source::user::User_;
 use lemmy_utils::{location_info, LemmyError};
 use lemmy_websocket::LemmyContext;
 use log::debug;
index f3ac96c2f85be6e3df751ef89323601d637dd617..f09071129773077dcde6506cb992b9888f0c0017 100644 (file)
@@ -5,7 +5,7 @@ use activitystreams::{
 };
 use anyhow::Context;
 use lemmy_db::{
-  post::{Post, PostLike, PostLikeForm},
+  source::post::{Post, PostLike, PostLikeForm},
   views::post_view::PostView,
   Likeable,
 };
index 9cc01b7d38064f32d69fbc5074b0fb6f181e9b58..6827ded05f325bd8c8c95e1f9b092904c7f2d459 100644 (file)
@@ -1,7 +1,7 @@
 use crate::activities::receive::get_actor_as_user;
 use activitystreams::activity::{Dislike, Like};
 use lemmy_db::{
-  post::{Post, PostLike},
+  source::post::{Post, PostLike},
   views::post_view::PostView,
   Likeable,
 };
index f05b523799904073650702a1fe7e7029341d43e0..25d4c26c52a535d17475b24354a1657c7b8cac57 100644 (file)
@@ -13,7 +13,7 @@ use activitystreams::{
   public,
 };
 use anyhow::{anyhow, Context};
-use lemmy_db::{private_message::PrivateMessage, private_message_view::PrivateMessageView};
+use lemmy_db::{private_message_view::PrivateMessageView, source::private_message::PrivateMessage};
 use lemmy_structs::{blocking, user::PrivateMessageResponse};
 use lemmy_utils::{location_info, LemmyError};
 use lemmy_websocket::{messages::SendUserRoomMessage, LemmyContext, UserOperation};
index 744a1cddbfe33dedcf55aeefed56321c0629f12e..6b417c2591b7062eee496370aef6f35f109a86b4 100644 (file)
@@ -26,7 +26,11 @@ use activitystreams::{
 };
 use anyhow::anyhow;
 use itertools::Itertools;
-use lemmy_db::{comment::Comment, community::Community, post::Post, user::User_, Crud, DbPool};
+use lemmy_db::{
+  source::{comment::Comment, community::Community, post::Post, user::User_},
+  Crud,
+  DbPool,
+};
 use lemmy_structs::{blocking, WebFingerResponse};
 use lemmy_utils::{
   request::{retry, RecvError},
index b1a2352d3dbffb088931be5b20c33751ce9144fa..8596fc4e3de3376992158c844e3075a968c96332 100644 (file)
@@ -24,7 +24,7 @@ use activitystreams::{
 use anyhow::Context;
 use itertools::Itertools;
 use lemmy_db::{
-  community::Community,
+  source::community::Community,
   views::community_follower_view::CommunityFollowerView,
   DbPool,
 };
index f6eabb0485655fe3a4cff2147241a9f6e103b989..ec1ca67deb97f36f7a7b0fb9b947568d3db5d539 100644 (file)
@@ -21,7 +21,10 @@ use activitystreams::{
   prelude::*,
   public,
 };
-use lemmy_db::{community::Community, post::Post, user::User_, Crud};
+use lemmy_db::{
+  source::{community::Community, post::Post, user::User_},
+  Crud,
+};
 use lemmy_structs::blocking;
 use lemmy_utils::LemmyError;
 use lemmy_websocket::LemmyContext;
index e8bc979a7917c674326d360fd37db0bf4cf39fd7..9abe70d663ec4d9955c86525b866f5ac8053bafb 100644 (file)
@@ -16,7 +16,10 @@ use activitystreams::{
   },
   prelude::*,
 };
-use lemmy_db::{private_message::PrivateMessage, user::User_, Crud};
+use lemmy_db::{
+  source::{private_message::PrivateMessage, user::User_},
+  Crud,
+};
 use lemmy_structs::blocking;
 use lemmy_utils::LemmyError;
 use lemmy_websocket::LemmyContext;
index 8c539c4b0ceb5ec8eecfe0dcbc5f6ef06fc9f4c8..26c5a5d5611c23bd53976c05e96bed234f8675b6 100644 (file)
@@ -14,8 +14,10 @@ use activitystreams::{
   object::ObjectExt,
 };
 use lemmy_db::{
-  community::{Community, CommunityFollower, CommunityFollowerForm},
-  user::User_,
+  source::{
+    community::{Community, CommunityFollower, CommunityFollowerForm},
+    user::User_,
+  },
   ApubObject,
   DbPool,
   Followable,
index 467802794f606f4c16b600257fead7a7e92f9fec..07990457c0df92c8f19feadd6d3fe09f3d3d34f2 100644 (file)
@@ -19,7 +19,10 @@ use background_jobs::{
   WorkerConfig,
 };
 use itertools::Itertools;
-use lemmy_db::{community::Community, user::User_, DbPool};
+use lemmy_db::{
+  source::{community::Community, user::User_},
+  DbPool,
+};
 use lemmy_utils::{location_info, settings::Settings, LemmyError};
 use lemmy_websocket::LemmyContext;
 use log::{debug, warn};
index cb15267200828ffe3001a3f1b410433b5868fdd8..ab7acf337d8c69672dce2caa06434218a720bcc1 100644 (file)
@@ -1,7 +1,7 @@
 use activitystreams::unparsed::UnparsedMutExt;
 use activitystreams_ext::UnparsedExtension;
 use diesel::PgConnection;
-use lemmy_db::{category::Category, Crud};
+use lemmy_db::{source::category::Category, Crud};
 use lemmy_utils::LemmyError;
 use serde::{Deserialize, Serialize};
 
index 5614af65a5078411c460759750f2d5710f9db76b..2d40673feb07fb78320c86e1a788a470267ba711 100644 (file)
@@ -13,12 +13,14 @@ use anyhow::{anyhow, Context};
 use chrono::NaiveDateTime;
 use diesel::result::Error::NotFound;
 use lemmy_db::{
-  comment::Comment,
   comment_view::CommentView,
-  community::{Community, CommunityModerator, CommunityModeratorForm},
   naive_now,
-  post::Post,
-  user::User_,
+  source::{
+    comment::Comment,
+    community::{Community, CommunityModerator, CommunityModeratorForm},
+    post::Post,
+    user::User_,
+  },
   views::{community_view::CommunityView, post_view::PostView, user_view::UserViewSafe},
   ApubObject,
   Joinable,
index bb3d13aceb1db8d7db6ce6baed577f16cc82c138..16f4119027dafda6cfadd6b8a02f29630d9191f6 100644 (file)
@@ -4,7 +4,7 @@ use crate::{
 };
 use actix_web::{body::Body, web, web::Path, HttpResponse};
 use diesel::result::Error::NotFound;
-use lemmy_db::{comment::Comment, Crud};
+use lemmy_db::{source::comment::Comment, Crud};
 use lemmy_structs::blocking;
 use lemmy_utils::LemmyError;
 use lemmy_websocket::LemmyContext;
index d2a18ee0b3c2a070e9e85cdbb84bcb4baf461e73..3caaf6613b6190c0f009a2e162f4ae2e76398896 100644 (file)
@@ -10,8 +10,7 @@ use activitystreams::{
 };
 use actix_web::{body::Body, web, HttpResponse};
 use lemmy_db::{
-  community::Community,
-  post::Post,
+  source::{community::Community, post::Post},
   views::community_follower_view::CommunityFollowerView,
 };
 use lemmy_structs::blocking;
index 4f31f6a5e768aee9e8c92d5db65e7593e984f321..fee15b773594c11ba85904ad43ffa4d6b77fb706 100644 (file)
@@ -1,6 +1,6 @@
 use crate::APUB_JSON_CONTENT_TYPE;
 use actix_web::{body::Body, web, HttpResponse};
-use lemmy_db::activity::Activity;
+use lemmy_db::source::activity::Activity;
 use lemmy_structs::blocking;
 use lemmy_utils::{settings::Settings, LemmyError};
 use lemmy_websocket::LemmyContext;
index 1d25ed958ecb15107a5d830613152f5c1019b285..563af8456d9d4234739979aeb942a6cd2b983bb1 100644 (file)
@@ -4,7 +4,7 @@ use crate::{
 };
 use actix_web::{body::Body, web, HttpResponse};
 use diesel::result::Error::NotFound;
-use lemmy_db::post::Post;
+use lemmy_db::source::post::Post;
 use lemmy_structs::blocking;
 use lemmy_utils::LemmyError;
 use lemmy_websocket::LemmyContext;
index 1e546d953dd47026116b00b29c22f97b57a98ea5..8dcc8edabf7a889bd92176c21cb1046bcff13779 100644 (file)
@@ -9,7 +9,7 @@ use activitystreams::{
   collection::{CollectionExt, OrderedCollection},
 };
 use actix_web::{body::Body, web, HttpResponse};
-use lemmy_db::user::User_;
+use lemmy_db::source::user::User_;
 use lemmy_structs::blocking;
 use lemmy_utils::LemmyError;
 use lemmy_websocket::LemmyContext;
index 1c7b32e908e6c7aa2026afbf4d887b9816287e01..82df26bea8d00aa3d1f1a2697f35032c0b3e1860 100644 (file)
@@ -27,8 +27,10 @@ use activitystreams::{
 use actix_web::{web, HttpRequest, HttpResponse};
 use anyhow::{anyhow, Context};
 use lemmy_db::{
-  community::{Community, CommunityFollower, CommunityFollowerForm},
-  user::User_,
+  source::{
+    community::{Community, CommunityFollower, CommunityFollowerForm},
+    user::User_,
+  },
   views::community_user_ban_view::CommunityUserBanView,
   ApubObject,
   DbPool,
index d36a34c9b0f718ba4a8584d863880da9aefa47c3..415851883d8bc78a652cabf5d8d6eb2cbf413517 100644 (file)
@@ -12,7 +12,11 @@ use activitystreams::{
 };
 use actix_web::HttpRequest;
 use anyhow::{anyhow, Context};
-use lemmy_db::{activity::Activity, community::Community, user::User_, ApubObject, DbPool};
+use lemmy_db::{
+  source::{activity::Activity, community::Community, user::User_},
+  ApubObject,
+  DbPool,
+};
 use lemmy_structs::blocking;
 use lemmy_utils::{location_info, settings::Settings, LemmyError};
 use lemmy_websocket::LemmyContext;
index eaad6b1ccbf2e0301c574f231e63c8a335268286..73deb97176e832b1c89e134c975e12828f1dfce9 100644 (file)
@@ -41,7 +41,11 @@ use activitystreams::{
 };
 use anyhow::Context;
 use diesel::result::Error::NotFound;
-use lemmy_db::{comment::Comment, post::Post, site::Site, ApubObject, Crud};
+use lemmy_db::{
+  source::{comment::Comment, post::Post, site::Site},
+  ApubObject,
+  Crud,
+};
 use lemmy_structs::blocking;
 use lemmy_utils::{location_info, LemmyError};
 use lemmy_websocket::LemmyContext;
index 0108622957136f711b9854d6c8f6f80a5f2bea23..d94c54f253a0284f9b3a8bb16db9dc56f49375c4 100644 (file)
@@ -15,7 +15,7 @@ use crate::{
 use activitystreams::{activity::ActorAndObject, prelude::*};
 use actix_web::{web, HttpRequest, HttpResponse};
 use anyhow::Context;
-use lemmy_db::{community::Community, ApubObject, DbPool};
+use lemmy_db::{source::community::Community, ApubObject, DbPool};
 use lemmy_structs::blocking;
 use lemmy_utils::{location_info, LemmyError};
 use lemmy_websocket::LemmyContext;
index 28f2de60f557953d05c4a71b21b3be28e907e2f1..374772d6d99986fc5883041d4dd2db6ab537f88c 100644 (file)
@@ -49,9 +49,11 @@ use actix_web::{web, HttpRequest, HttpResponse};
 use anyhow::{anyhow, Context};
 use diesel::NotFound;
 use lemmy_db::{
-  community::{Community, CommunityFollower},
-  private_message::PrivateMessage,
-  user::User_,
+  source::{
+    community::{Community, CommunityFollower},
+    private_message::PrivateMessage,
+    user::User_,
+  },
   ApubObject,
   Followable,
 };
index 9b933b6e0c8b2cd61078985adb9baa12e09b74a7..78224c32ebd1ed867b970d6bcf176863ded76578 100644 (file)
@@ -22,7 +22,10 @@ use activitystreams::{
 };
 use activitystreams_ext::{Ext1, Ext2};
 use anyhow::{anyhow, Context};
-use lemmy_db::{activity::Activity, user::User_, DbPool};
+use lemmy_db::{
+  source::{activity::Activity, user::User_},
+  DbPool,
+};
 use lemmy_structs::blocking;
 use lemmy_utils::{location_info, settings::Settings, LemmyError};
 use lemmy_websocket::LemmyContext;
index 56d75a404d691c095ab17175c72ab6a610e19ead..957966d7fe2abac86318ce596a6b01d11b60e361 100644 (file)
@@ -24,10 +24,12 @@ use activitystreams::{
 };
 use anyhow::{anyhow, Context};
 use lemmy_db::{
-  comment::{Comment, CommentForm},
-  community::Community,
-  post::Post,
-  user::User_,
+  source::{
+    comment::{Comment, CommentForm},
+    community::Community,
+    post::Post,
+    user::User_,
+  },
   Crud,
   DbPool,
 };
index 8cc5b9eb5cb231574d4e1ca40d13d5e329c8aaeb..3bd47560efefeeafa638a2964a94a57244e3cda0 100644 (file)
@@ -23,8 +23,8 @@ use activitystreams::{
 use activitystreams_ext::Ext2;
 use anyhow::Context;
 use lemmy_db::{
-  community::{Community, CommunityForm},
   naive_now,
+  source::community::{Community, CommunityForm},
   views::community_moderator_view::CommunityModeratorView,
   DbPool,
 };
index 39b749972342712afbaf0c59edaecdd2707a1e51..9c9df5b1962cb3a2a97519f59d34d46b3bbcea90 100644 (file)
@@ -21,9 +21,11 @@ use activitystreams::{
 use activitystreams_ext::Ext1;
 use anyhow::Context;
 use lemmy_db::{
-  community::Community,
-  post::{Post, PostForm},
-  user::User_,
+  source::{
+    community::Community,
+    post::{Post, PostForm},
+    user::User_,
+  },
   Crud,
   DbPool,
 };
index ec8b55e7e76a49ce4a9c31a1dc1909487b1b4b6d..e69c28110d4dee60a8912cedf933733146cdbf2f 100644 (file)
@@ -20,8 +20,10 @@ use activitystreams::{
 };
 use anyhow::Context;
 use lemmy_db::{
-  private_message::{PrivateMessage, PrivateMessageForm},
-  user::User_,
+  source::{
+    private_message::{PrivateMessage, PrivateMessageForm},
+    user::User_,
+  },
   Crud,
   DbPool,
 };
index 18490796aec12e9930ac1ad1ac99af473dd04b87..8c3312d1f8f8a27ac79e303f4ae479f5fb94e8c1 100644 (file)
@@ -20,7 +20,7 @@ use activitystreams_ext::Ext1;
 use anyhow::Context;
 use lemmy_db::{
   naive_now,
-  user::{UserForm, User_},
+  source::user::{UserForm, User_},
   ApubObject,
   DbPool,
 };
index 04257c50642d74f0ea9bdb9faa51181b8467fc47..8c977bf0ca26056e46ecb79a9cf0e1c1e5a14dae 100644 (file)
@@ -24,11 +24,13 @@ impl CommunityAggregates {
 mod tests {
   use crate::{
     aggregates::community_aggregates::CommunityAggregates,
-    comment::{Comment, CommentForm},
-    community::{Community, CommunityFollower, CommunityFollowerForm, CommunityForm},
-    post::{Post, PostForm},
+    source::{
+      comment::{Comment, CommentForm},
+      community::{Community, CommunityFollower, CommunityFollowerForm, CommunityForm},
+      post::{Post, PostForm},
+      user::{UserForm, User_},
+    },
     tests::establish_unpooled_connection,
-    user::{UserForm, User_},
     Crud,
     Followable,
     ListingType,
index 07db37efd86685b5afb5dac8ad5c03f2dbd2564c..dff16f9b102bcc7d0644a511d7bead2dd6626e92 100644 (file)
@@ -26,11 +26,13 @@ impl PostAggregates {
 mod tests {
   use crate::{
     aggregates::post_aggregates::PostAggregates,
-    comment::{Comment, CommentForm},
-    community::{Community, CommunityForm},
-    post::{Post, PostForm, PostLike, PostLikeForm},
+    source::{
+      comment::{Comment, CommentForm},
+      community::{Community, CommunityForm},
+      post::{Post, PostForm, PostLike, PostLikeForm},
+      user::{UserForm, User_},
+    },
     tests::establish_unpooled_connection,
-    user::{UserForm, User_},
     Crud,
     Likeable,
     ListingType,
index 76b45555b2ac9d12c3b547b72df89adb1234df2c..6856bfc9e5a411cf8c69bdd3ac83983f9344b16f 100644 (file)
@@ -22,11 +22,13 @@ impl SiteAggregates {
 mod tests {
   use crate::{
     aggregates::site_aggregates::SiteAggregates,
-    comment::{Comment, CommentForm},
-    community::{Community, CommunityForm},
-    post::{Post, PostForm},
+    source::{
+      comment::{Comment, CommentForm},
+      community::{Community, CommunityForm},
+      post::{Post, PostForm},
+      user::{UserForm, User_},
+    },
     tests::establish_unpooled_connection,
-    user::{UserForm, User_},
     Crud,
     ListingType,
     SortType,
index e962c0dd46e644d89e73f2918300a64c9680ac72..104bf6f7dfc9350647a33d03dafe360c0c7e2fc4 100644 (file)
@@ -25,11 +25,13 @@ impl UserAggregates {
 mod tests {
   use crate::{
     aggregates::user_aggregates::UserAggregates,
-    comment::{Comment, CommentForm, CommentLike, CommentLikeForm},
-    community::{Community, CommunityForm},
-    post::{Post, PostForm, PostLike, PostLikeForm},
+    source::{
+      comment::{Comment, CommentForm, CommentLike, CommentLikeForm},
+      community::{Community, CommunityForm},
+      post::{Post, PostForm, PostLike, PostLikeForm},
+      user::{UserForm, User_},
+    },
     tests::establish_unpooled_connection,
-    user::{UserForm, User_},
     Crud,
     Likeable,
     ListingType,
index a243891eb8d863ea9890db4c0157cbbb6cd29ce2..240b73430702a0be7228faf56a72df6972a2bf8a 100644 (file)
@@ -2,10 +2,10 @@ use diesel::{dsl::*, pg::Pg, result::Error, *};
 use serde::{Deserialize, Serialize};
 
 use crate::{
-  comment::Comment,
   limit_and_offset,
   naive_now,
   schema::comment_report,
+  source::comment::Comment,
   MaybeOptional,
   Reportable,
 };
index 4b6dc19248f725df149af25fd7f6d4f15270c855..f463168b6e30c60d9b4696c11a78a65b3b4ca02c 100644 (file)
@@ -497,12 +497,9 @@ impl<'a> ReplyQueryBuilder<'a> {
 #[cfg(test)]
 mod tests {
   use crate::{
-    comment::*,
     comment_view::*,
-    community::*,
-    post::*,
+    source::{comment::*, community::*, post::*, user::*},
     tests::establish_unpooled_connection,
-    user::*,
     Crud,
     Likeable,
     *,
index 5488360a6dd537f210af91238a2d769f8a1083bb..098a88e4acfce1361c4641ff46ce004289d998ea 100644 (file)
@@ -11,25 +11,16 @@ use regex::Regex;
 use serde::{Deserialize, Serialize};
 use std::{env, env::VarError};
 
-pub mod activity;
-pub mod aggregates;
-pub mod category;
-pub mod comment;
 pub mod comment_report;
 pub mod comment_view;
-pub mod community;
-pub mod moderator;
 pub mod moderator_views;
-pub mod password_reset_request;
-pub mod post;
 pub mod post_report;
-pub mod private_message;
 pub mod private_message_view;
-pub mod schema;
-pub mod site;
-pub mod user;
-pub mod user_mention;
 pub mod user_mention_view;
+
+pub mod aggregates;
+pub mod schema;
+pub mod source;
 pub mod views;
 
 pub type DbPool = diesel::r2d2::Pool<diesel::r2d2::ConnectionManager<diesel::PgConnection>>;
index 5f8aa5ea59f263468da145517a9a79d3860a29f2..230368c5c51d9d27579a832b31fefb81091a21ae 100644 (file)
@@ -4,8 +4,8 @@ use serde::{Deserialize, Serialize};
 use crate::{
   limit_and_offset,
   naive_now,
-  post::Post,
   schema::post_report,
+  source::post::Post,
   MaybeOptional,
   Reportable,
 };
similarity index 98%
rename from lemmy_db/src/activity.rs
rename to lemmy_db/src/source/activity.rs
index 190dd411c5c37e60fabd7b082131335e506d9fb2..b4b54c6ed293ad2681af14e75b16bfad4102eeaa 100644 (file)
@@ -97,9 +97,11 @@ impl Activity {
 #[cfg(test)]
 mod tests {
   use crate::{
-    activity::{Activity, ActivityForm},
+    source::{
+      activity::{Activity, ActivityForm},
+      user::{UserForm, User_},
+    },
     tests::establish_unpooled_connection,
-    user::{UserForm, User_},
     Crud,
     ListingType,
     SortType,
similarity index 94%
rename from lemmy_db/src/category.rs
rename to lemmy_db/src/source/category.rs
index af2e72265c22e37b21886c864c43d8fd0fa0a9a2..95b65dc823ea31dc51f0bd8e6aafdb3193948565 100644 (file)
@@ -48,7 +48,7 @@ impl Category {
 
 #[cfg(test)]
 mod tests {
-  use crate::{category::Category, tests::establish_unpooled_connection};
+  use crate::{source::category::Category, tests::establish_unpooled_connection};
 
   #[test]
   fn test_crud() {
similarity index 99%
rename from lemmy_db/src/comment.rs
rename to lemmy_db/src/source/comment.rs
index fb327a308dfbe8d63eee316648fa779141f0ddd8..dd4fb39dee27f9b5fce1adeaa789fe1dca8e1334 100644 (file)
@@ -260,11 +260,8 @@ impl Saveable<CommentSavedForm> for CommentSaved {
 #[cfg(test)]
 mod tests {
   use crate::{
-    comment::*,
-    community::*,
-    post::*,
+    source::{comment::*, community::*, post::*, user::*},
     tests::establish_unpooled_connection,
-    user::*,
     Crud,
     ListingType,
     SortType,
similarity index 98%
rename from lemmy_db/src/community.rs
rename to lemmy_db/src/source/community.rs
index eda643ad5ca77c5a58a3162c654610a7b51c1da6..ea7a028e1f863e2831edea344b1cdb0d11eee31b 100644 (file)
@@ -55,7 +55,7 @@ pub struct CommunitySafe {
 }
 
 mod safe_type {
-  use crate::{community::Community, schema::community::columns::*, ToSafe};
+  use crate::{schema::community::columns::*, source::community::Community, ToSafe};
   type Columns = (
     id,
     name,
@@ -415,7 +415,12 @@ impl Followable<CommunityFollowerForm> for CommunityFollower {
 
 #[cfg(test)]
 mod tests {
-  use crate::{community::*, tests::establish_unpooled_connection, user::*, ListingType, SortType};
+  use crate::{
+    source::{community::*, user::*},
+    tests::establish_unpooled_connection,
+    ListingType,
+    SortType,
+  };
 
   #[test]
   fn test_crud() {
diff --git a/lemmy_db/src/source/mod.rs b/lemmy_db/src/source/mod.rs
new file mode 100644 (file)
index 0000000..2247cd8
--- /dev/null
@@ -0,0 +1,11 @@
+pub mod activity;
+pub mod category;
+pub mod comment;
+pub mod community;
+pub mod moderator;
+pub mod password_reset_request;
+pub mod post;
+pub mod private_message;
+pub mod site;
+pub mod user;
+pub mod user_mention;
similarity index 99%
rename from lemmy_db/src/moderator.rs
rename to lemmy_db/src/source/moderator.rs
index c0c0ff1067b3858153261f2edd2e08d97dd014ba..1be3e31b8f677bce0476e0a4fef0820ac13ce4b0 100644 (file)
@@ -392,12 +392,8 @@ impl Crud<ModAddForm> for ModAdd {
 #[cfg(test)]
 mod tests {
   use crate::{
-    comment::*,
-    community::*,
-    moderator::*,
-    post::*,
+    source::{comment::*, community::*, moderator::*, post::*, user::*},
     tests::establish_unpooled_connection,
-    user::*,
     ListingType,
     SortType,
   };
similarity index 98%
rename from lemmy_db/src/password_reset_request.rs
rename to lemmy_db/src/source/password_reset_request.rs
index 8ae18cbd4fd18e796be459fa72ae175a31aa6d20..0cf0169f0ad4a18c79afd3d475d3ad5d5b0d428f 100644 (file)
@@ -80,7 +80,7 @@ impl PasswordResetRequest {
 mod tests {
   use super::super::user::*;
   use crate::{
-    password_reset_request::PasswordResetRequest,
+    source::password_reset_request::PasswordResetRequest,
     tests::establish_unpooled_connection,
     Crud,
     ListingType,
similarity index 99%
rename from lemmy_db/src/post.rs
rename to lemmy_db/src/source/post.rs
index 5767c72b7c3bba8c62902ecc477e3f9acf8d55a0..b584798e87a98cc884abdb0cbe15bca2b166e44a 100644 (file)
@@ -332,10 +332,8 @@ impl Readable<PostReadForm> for PostRead {
 #[cfg(test)]
 mod tests {
   use crate::{
-    community::*,
-    post::*,
+    source::{community::*, post::*, user::*},
     tests::establish_unpooled_connection,
-    user::*,
     ListingType,
     SortType,
   };
similarity index 99%
rename from lemmy_db/src/private_message.rs
rename to lemmy_db/src/source/private_message.rs
index 0e1aef10841fc580385f64f8ea44584ffa7ea0b4..47bb78fbb7399ea8696ff9ab2fd2a5d236379d86 100644 (file)
@@ -138,9 +138,8 @@ impl PrivateMessage {
 #[cfg(test)]
 mod tests {
   use crate::{
-    private_message::*,
+    source::{private_message::*, user::*},
     tests::establish_unpooled_connection,
-    user::*,
     ListingType,
     SortType,
   };
similarity index 98%
rename from lemmy_db/src/user.rs
rename to lemmy_db/src/source/user.rs
index 41d3ed18b74a01d4f10a2a1013c917848695ed2c..5fdb56bbc6788528856aaed5ea280002f0ce5be4 100644 (file)
@@ -62,7 +62,7 @@ pub struct UserSafe {
 }
 
 mod safe_type {
-  use crate::{schema::user_::columns::*, user::User_, ToSafe};
+  use crate::{schema::user_::columns::*, source::user::User_, ToSafe};
   type Columns = (
     id,
     name,
@@ -275,7 +275,7 @@ impl User_ {
 
 #[cfg(test)]
 mod tests {
-  use crate::{tests::establish_unpooled_connection, user::*, ListingType, SortType};
+  use crate::{source::user::*, tests::establish_unpooled_connection, ListingType, SortType};
 
   #[test]
   fn test_crud() {
similarity index 98%
rename from lemmy_db/src/user_mention.rs
rename to lemmy_db/src/source/user_mention.rs
index 68f566332dd8969f30c7fb141dc24eb10644bbed..7ad965218cc7d4b4e201ceb6f6b97425094c8ef5 100644 (file)
@@ -73,12 +73,8 @@ impl UserMention {
 #[cfg(test)]
 mod tests {
   use crate::{
-    comment::*,
-    community::*,
-    post::*,
+    source::{comment::*, community::*, post::*, user::*, user_mention::*},
     tests::establish_unpooled_connection,
-    user::*,
-    user_mention::*,
     ListingType,
     SortType,
   };
index 555a9bcd2387883db129d43878095f5cc3bbaa7e..64adae3b767e07f74f42c8347cef3e0b2e1b9489 100644 (file)
@@ -1,7 +1,9 @@
 use crate::{
-  community::{Community, CommunitySafe},
   schema::{community, community_follower, user_},
-  user::{UserSafe, User_},
+  source::{
+    community::{Community, CommunitySafe},
+    user::{UserSafe, User_},
+  },
   views::ViewToVec,
   ToSafe,
 };
index a2196ea3477974f16470393e4923b74b750dfafe..c98f072a110fd2b59f8b32ade3c9f079ae3b14e7 100644 (file)
@@ -1,7 +1,9 @@
 use crate::{
-  community::{Community, CommunitySafe},
   schema::{community, community_moderator, user_},
-  user::{UserSafe, User_},
+  source::{
+    community::{Community, CommunitySafe},
+    user::{UserSafe, User_},
+  },
   views::ViewToVec,
   ToSafe,
 };
index faaae0f2dc02762b27ff5fba5fc774420b4bc2c3..3358f01b2d0e5b42cc09706d7ecd3cea967eb4a2 100644 (file)
@@ -1,7 +1,9 @@
 use crate::{
-  community::{Community, CommunitySafe},
   schema::{community, community_user_ban, user_},
-  user::{UserSafe, User_},
+  source::{
+    community::{Community, CommunitySafe},
+    user::{UserSafe, User_},
+  },
   ToSafe,
 };
 use diesel::{result::Error, *};
index 0ac5081e6838d1ea472dd30179f57091862ef9e6..d4518f7f413df90ff87eeb2a267a63e14c45c73c 100644 (file)
@@ -1,12 +1,14 @@
 use crate::{
   aggregates::community_aggregates::CommunityAggregates,
-  category::Category,
-  community::{Community, CommunityFollower, CommunitySafe},
   functions::hot_rank,
   fuzzy_search,
   limit_and_offset,
   schema::{category, community, community_aggregates, community_follower, user_},
-  user::{UserSafe, User_},
+  source::{
+    category::Category,
+    community::{Community, CommunityFollower, CommunitySafe},
+    user::{UserSafe, User_},
+  },
   views::ViewToVec,
   MaybeOptional,
   SortType,
index dc21e621bd94d8b334d46fa2113fe8576d06c9a7..4888f9cfbc63f1bbe9d7c9696f5d72d2e5eaf0f1 100644 (file)
@@ -1,10 +1,8 @@
 use crate::{
   aggregates::post_aggregates::PostAggregates,
-  community::{Community, CommunityFollower, CommunitySafe, CommunityUserBan},
   functions::hot_rank,
   fuzzy_search,
   limit_and_offset,
-  post::{Post, PostRead, PostSaved},
   schema::{
     community,
     community_follower,
@@ -16,7 +14,11 @@ use crate::{
     post_saved,
     user_,
   },
-  user::{UserSafe, User_},
+  source::{
+    community::{Community, CommunityFollower, CommunitySafe, CommunityUserBan},
+    post::{Post, PostRead, PostSaved},
+    user::{UserSafe, User_},
+  },
   views::ViewToVec,
   ListingType,
   MaybeOptional,
@@ -589,10 +591,8 @@ impl ViewToVec for PostView {
 mod tests {
   use crate::{
     aggregates::post_aggregates::PostAggregates,
-    community::*,
-    post::*,
+    source::{community::*, post::*, user::*},
     tests::establish_unpooled_connection,
-    user::*,
     views::post_view::{PostQueryBuilder, PostView},
     Crud,
     Likeable,
index c00b837898dbd1af7e7f7d767369e6d2311eb651..d10702fca95bb07b17af0818f5ece8c70f3376f9 100644 (file)
@@ -1,7 +1,9 @@
 use crate::{
   schema::{site, user_},
-  site::Site,
-  user::{UserSafe, User_},
+  source::{
+    site::Site,
+    user::{UserSafe, User_},
+  },
   ToSafe,
 };
 use diesel::{result::Error, *};
index dae264097995b138ee442e52950cc7b3fbaa72e5..4d4e78c7f75420a17e0977a1b3bdf18a3c829e0c 100644 (file)
@@ -3,7 +3,7 @@ use crate::{
   fuzzy_search,
   limit_and_offset,
   schema::{user_, user_aggregates},
-  user::{UserSafe, User_},
+  source::user::{UserSafe, User_},
   views::ViewToVec,
   MaybeOptional,
   SortType,
index 5d2e42733e193985105ba8bf65fc89b5c98cddc8..3a2e28d94ce0b175a08f5f60741e5e94b5796eed 100644 (file)
@@ -7,10 +7,12 @@ pub mod websocket;
 
 use diesel::PgConnection;
 use lemmy_db::{
-  comment::Comment,
-  post::Post,
-  user::User_,
-  user_mention::{UserMention, UserMentionForm},
+  source::{
+    comment::Comment,
+    post::Post,
+    user::User_,
+    user_mention::{UserMention, UserMentionForm},
+  },
   Crud,
   DbPool,
 };
index 74badcd31b9970c0c753b98c424683285211676c..002c3ace2c5c5ddf5941d04e291a2ec9db07cb2a 100644 (file)
@@ -1,9 +1,8 @@
 use lemmy_db::{
   aggregates::site_aggregates::SiteAggregates,
-  category::*,
   comment_view::*,
   moderator_views::*,
-  user::*,
+  source::{category::*, user::*},
   views::{
     community_view::CommunityView,
     post_view::PostView,
index c41f5bd966ae53c9a0bf90ecc7a6c3f0f4c43edf..7a749e9b4a54c4aec610e7dfed46ffc7ff5afea0 100644 (file)
@@ -4,12 +4,14 @@ use diesel::{
   *,
 };
 use lemmy_db::{
-  comment::Comment,
-  community::{Community, CommunityForm},
   naive_now,
-  post::Post,
-  private_message::PrivateMessage,
-  user::{UserForm, User_},
+  source::{
+    comment::Comment,
+    community::{Community, CommunityForm},
+    post::Post,
+    private_message::PrivateMessage,
+    user::{UserForm, User_},
+  },
   Crud,
 };
 use lemmy_utils::{
index 4dd7643aa61c05f54f52ba9ce288fc5290adc1a9..887faa88dc032d20301bd4ecf19161578af4aa80 100644 (file)
@@ -5,8 +5,7 @@ use diesel::PgConnection;
 use lemmy_api::claims::Claims;
 use lemmy_db::{
   comment_view::{ReplyQueryBuilder, ReplyView},
-  community::Community,
-  user::User_,
+  source::{community::Community, user::User_},
   user_mention_view::{UserMentionQueryBuilder, UserMentionView},
   views::{
     post_view::{PostQueryBuilder, PostView},
index ba687abdf47507293da56d256634da52aa95be92..d59b4e38909aec88f2bb5605339e97d87db23c14 100644 (file)
@@ -1,6 +1,6 @@
 use actix_web::{error::ErrorBadRequest, web::Query, *};
 use anyhow::anyhow;
-use lemmy_db::{community::Community, user::User_};
+use lemmy_db::source::{community::Community, user::User_};
 use lemmy_structs::{blocking, WebFingerLink, WebFingerResponse};
 use lemmy_utils::{
   settings::Settings,
index 2a79dd4b527bfb2363e7f33412cd1abca018b6f5..a61c8ff6e02f5e23a3ee93ebf5cbe8b3afe3edf9 100644 (file)
@@ -29,8 +29,10 @@ use lemmy_apub::{
   },
 };
 use lemmy_db::{
-  community::{Community, CommunityForm},
-  user::{User_, *},
+  source::{
+    community::{Community, CommunityForm},
+    user::{User_, *},
+  },
   Crud,
   ListingType,
   SortType,