mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-11-15 00:43:59 +00:00
Re-organizing source tables into a different folder.
This commit is contained in:
parent
bdd264cd5e
commit
f456f5da46
71 changed files with 216 additions and 169 deletions
|
@ -1,5 +1,5 @@
|
||||||
use jsonwebtoken::{decode, encode, DecodingKey, EncodingKey, Header, TokenData, Validation};
|
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 lemmy_utils::settings::Settings;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
|
|
|
@ -10,12 +10,9 @@ use crate::{
|
||||||
use actix_web::web::Data;
|
use actix_web::web::Data;
|
||||||
use lemmy_apub::{ApubLikeableType, ApubObjectType};
|
use lemmy_apub::{ApubLikeableType, ApubObjectType};
|
||||||
use lemmy_db::{
|
use lemmy_db::{
|
||||||
comment::*,
|
|
||||||
comment_report::*,
|
comment_report::*,
|
||||||
comment_view::*,
|
comment_view::*,
|
||||||
moderator::*,
|
source::{comment::*, moderator::*, post::*, user::*},
|
||||||
post::*,
|
|
||||||
user::*,
|
|
||||||
views::site_view::SiteView,
|
views::site_view::SiteView,
|
||||||
Crud,
|
Crud,
|
||||||
Likeable,
|
Likeable,
|
||||||
|
|
|
@ -10,14 +10,10 @@ use actix_web::web::Data;
|
||||||
use anyhow::Context;
|
use anyhow::Context;
|
||||||
use lemmy_apub::ActorType;
|
use lemmy_apub::ActorType;
|
||||||
use lemmy_db::{
|
use lemmy_db::{
|
||||||
comment::Comment,
|
|
||||||
comment_view::CommentQueryBuilder,
|
comment_view::CommentQueryBuilder,
|
||||||
community::*,
|
|
||||||
diesel_option_overwrite,
|
diesel_option_overwrite,
|
||||||
moderator::*,
|
|
||||||
naive_now,
|
naive_now,
|
||||||
post::Post,
|
source::{comment::Comment, community::*, moderator::*, post::Post, site::*},
|
||||||
site::*,
|
|
||||||
views::{
|
views::{
|
||||||
community_follower_view::CommunityFollowerView,
|
community_follower_view::CommunityFollowerView,
|
||||||
community_moderator_view::CommunityModeratorView,
|
community_moderator_view::CommunityModeratorView,
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
use crate::claims::Claims;
|
use crate::claims::Claims;
|
||||||
use actix_web::{web, web::Data};
|
use actix_web::{web, web::Data};
|
||||||
use lemmy_db::{
|
use lemmy_db::{
|
||||||
|
source::{
|
||||||
community::{Community, CommunityModerator},
|
community::{Community, CommunityModerator},
|
||||||
post::Post,
|
post::Post,
|
||||||
user::User_,
|
user::User_,
|
||||||
|
},
|
||||||
views::community_user_ban_view::CommunityUserBanView,
|
views::community_user_ban_view::CommunityUserBanView,
|
||||||
Crud,
|
Crud,
|
||||||
DbPool,
|
DbPool,
|
||||||
|
|
|
@ -11,10 +11,9 @@ use actix_web::web::Data;
|
||||||
use lemmy_apub::{ApubLikeableType, ApubObjectType};
|
use lemmy_apub::{ApubLikeableType, ApubObjectType};
|
||||||
use lemmy_db::{
|
use lemmy_db::{
|
||||||
comment_view::*,
|
comment_view::*,
|
||||||
moderator::*,
|
|
||||||
naive_now,
|
naive_now,
|
||||||
post::*,
|
|
||||||
post_report::*,
|
post_report::*,
|
||||||
|
source::{moderator::*, post::*},
|
||||||
views::{
|
views::{
|
||||||
community_moderator_view::CommunityModeratorView,
|
community_moderator_view::CommunityModeratorView,
|
||||||
community_view::CommunityView,
|
community_view::CommunityView,
|
||||||
|
|
|
@ -11,13 +11,11 @@ use anyhow::Context;
|
||||||
use lemmy_apub::fetcher::search_by_apub_id;
|
use lemmy_apub::fetcher::search_by_apub_id;
|
||||||
use lemmy_db::{
|
use lemmy_db::{
|
||||||
aggregates::site_aggregates::SiteAggregates,
|
aggregates::site_aggregates::SiteAggregates,
|
||||||
category::*,
|
|
||||||
comment_view::*,
|
comment_view::*,
|
||||||
diesel_option_overwrite,
|
diesel_option_overwrite,
|
||||||
moderator::*,
|
|
||||||
moderator_views::*,
|
moderator_views::*,
|
||||||
naive_now,
|
naive_now,
|
||||||
site::*,
|
source::{category::*, moderator::*, site::*},
|
||||||
views::{
|
views::{
|
||||||
community_view::CommunityQueryBuilder,
|
community_view::CommunityQueryBuilder,
|
||||||
post_view::PostQueryBuilder,
|
post_view::PostQueryBuilder,
|
||||||
|
|
|
@ -15,21 +15,23 @@ use captcha::{gen, Difficulty};
|
||||||
use chrono::Duration;
|
use chrono::Duration;
|
||||||
use lemmy_apub::ApubObjectType;
|
use lemmy_apub::ApubObjectType;
|
||||||
use lemmy_db::{
|
use lemmy_db::{
|
||||||
comment::*,
|
|
||||||
comment_report::CommentReportView,
|
comment_report::CommentReportView,
|
||||||
comment_view::*,
|
comment_view::*,
|
||||||
community::*,
|
|
||||||
diesel_option_overwrite,
|
diesel_option_overwrite,
|
||||||
moderator::*,
|
|
||||||
naive_now,
|
naive_now,
|
||||||
|
post_report::PostReportView,
|
||||||
|
private_message_view::*,
|
||||||
|
source::{
|
||||||
|
comment::*,
|
||||||
|
community::*,
|
||||||
|
moderator::*,
|
||||||
password_reset_request::*,
|
password_reset_request::*,
|
||||||
post::*,
|
post::*,
|
||||||
post_report::PostReportView,
|
|
||||||
private_message::*,
|
private_message::*,
|
||||||
private_message_view::*,
|
|
||||||
site::*,
|
site::*,
|
||||||
user::*,
|
user::*,
|
||||||
user_mention::*,
|
user_mention::*,
|
||||||
|
},
|
||||||
user_mention_view::*,
|
user_mention_view::*,
|
||||||
views::{
|
views::{
|
||||||
community_follower_view::CommunityFollowerView,
|
community_follower_view::CommunityFollowerView,
|
||||||
|
|
|
@ -5,9 +5,11 @@ use activitystreams::{
|
||||||
};
|
};
|
||||||
use anyhow::Context;
|
use anyhow::Context;
|
||||||
use lemmy_db::{
|
use lemmy_db::{
|
||||||
comment::{Comment, CommentLike, CommentLikeForm},
|
|
||||||
comment_view::CommentView,
|
comment_view::CommentView,
|
||||||
|
source::{
|
||||||
|
comment::{Comment, CommentLike, CommentLikeForm},
|
||||||
post::Post,
|
post::Post,
|
||||||
|
},
|
||||||
Likeable,
|
Likeable,
|
||||||
};
|
};
|
||||||
use lemmy_structs::{blocking, comment::CommentResponse, send_local_notifs};
|
use lemmy_structs::{blocking, comment::CommentResponse, send_local_notifs};
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
use crate::activities::receive::get_actor_as_user;
|
use crate::activities::receive::get_actor_as_user;
|
||||||
use activitystreams::activity::{Dislike, Like};
|
use activitystreams::activity::{Dislike, Like};
|
||||||
use lemmy_db::{
|
use lemmy_db::{
|
||||||
comment::{Comment, CommentLike},
|
|
||||||
comment_view::CommentView,
|
comment_view::CommentView,
|
||||||
|
source::comment::{Comment, CommentLike},
|
||||||
Likeable,
|
Likeable,
|
||||||
};
|
};
|
||||||
use lemmy_structs::{blocking, comment::CommentResponse};
|
use lemmy_structs::{blocking, comment::CommentResponse};
|
||||||
|
|
|
@ -4,7 +4,7 @@ use activitystreams::{
|
||||||
base::{AnyBase, ExtendsExt},
|
base::{AnyBase, ExtendsExt},
|
||||||
};
|
};
|
||||||
use anyhow::Context;
|
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_structs::{blocking, community::CommunityResponse};
|
||||||
use lemmy_utils::{location_info, LemmyError};
|
use lemmy_utils::{location_info, LemmyError};
|
||||||
use lemmy_websocket::{messages::SendCommunityRoomMessage, LemmyContext, UserOperation};
|
use lemmy_websocket::{messages::SendCommunityRoomMessage, LemmyContext, UserOperation};
|
||||||
|
|
|
@ -5,7 +5,7 @@ use activitystreams::{
|
||||||
error::DomainError,
|
error::DomainError,
|
||||||
};
|
};
|
||||||
use anyhow::{anyhow, Context};
|
use anyhow::{anyhow, Context};
|
||||||
use lemmy_db::user::User_;
|
use lemmy_db::source::user::User_;
|
||||||
use lemmy_utils::{location_info, LemmyError};
|
use lemmy_utils::{location_info, LemmyError};
|
||||||
use lemmy_websocket::LemmyContext;
|
use lemmy_websocket::LemmyContext;
|
||||||
use log::debug;
|
use log::debug;
|
||||||
|
|
|
@ -5,7 +5,7 @@ use activitystreams::{
|
||||||
};
|
};
|
||||||
use anyhow::Context;
|
use anyhow::Context;
|
||||||
use lemmy_db::{
|
use lemmy_db::{
|
||||||
post::{Post, PostLike, PostLikeForm},
|
source::post::{Post, PostLike, PostLikeForm},
|
||||||
views::post_view::PostView,
|
views::post_view::PostView,
|
||||||
Likeable,
|
Likeable,
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
use crate::activities::receive::get_actor_as_user;
|
use crate::activities::receive::get_actor_as_user;
|
||||||
use activitystreams::activity::{Dislike, Like};
|
use activitystreams::activity::{Dislike, Like};
|
||||||
use lemmy_db::{
|
use lemmy_db::{
|
||||||
post::{Post, PostLike},
|
source::post::{Post, PostLike},
|
||||||
views::post_view::PostView,
|
views::post_view::PostView,
|
||||||
Likeable,
|
Likeable,
|
||||||
};
|
};
|
||||||
|
|
|
@ -13,7 +13,7 @@ use activitystreams::{
|
||||||
public,
|
public,
|
||||||
};
|
};
|
||||||
use anyhow::{anyhow, Context};
|
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_structs::{blocking, user::PrivateMessageResponse};
|
||||||
use lemmy_utils::{location_info, LemmyError};
|
use lemmy_utils::{location_info, LemmyError};
|
||||||
use lemmy_websocket::{messages::SendUserRoomMessage, LemmyContext, UserOperation};
|
use lemmy_websocket::{messages::SendUserRoomMessage, LemmyContext, UserOperation};
|
||||||
|
|
|
@ -26,7 +26,11 @@ use activitystreams::{
|
||||||
};
|
};
|
||||||
use anyhow::anyhow;
|
use anyhow::anyhow;
|
||||||
use itertools::Itertools;
|
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_structs::{blocking, WebFingerResponse};
|
||||||
use lemmy_utils::{
|
use lemmy_utils::{
|
||||||
request::{retry, RecvError},
|
request::{retry, RecvError},
|
||||||
|
|
|
@ -24,7 +24,7 @@ use activitystreams::{
|
||||||
use anyhow::Context;
|
use anyhow::Context;
|
||||||
use itertools::Itertools;
|
use itertools::Itertools;
|
||||||
use lemmy_db::{
|
use lemmy_db::{
|
||||||
community::Community,
|
source::community::Community,
|
||||||
views::community_follower_view::CommunityFollowerView,
|
views::community_follower_view::CommunityFollowerView,
|
||||||
DbPool,
|
DbPool,
|
||||||
};
|
};
|
||||||
|
|
|
@ -21,7 +21,10 @@ use activitystreams::{
|
||||||
prelude::*,
|
prelude::*,
|
||||||
public,
|
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_structs::blocking;
|
||||||
use lemmy_utils::LemmyError;
|
use lemmy_utils::LemmyError;
|
||||||
use lemmy_websocket::LemmyContext;
|
use lemmy_websocket::LemmyContext;
|
||||||
|
|
|
@ -16,7 +16,10 @@ use activitystreams::{
|
||||||
},
|
},
|
||||||
prelude::*,
|
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_structs::blocking;
|
||||||
use lemmy_utils::LemmyError;
|
use lemmy_utils::LemmyError;
|
||||||
use lemmy_websocket::LemmyContext;
|
use lemmy_websocket::LemmyContext;
|
||||||
|
|
|
@ -14,8 +14,10 @@ use activitystreams::{
|
||||||
object::ObjectExt,
|
object::ObjectExt,
|
||||||
};
|
};
|
||||||
use lemmy_db::{
|
use lemmy_db::{
|
||||||
|
source::{
|
||||||
community::{Community, CommunityFollower, CommunityFollowerForm},
|
community::{Community, CommunityFollower, CommunityFollowerForm},
|
||||||
user::User_,
|
user::User_,
|
||||||
|
},
|
||||||
ApubObject,
|
ApubObject,
|
||||||
DbPool,
|
DbPool,
|
||||||
Followable,
|
Followable,
|
||||||
|
|
|
@ -19,7 +19,10 @@ use background_jobs::{
|
||||||
WorkerConfig,
|
WorkerConfig,
|
||||||
};
|
};
|
||||||
use itertools::Itertools;
|
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_utils::{location_info, settings::Settings, LemmyError};
|
||||||
use lemmy_websocket::LemmyContext;
|
use lemmy_websocket::LemmyContext;
|
||||||
use log::{debug, warn};
|
use log::{debug, warn};
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
use activitystreams::unparsed::UnparsedMutExt;
|
use activitystreams::unparsed::UnparsedMutExt;
|
||||||
use activitystreams_ext::UnparsedExtension;
|
use activitystreams_ext::UnparsedExtension;
|
||||||
use diesel::PgConnection;
|
use diesel::PgConnection;
|
||||||
use lemmy_db::{category::Category, Crud};
|
use lemmy_db::{source::category::Category, Crud};
|
||||||
use lemmy_utils::LemmyError;
|
use lemmy_utils::LemmyError;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
|
|
|
@ -13,12 +13,14 @@ use anyhow::{anyhow, Context};
|
||||||
use chrono::NaiveDateTime;
|
use chrono::NaiveDateTime;
|
||||||
use diesel::result::Error::NotFound;
|
use diesel::result::Error::NotFound;
|
||||||
use lemmy_db::{
|
use lemmy_db::{
|
||||||
comment::Comment,
|
|
||||||
comment_view::CommentView,
|
comment_view::CommentView,
|
||||||
community::{Community, CommunityModerator, CommunityModeratorForm},
|
|
||||||
naive_now,
|
naive_now,
|
||||||
|
source::{
|
||||||
|
comment::Comment,
|
||||||
|
community::{Community, CommunityModerator, CommunityModeratorForm},
|
||||||
post::Post,
|
post::Post,
|
||||||
user::User_,
|
user::User_,
|
||||||
|
},
|
||||||
views::{community_view::CommunityView, post_view::PostView, user_view::UserViewSafe},
|
views::{community_view::CommunityView, post_view::PostView, user_view::UserViewSafe},
|
||||||
ApubObject,
|
ApubObject,
|
||||||
Joinable,
|
Joinable,
|
||||||
|
|
|
@ -4,7 +4,7 @@ use crate::{
|
||||||
};
|
};
|
||||||
use actix_web::{body::Body, web, web::Path, HttpResponse};
|
use actix_web::{body::Body, web, web::Path, HttpResponse};
|
||||||
use diesel::result::Error::NotFound;
|
use diesel::result::Error::NotFound;
|
||||||
use lemmy_db::{comment::Comment, Crud};
|
use lemmy_db::{source::comment::Comment, Crud};
|
||||||
use lemmy_structs::blocking;
|
use lemmy_structs::blocking;
|
||||||
use lemmy_utils::LemmyError;
|
use lemmy_utils::LemmyError;
|
||||||
use lemmy_websocket::LemmyContext;
|
use lemmy_websocket::LemmyContext;
|
||||||
|
|
|
@ -10,8 +10,7 @@ use activitystreams::{
|
||||||
};
|
};
|
||||||
use actix_web::{body::Body, web, HttpResponse};
|
use actix_web::{body::Body, web, HttpResponse};
|
||||||
use lemmy_db::{
|
use lemmy_db::{
|
||||||
community::Community,
|
source::{community::Community, post::Post},
|
||||||
post::Post,
|
|
||||||
views::community_follower_view::CommunityFollowerView,
|
views::community_follower_view::CommunityFollowerView,
|
||||||
};
|
};
|
||||||
use lemmy_structs::blocking;
|
use lemmy_structs::blocking;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
use crate::APUB_JSON_CONTENT_TYPE;
|
use crate::APUB_JSON_CONTENT_TYPE;
|
||||||
use actix_web::{body::Body, web, HttpResponse};
|
use actix_web::{body::Body, web, HttpResponse};
|
||||||
use lemmy_db::activity::Activity;
|
use lemmy_db::source::activity::Activity;
|
||||||
use lemmy_structs::blocking;
|
use lemmy_structs::blocking;
|
||||||
use lemmy_utils::{settings::Settings, LemmyError};
|
use lemmy_utils::{settings::Settings, LemmyError};
|
||||||
use lemmy_websocket::LemmyContext;
|
use lemmy_websocket::LemmyContext;
|
||||||
|
|
|
@ -4,7 +4,7 @@ use crate::{
|
||||||
};
|
};
|
||||||
use actix_web::{body::Body, web, HttpResponse};
|
use actix_web::{body::Body, web, HttpResponse};
|
||||||
use diesel::result::Error::NotFound;
|
use diesel::result::Error::NotFound;
|
||||||
use lemmy_db::post::Post;
|
use lemmy_db::source::post::Post;
|
||||||
use lemmy_structs::blocking;
|
use lemmy_structs::blocking;
|
||||||
use lemmy_utils::LemmyError;
|
use lemmy_utils::LemmyError;
|
||||||
use lemmy_websocket::LemmyContext;
|
use lemmy_websocket::LemmyContext;
|
||||||
|
|
|
@ -9,7 +9,7 @@ use activitystreams::{
|
||||||
collection::{CollectionExt, OrderedCollection},
|
collection::{CollectionExt, OrderedCollection},
|
||||||
};
|
};
|
||||||
use actix_web::{body::Body, web, HttpResponse};
|
use actix_web::{body::Body, web, HttpResponse};
|
||||||
use lemmy_db::user::User_;
|
use lemmy_db::source::user::User_;
|
||||||
use lemmy_structs::blocking;
|
use lemmy_structs::blocking;
|
||||||
use lemmy_utils::LemmyError;
|
use lemmy_utils::LemmyError;
|
||||||
use lemmy_websocket::LemmyContext;
|
use lemmy_websocket::LemmyContext;
|
||||||
|
|
|
@ -27,8 +27,10 @@ use activitystreams::{
|
||||||
use actix_web::{web, HttpRequest, HttpResponse};
|
use actix_web::{web, HttpRequest, HttpResponse};
|
||||||
use anyhow::{anyhow, Context};
|
use anyhow::{anyhow, Context};
|
||||||
use lemmy_db::{
|
use lemmy_db::{
|
||||||
|
source::{
|
||||||
community::{Community, CommunityFollower, CommunityFollowerForm},
|
community::{Community, CommunityFollower, CommunityFollowerForm},
|
||||||
user::User_,
|
user::User_,
|
||||||
|
},
|
||||||
views::community_user_ban_view::CommunityUserBanView,
|
views::community_user_ban_view::CommunityUserBanView,
|
||||||
ApubObject,
|
ApubObject,
|
||||||
DbPool,
|
DbPool,
|
||||||
|
|
|
@ -12,7 +12,11 @@ use activitystreams::{
|
||||||
};
|
};
|
||||||
use actix_web::HttpRequest;
|
use actix_web::HttpRequest;
|
||||||
use anyhow::{anyhow, Context};
|
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_structs::blocking;
|
||||||
use lemmy_utils::{location_info, settings::Settings, LemmyError};
|
use lemmy_utils::{location_info, settings::Settings, LemmyError};
|
||||||
use lemmy_websocket::LemmyContext;
|
use lemmy_websocket::LemmyContext;
|
||||||
|
|
|
@ -41,7 +41,11 @@ use activitystreams::{
|
||||||
};
|
};
|
||||||
use anyhow::Context;
|
use anyhow::Context;
|
||||||
use diesel::result::Error::NotFound;
|
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_structs::blocking;
|
||||||
use lemmy_utils::{location_info, LemmyError};
|
use lemmy_utils::{location_info, LemmyError};
|
||||||
use lemmy_websocket::LemmyContext;
|
use lemmy_websocket::LemmyContext;
|
||||||
|
|
|
@ -15,7 +15,7 @@ use crate::{
|
||||||
use activitystreams::{activity::ActorAndObject, prelude::*};
|
use activitystreams::{activity::ActorAndObject, prelude::*};
|
||||||
use actix_web::{web, HttpRequest, HttpResponse};
|
use actix_web::{web, HttpRequest, HttpResponse};
|
||||||
use anyhow::Context;
|
use anyhow::Context;
|
||||||
use lemmy_db::{community::Community, ApubObject, DbPool};
|
use lemmy_db::{source::community::Community, ApubObject, DbPool};
|
||||||
use lemmy_structs::blocking;
|
use lemmy_structs::blocking;
|
||||||
use lemmy_utils::{location_info, LemmyError};
|
use lemmy_utils::{location_info, LemmyError};
|
||||||
use lemmy_websocket::LemmyContext;
|
use lemmy_websocket::LemmyContext;
|
||||||
|
|
|
@ -49,9 +49,11 @@ use actix_web::{web, HttpRequest, HttpResponse};
|
||||||
use anyhow::{anyhow, Context};
|
use anyhow::{anyhow, Context};
|
||||||
use diesel::NotFound;
|
use diesel::NotFound;
|
||||||
use lemmy_db::{
|
use lemmy_db::{
|
||||||
|
source::{
|
||||||
community::{Community, CommunityFollower},
|
community::{Community, CommunityFollower},
|
||||||
private_message::PrivateMessage,
|
private_message::PrivateMessage,
|
||||||
user::User_,
|
user::User_,
|
||||||
|
},
|
||||||
ApubObject,
|
ApubObject,
|
||||||
Followable,
|
Followable,
|
||||||
};
|
};
|
||||||
|
|
|
@ -22,7 +22,10 @@ use activitystreams::{
|
||||||
};
|
};
|
||||||
use activitystreams_ext::{Ext1, Ext2};
|
use activitystreams_ext::{Ext1, Ext2};
|
||||||
use anyhow::{anyhow, Context};
|
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_structs::blocking;
|
||||||
use lemmy_utils::{location_info, settings::Settings, LemmyError};
|
use lemmy_utils::{location_info, settings::Settings, LemmyError};
|
||||||
use lemmy_websocket::LemmyContext;
|
use lemmy_websocket::LemmyContext;
|
||||||
|
|
|
@ -24,10 +24,12 @@ use activitystreams::{
|
||||||
};
|
};
|
||||||
use anyhow::{anyhow, Context};
|
use anyhow::{anyhow, Context};
|
||||||
use lemmy_db::{
|
use lemmy_db::{
|
||||||
|
source::{
|
||||||
comment::{Comment, CommentForm},
|
comment::{Comment, CommentForm},
|
||||||
community::Community,
|
community::Community,
|
||||||
post::Post,
|
post::Post,
|
||||||
user::User_,
|
user::User_,
|
||||||
|
},
|
||||||
Crud,
|
Crud,
|
||||||
DbPool,
|
DbPool,
|
||||||
};
|
};
|
||||||
|
|
|
@ -23,8 +23,8 @@ use activitystreams::{
|
||||||
use activitystreams_ext::Ext2;
|
use activitystreams_ext::Ext2;
|
||||||
use anyhow::Context;
|
use anyhow::Context;
|
||||||
use lemmy_db::{
|
use lemmy_db::{
|
||||||
community::{Community, CommunityForm},
|
|
||||||
naive_now,
|
naive_now,
|
||||||
|
source::community::{Community, CommunityForm},
|
||||||
views::community_moderator_view::CommunityModeratorView,
|
views::community_moderator_view::CommunityModeratorView,
|
||||||
DbPool,
|
DbPool,
|
||||||
};
|
};
|
||||||
|
|
|
@ -21,9 +21,11 @@ use activitystreams::{
|
||||||
use activitystreams_ext::Ext1;
|
use activitystreams_ext::Ext1;
|
||||||
use anyhow::Context;
|
use anyhow::Context;
|
||||||
use lemmy_db::{
|
use lemmy_db::{
|
||||||
|
source::{
|
||||||
community::Community,
|
community::Community,
|
||||||
post::{Post, PostForm},
|
post::{Post, PostForm},
|
||||||
user::User_,
|
user::User_,
|
||||||
|
},
|
||||||
Crud,
|
Crud,
|
||||||
DbPool,
|
DbPool,
|
||||||
};
|
};
|
||||||
|
|
|
@ -20,8 +20,10 @@ use activitystreams::{
|
||||||
};
|
};
|
||||||
use anyhow::Context;
|
use anyhow::Context;
|
||||||
use lemmy_db::{
|
use lemmy_db::{
|
||||||
|
source::{
|
||||||
private_message::{PrivateMessage, PrivateMessageForm},
|
private_message::{PrivateMessage, PrivateMessageForm},
|
||||||
user::User_,
|
user::User_,
|
||||||
|
},
|
||||||
Crud,
|
Crud,
|
||||||
DbPool,
|
DbPool,
|
||||||
};
|
};
|
||||||
|
|
|
@ -20,7 +20,7 @@ use activitystreams_ext::Ext1;
|
||||||
use anyhow::Context;
|
use anyhow::Context;
|
||||||
use lemmy_db::{
|
use lemmy_db::{
|
||||||
naive_now,
|
naive_now,
|
||||||
user::{UserForm, User_},
|
source::user::{UserForm, User_},
|
||||||
ApubObject,
|
ApubObject,
|
||||||
DbPool,
|
DbPool,
|
||||||
};
|
};
|
||||||
|
|
|
@ -24,11 +24,13 @@ impl CommunityAggregates {
|
||||||
mod tests {
|
mod tests {
|
||||||
use crate::{
|
use crate::{
|
||||||
aggregates::community_aggregates::CommunityAggregates,
|
aggregates::community_aggregates::CommunityAggregates,
|
||||||
|
source::{
|
||||||
comment::{Comment, CommentForm},
|
comment::{Comment, CommentForm},
|
||||||
community::{Community, CommunityFollower, CommunityFollowerForm, CommunityForm},
|
community::{Community, CommunityFollower, CommunityFollowerForm, CommunityForm},
|
||||||
post::{Post, PostForm},
|
post::{Post, PostForm},
|
||||||
tests::establish_unpooled_connection,
|
|
||||||
user::{UserForm, User_},
|
user::{UserForm, User_},
|
||||||
|
},
|
||||||
|
tests::establish_unpooled_connection,
|
||||||
Crud,
|
Crud,
|
||||||
Followable,
|
Followable,
|
||||||
ListingType,
|
ListingType,
|
||||||
|
|
|
@ -26,11 +26,13 @@ impl PostAggregates {
|
||||||
mod tests {
|
mod tests {
|
||||||
use crate::{
|
use crate::{
|
||||||
aggregates::post_aggregates::PostAggregates,
|
aggregates::post_aggregates::PostAggregates,
|
||||||
|
source::{
|
||||||
comment::{Comment, CommentForm},
|
comment::{Comment, CommentForm},
|
||||||
community::{Community, CommunityForm},
|
community::{Community, CommunityForm},
|
||||||
post::{Post, PostForm, PostLike, PostLikeForm},
|
post::{Post, PostForm, PostLike, PostLikeForm},
|
||||||
tests::establish_unpooled_connection,
|
|
||||||
user::{UserForm, User_},
|
user::{UserForm, User_},
|
||||||
|
},
|
||||||
|
tests::establish_unpooled_connection,
|
||||||
Crud,
|
Crud,
|
||||||
Likeable,
|
Likeable,
|
||||||
ListingType,
|
ListingType,
|
||||||
|
|
|
@ -22,11 +22,13 @@ impl SiteAggregates {
|
||||||
mod tests {
|
mod tests {
|
||||||
use crate::{
|
use crate::{
|
||||||
aggregates::site_aggregates::SiteAggregates,
|
aggregates::site_aggregates::SiteAggregates,
|
||||||
|
source::{
|
||||||
comment::{Comment, CommentForm},
|
comment::{Comment, CommentForm},
|
||||||
community::{Community, CommunityForm},
|
community::{Community, CommunityForm},
|
||||||
post::{Post, PostForm},
|
post::{Post, PostForm},
|
||||||
tests::establish_unpooled_connection,
|
|
||||||
user::{UserForm, User_},
|
user::{UserForm, User_},
|
||||||
|
},
|
||||||
|
tests::establish_unpooled_connection,
|
||||||
Crud,
|
Crud,
|
||||||
ListingType,
|
ListingType,
|
||||||
SortType,
|
SortType,
|
||||||
|
|
|
@ -25,11 +25,13 @@ impl UserAggregates {
|
||||||
mod tests {
|
mod tests {
|
||||||
use crate::{
|
use crate::{
|
||||||
aggregates::user_aggregates::UserAggregates,
|
aggregates::user_aggregates::UserAggregates,
|
||||||
|
source::{
|
||||||
comment::{Comment, CommentForm, CommentLike, CommentLikeForm},
|
comment::{Comment, CommentForm, CommentLike, CommentLikeForm},
|
||||||
community::{Community, CommunityForm},
|
community::{Community, CommunityForm},
|
||||||
post::{Post, PostForm, PostLike, PostLikeForm},
|
post::{Post, PostForm, PostLike, PostLikeForm},
|
||||||
tests::establish_unpooled_connection,
|
|
||||||
user::{UserForm, User_},
|
user::{UserForm, User_},
|
||||||
|
},
|
||||||
|
tests::establish_unpooled_connection,
|
||||||
Crud,
|
Crud,
|
||||||
Likeable,
|
Likeable,
|
||||||
ListingType,
|
ListingType,
|
||||||
|
|
|
@ -2,10 +2,10 @@ use diesel::{dsl::*, pg::Pg, result::Error, *};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
comment::Comment,
|
|
||||||
limit_and_offset,
|
limit_and_offset,
|
||||||
naive_now,
|
naive_now,
|
||||||
schema::comment_report,
|
schema::comment_report,
|
||||||
|
source::comment::Comment,
|
||||||
MaybeOptional,
|
MaybeOptional,
|
||||||
Reportable,
|
Reportable,
|
||||||
};
|
};
|
||||||
|
|
|
@ -497,12 +497,9 @@ impl<'a> ReplyQueryBuilder<'a> {
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use crate::{
|
use crate::{
|
||||||
comment::*,
|
|
||||||
comment_view::*,
|
comment_view::*,
|
||||||
community::*,
|
source::{comment::*, community::*, post::*, user::*},
|
||||||
post::*,
|
|
||||||
tests::establish_unpooled_connection,
|
tests::establish_unpooled_connection,
|
||||||
user::*,
|
|
||||||
Crud,
|
Crud,
|
||||||
Likeable,
|
Likeable,
|
||||||
*,
|
*,
|
||||||
|
|
|
@ -11,25 +11,16 @@ use regex::Regex;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use std::{env, env::VarError};
|
use std::{env, env::VarError};
|
||||||
|
|
||||||
pub mod activity;
|
|
||||||
pub mod aggregates;
|
|
||||||
pub mod category;
|
|
||||||
pub mod comment;
|
|
||||||
pub mod comment_report;
|
pub mod comment_report;
|
||||||
pub mod comment_view;
|
pub mod comment_view;
|
||||||
pub mod community;
|
|
||||||
pub mod moderator;
|
|
||||||
pub mod moderator_views;
|
pub mod moderator_views;
|
||||||
pub mod password_reset_request;
|
|
||||||
pub mod post;
|
|
||||||
pub mod post_report;
|
pub mod post_report;
|
||||||
pub mod private_message;
|
|
||||||
pub mod private_message_view;
|
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 user_mention_view;
|
||||||
|
|
||||||
|
pub mod aggregates;
|
||||||
|
pub mod schema;
|
||||||
|
pub mod source;
|
||||||
pub mod views;
|
pub mod views;
|
||||||
|
|
||||||
pub type DbPool = diesel::r2d2::Pool<diesel::r2d2::ConnectionManager<diesel::PgConnection>>;
|
pub type DbPool = diesel::r2d2::Pool<diesel::r2d2::ConnectionManager<diesel::PgConnection>>;
|
||||||
|
|
|
@ -4,8 +4,8 @@ use serde::{Deserialize, Serialize};
|
||||||
use crate::{
|
use crate::{
|
||||||
limit_and_offset,
|
limit_and_offset,
|
||||||
naive_now,
|
naive_now,
|
||||||
post::Post,
|
|
||||||
schema::post_report,
|
schema::post_report,
|
||||||
|
source::post::Post,
|
||||||
MaybeOptional,
|
MaybeOptional,
|
||||||
Reportable,
|
Reportable,
|
||||||
};
|
};
|
||||||
|
|
|
@ -97,9 +97,11 @@ impl Activity {
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use crate::{
|
use crate::{
|
||||||
|
source::{
|
||||||
activity::{Activity, ActivityForm},
|
activity::{Activity, ActivityForm},
|
||||||
tests::establish_unpooled_connection,
|
|
||||||
user::{UserForm, User_},
|
user::{UserForm, User_},
|
||||||
|
},
|
||||||
|
tests::establish_unpooled_connection,
|
||||||
Crud,
|
Crud,
|
||||||
ListingType,
|
ListingType,
|
||||||
SortType,
|
SortType,
|
|
@ -48,7 +48,7 @@ impl Category {
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use crate::{category::Category, tests::establish_unpooled_connection};
|
use crate::{source::category::Category, tests::establish_unpooled_connection};
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_crud() {
|
fn test_crud() {
|
|
@ -260,11 +260,8 @@ impl Saveable<CommentSavedForm> for CommentSaved {
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use crate::{
|
use crate::{
|
||||||
comment::*,
|
source::{comment::*, community::*, post::*, user::*},
|
||||||
community::*,
|
|
||||||
post::*,
|
|
||||||
tests::establish_unpooled_connection,
|
tests::establish_unpooled_connection,
|
||||||
user::*,
|
|
||||||
Crud,
|
Crud,
|
||||||
ListingType,
|
ListingType,
|
||||||
SortType,
|
SortType,
|
|
@ -55,7 +55,7 @@ pub struct CommunitySafe {
|
||||||
}
|
}
|
||||||
|
|
||||||
mod safe_type {
|
mod safe_type {
|
||||||
use crate::{community::Community, schema::community::columns::*, ToSafe};
|
use crate::{schema::community::columns::*, source::community::Community, ToSafe};
|
||||||
type Columns = (
|
type Columns = (
|
||||||
id,
|
id,
|
||||||
name,
|
name,
|
||||||
|
@ -415,7 +415,12 @@ impl Followable<CommunityFollowerForm> for CommunityFollower {
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use crate::{community::*, tests::establish_unpooled_connection, user::*, ListingType, SortType};
|
use crate::{
|
||||||
|
source::{community::*, user::*},
|
||||||
|
tests::establish_unpooled_connection,
|
||||||
|
ListingType,
|
||||||
|
SortType,
|
||||||
|
};
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_crud() {
|
fn test_crud() {
|
11
lemmy_db/src/source/mod.rs
Normal file
11
lemmy_db/src/source/mod.rs
Normal file
|
@ -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;
|
|
@ -392,12 +392,8 @@ impl Crud<ModAddForm> for ModAdd {
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use crate::{
|
use crate::{
|
||||||
comment::*,
|
source::{comment::*, community::*, moderator::*, post::*, user::*},
|
||||||
community::*,
|
|
||||||
moderator::*,
|
|
||||||
post::*,
|
|
||||||
tests::establish_unpooled_connection,
|
tests::establish_unpooled_connection,
|
||||||
user::*,
|
|
||||||
ListingType,
|
ListingType,
|
||||||
SortType,
|
SortType,
|
||||||
};
|
};
|
|
@ -80,7 +80,7 @@ impl PasswordResetRequest {
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::super::user::*;
|
use super::super::user::*;
|
||||||
use crate::{
|
use crate::{
|
||||||
password_reset_request::PasswordResetRequest,
|
source::password_reset_request::PasswordResetRequest,
|
||||||
tests::establish_unpooled_connection,
|
tests::establish_unpooled_connection,
|
||||||
Crud,
|
Crud,
|
||||||
ListingType,
|
ListingType,
|
|
@ -332,10 +332,8 @@ impl Readable<PostReadForm> for PostRead {
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use crate::{
|
use crate::{
|
||||||
community::*,
|
source::{community::*, post::*, user::*},
|
||||||
post::*,
|
|
||||||
tests::establish_unpooled_connection,
|
tests::establish_unpooled_connection,
|
||||||
user::*,
|
|
||||||
ListingType,
|
ListingType,
|
||||||
SortType,
|
SortType,
|
||||||
};
|
};
|
|
@ -138,9 +138,8 @@ impl PrivateMessage {
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use crate::{
|
use crate::{
|
||||||
private_message::*,
|
source::{private_message::*, user::*},
|
||||||
tests::establish_unpooled_connection,
|
tests::establish_unpooled_connection,
|
||||||
user::*,
|
|
||||||
ListingType,
|
ListingType,
|
||||||
SortType,
|
SortType,
|
||||||
};
|
};
|
|
@ -62,7 +62,7 @@ pub struct UserSafe {
|
||||||
}
|
}
|
||||||
|
|
||||||
mod safe_type {
|
mod safe_type {
|
||||||
use crate::{schema::user_::columns::*, user::User_, ToSafe};
|
use crate::{schema::user_::columns::*, source::user::User_, ToSafe};
|
||||||
type Columns = (
|
type Columns = (
|
||||||
id,
|
id,
|
||||||
name,
|
name,
|
||||||
|
@ -275,7 +275,7 @@ impl User_ {
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use crate::{tests::establish_unpooled_connection, user::*, ListingType, SortType};
|
use crate::{source::user::*, tests::establish_unpooled_connection, ListingType, SortType};
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_crud() {
|
fn test_crud() {
|
|
@ -73,12 +73,8 @@ impl UserMention {
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use crate::{
|
use crate::{
|
||||||
comment::*,
|
source::{comment::*, community::*, post::*, user::*, user_mention::*},
|
||||||
community::*,
|
|
||||||
post::*,
|
|
||||||
tests::establish_unpooled_connection,
|
tests::establish_unpooled_connection,
|
||||||
user::*,
|
|
||||||
user_mention::*,
|
|
||||||
ListingType,
|
ListingType,
|
||||||
SortType,
|
SortType,
|
||||||
};
|
};
|
|
@ -1,7 +1,9 @@
|
||||||
use crate::{
|
use crate::{
|
||||||
community::{Community, CommunitySafe},
|
|
||||||
schema::{community, community_follower, user_},
|
schema::{community, community_follower, user_},
|
||||||
|
source::{
|
||||||
|
community::{Community, CommunitySafe},
|
||||||
user::{UserSafe, User_},
|
user::{UserSafe, User_},
|
||||||
|
},
|
||||||
views::ViewToVec,
|
views::ViewToVec,
|
||||||
ToSafe,
|
ToSafe,
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
use crate::{
|
use crate::{
|
||||||
community::{Community, CommunitySafe},
|
|
||||||
schema::{community, community_moderator, user_},
|
schema::{community, community_moderator, user_},
|
||||||
|
source::{
|
||||||
|
community::{Community, CommunitySafe},
|
||||||
user::{UserSafe, User_},
|
user::{UserSafe, User_},
|
||||||
|
},
|
||||||
views::ViewToVec,
|
views::ViewToVec,
|
||||||
ToSafe,
|
ToSafe,
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
use crate::{
|
use crate::{
|
||||||
community::{Community, CommunitySafe},
|
|
||||||
schema::{community, community_user_ban, user_},
|
schema::{community, community_user_ban, user_},
|
||||||
|
source::{
|
||||||
|
community::{Community, CommunitySafe},
|
||||||
user::{UserSafe, User_},
|
user::{UserSafe, User_},
|
||||||
|
},
|
||||||
ToSafe,
|
ToSafe,
|
||||||
};
|
};
|
||||||
use diesel::{result::Error, *};
|
use diesel::{result::Error, *};
|
||||||
|
|
|
@ -1,12 +1,14 @@
|
||||||
use crate::{
|
use crate::{
|
||||||
aggregates::community_aggregates::CommunityAggregates,
|
aggregates::community_aggregates::CommunityAggregates,
|
||||||
category::Category,
|
|
||||||
community::{Community, CommunityFollower, CommunitySafe},
|
|
||||||
functions::hot_rank,
|
functions::hot_rank,
|
||||||
fuzzy_search,
|
fuzzy_search,
|
||||||
limit_and_offset,
|
limit_and_offset,
|
||||||
schema::{category, community, community_aggregates, community_follower, user_},
|
schema::{category, community, community_aggregates, community_follower, user_},
|
||||||
|
source::{
|
||||||
|
category::Category,
|
||||||
|
community::{Community, CommunityFollower, CommunitySafe},
|
||||||
user::{UserSafe, User_},
|
user::{UserSafe, User_},
|
||||||
|
},
|
||||||
views::ViewToVec,
|
views::ViewToVec,
|
||||||
MaybeOptional,
|
MaybeOptional,
|
||||||
SortType,
|
SortType,
|
||||||
|
|
|
@ -1,10 +1,8 @@
|
||||||
use crate::{
|
use crate::{
|
||||||
aggregates::post_aggregates::PostAggregates,
|
aggregates::post_aggregates::PostAggregates,
|
||||||
community::{Community, CommunityFollower, CommunitySafe, CommunityUserBan},
|
|
||||||
functions::hot_rank,
|
functions::hot_rank,
|
||||||
fuzzy_search,
|
fuzzy_search,
|
||||||
limit_and_offset,
|
limit_and_offset,
|
||||||
post::{Post, PostRead, PostSaved},
|
|
||||||
schema::{
|
schema::{
|
||||||
community,
|
community,
|
||||||
community_follower,
|
community_follower,
|
||||||
|
@ -16,7 +14,11 @@ use crate::{
|
||||||
post_saved,
|
post_saved,
|
||||||
user_,
|
user_,
|
||||||
},
|
},
|
||||||
|
source::{
|
||||||
|
community::{Community, CommunityFollower, CommunitySafe, CommunityUserBan},
|
||||||
|
post::{Post, PostRead, PostSaved},
|
||||||
user::{UserSafe, User_},
|
user::{UserSafe, User_},
|
||||||
|
},
|
||||||
views::ViewToVec,
|
views::ViewToVec,
|
||||||
ListingType,
|
ListingType,
|
||||||
MaybeOptional,
|
MaybeOptional,
|
||||||
|
@ -589,10 +591,8 @@ impl ViewToVec for PostView {
|
||||||
mod tests {
|
mod tests {
|
||||||
use crate::{
|
use crate::{
|
||||||
aggregates::post_aggregates::PostAggregates,
|
aggregates::post_aggregates::PostAggregates,
|
||||||
community::*,
|
source::{community::*, post::*, user::*},
|
||||||
post::*,
|
|
||||||
tests::establish_unpooled_connection,
|
tests::establish_unpooled_connection,
|
||||||
user::*,
|
|
||||||
views::post_view::{PostQueryBuilder, PostView},
|
views::post_view::{PostQueryBuilder, PostView},
|
||||||
Crud,
|
Crud,
|
||||||
Likeable,
|
Likeable,
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
use crate::{
|
use crate::{
|
||||||
schema::{site, user_},
|
schema::{site, user_},
|
||||||
|
source::{
|
||||||
site::Site,
|
site::Site,
|
||||||
user::{UserSafe, User_},
|
user::{UserSafe, User_},
|
||||||
|
},
|
||||||
ToSafe,
|
ToSafe,
|
||||||
};
|
};
|
||||||
use diesel::{result::Error, *};
|
use diesel::{result::Error, *};
|
||||||
|
|
|
@ -3,7 +3,7 @@ use crate::{
|
||||||
fuzzy_search,
|
fuzzy_search,
|
||||||
limit_and_offset,
|
limit_and_offset,
|
||||||
schema::{user_, user_aggregates},
|
schema::{user_, user_aggregates},
|
||||||
user::{UserSafe, User_},
|
source::user::{UserSafe, User_},
|
||||||
views::ViewToVec,
|
views::ViewToVec,
|
||||||
MaybeOptional,
|
MaybeOptional,
|
||||||
SortType,
|
SortType,
|
||||||
|
|
|
@ -7,10 +7,12 @@ pub mod websocket;
|
||||||
|
|
||||||
use diesel::PgConnection;
|
use diesel::PgConnection;
|
||||||
use lemmy_db::{
|
use lemmy_db::{
|
||||||
|
source::{
|
||||||
comment::Comment,
|
comment::Comment,
|
||||||
post::Post,
|
post::Post,
|
||||||
user::User_,
|
user::User_,
|
||||||
user_mention::{UserMention, UserMentionForm},
|
user_mention::{UserMention, UserMentionForm},
|
||||||
|
},
|
||||||
Crud,
|
Crud,
|
||||||
DbPool,
|
DbPool,
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
use lemmy_db::{
|
use lemmy_db::{
|
||||||
aggregates::site_aggregates::SiteAggregates,
|
aggregates::site_aggregates::SiteAggregates,
|
||||||
category::*,
|
|
||||||
comment_view::*,
|
comment_view::*,
|
||||||
moderator_views::*,
|
moderator_views::*,
|
||||||
user::*,
|
source::{category::*, user::*},
|
||||||
views::{
|
views::{
|
||||||
community_view::CommunityView,
|
community_view::CommunityView,
|
||||||
post_view::PostView,
|
post_view::PostView,
|
||||||
|
|
|
@ -4,12 +4,14 @@ use diesel::{
|
||||||
*,
|
*,
|
||||||
};
|
};
|
||||||
use lemmy_db::{
|
use lemmy_db::{
|
||||||
|
naive_now,
|
||||||
|
source::{
|
||||||
comment::Comment,
|
comment::Comment,
|
||||||
community::{Community, CommunityForm},
|
community::{Community, CommunityForm},
|
||||||
naive_now,
|
|
||||||
post::Post,
|
post::Post,
|
||||||
private_message::PrivateMessage,
|
private_message::PrivateMessage,
|
||||||
user::{UserForm, User_},
|
user::{UserForm, User_},
|
||||||
|
},
|
||||||
Crud,
|
Crud,
|
||||||
};
|
};
|
||||||
use lemmy_utils::{
|
use lemmy_utils::{
|
||||||
|
|
|
@ -5,8 +5,7 @@ use diesel::PgConnection;
|
||||||
use lemmy_api::claims::Claims;
|
use lemmy_api::claims::Claims;
|
||||||
use lemmy_db::{
|
use lemmy_db::{
|
||||||
comment_view::{ReplyQueryBuilder, ReplyView},
|
comment_view::{ReplyQueryBuilder, ReplyView},
|
||||||
community::Community,
|
source::{community::Community, user::User_},
|
||||||
user::User_,
|
|
||||||
user_mention_view::{UserMentionQueryBuilder, UserMentionView},
|
user_mention_view::{UserMentionQueryBuilder, UserMentionView},
|
||||||
views::{
|
views::{
|
||||||
post_view::{PostQueryBuilder, PostView},
|
post_view::{PostQueryBuilder, PostView},
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
use actix_web::{error::ErrorBadRequest, web::Query, *};
|
use actix_web::{error::ErrorBadRequest, web::Query, *};
|
||||||
use anyhow::anyhow;
|
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_structs::{blocking, WebFingerLink, WebFingerResponse};
|
||||||
use lemmy_utils::{
|
use lemmy_utils::{
|
||||||
settings::Settings,
|
settings::Settings,
|
||||||
|
|
|
@ -29,8 +29,10 @@ use lemmy_apub::{
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
use lemmy_db::{
|
use lemmy_db::{
|
||||||
|
source::{
|
||||||
community::{Community, CommunityForm},
|
community::{Community, CommunityForm},
|
||||||
user::{User_, *},
|
user::{User_, *},
|
||||||
|
},
|
||||||
Crud,
|
Crud,
|
||||||
ListingType,
|
ListingType,
|
||||||
SortType,
|
SortType,
|
||||||
|
|
Loading…
Reference in a new issue