chore: Run rust format

pull/3982/head
SleeplessOne1917 2023-09-22 21:39:03 -04:00
parent 519e800b33
commit 37655f0f18
155 changed files with 339 additions and 1140 deletions

View File

@ -9,10 +9,7 @@ use lemmy_api_common::{
use lemmy_db_schema::{
source::{
community::{
CommunityFollower,
CommunityFollowerForm,
CommunityPersonBan,
CommunityPersonBanForm,
CommunityFollower, CommunityFollowerForm, CommunityPersonBan, CommunityPersonBanForm,
},
moderator::{ModBanFromCommunity, ModBanFromCommunityForm},
},

View File

@ -5,8 +5,7 @@ use lemmy_api_common::{
utils::password_length_check,
};
use lemmy_db_schema::source::{
local_user::LocalUser,
password_reset_request::PasswordResetRequest,
local_user::LocalUser, password_reset_request::PasswordResetRequest,
};
use lemmy_utils::error::{LemmyError, LemmyErrorExt, LemmyErrorType};

View File

@ -2,9 +2,7 @@ use crate::{build_totp_2fa, generate_totp_2fa_secret};
use activitypub_federation::config::Data;
use actix_web::web::Json;
use lemmy_api_common::{
context::LemmyContext,
person::GenerateTotpSecretResponse,
sensitive::Sensitive,
context::LemmyContext, person::GenerateTotpSecretResponse, sensitive::Sensitive,
};
use lemmy_db_schema::{
source::local_user::{LocalUser, LocalUserUpdateForm},

View File

@ -1,9 +1,7 @@
use actix_web::web::{Data, Json};
use lemmy_api_common::{context::LemmyContext, person::GetRepliesResponse};
use lemmy_db_schema::source::{
comment_reply::CommentReply,
person_mention::PersonMention,
private_message::PrivateMessage,
comment_reply::CommentReply, person_mention::PersonMention, private_message::PrivateMessage,
};
use lemmy_db_views::structs::LocalUserView;
use lemmy_utils::error::{LemmyError, LemmyErrorExt, LemmyErrorType};

View File

@ -4,10 +4,7 @@ use lemmy_api_common::{
person::{GetReportCount, GetReportCountResponse},
};
use lemmy_db_views::structs::{
CommentReportView,
LocalUserView,
PostReportView,
PrivateMessageReportView,
CommentReportView, LocalUserView, PostReportView, PrivateMessageReportView,
};
use lemmy_utils::error::LemmyError;

View File

@ -6,9 +6,7 @@ use lemmy_api_common::{
post::{CreatePostLike, PostResponse},
send_activity::{ActivityChannel, SendActivityData},
utils::{
check_community_ban,
check_community_deleted_or_removed,
check_downvotes_enabled,
check_community_ban, check_community_deleted_or_removed, check_downvotes_enabled,
mark_post_as_read,
},
};

View File

@ -5,8 +5,7 @@ use lemmy_api_common::{
utils::is_admin,
};
use lemmy_db_views::{
private_message_report_view::PrivateMessageReportQuery,
structs::LocalUserView,
private_message_report_view::PrivateMessageReportQuery, structs::LocalUserView,
};
use lemmy_utils::error::LemmyError;

View File

@ -1,8 +1,6 @@
use actix_web::web::{Data, Json};
use lemmy_api_common::{
context::LemmyContext,
site::GetFederatedInstancesResponse,
utils::build_federated_instances,
context::LemmyContext, site::GetFederatedInstancesResponse, utils::build_federated_instances,
};
use lemmy_db_views::structs::SiteView;
use lemmy_utils::error::LemmyError;

View File

@ -11,22 +11,10 @@ use lemmy_db_schema::{
};
use lemmy_db_views::structs::LocalUserView;
use lemmy_db_views_moderator::structs::{
AdminPurgeCommentView,
AdminPurgeCommunityView,
AdminPurgePersonView,
AdminPurgePostView,
ModAddCommunityView,
ModAddView,
ModBanFromCommunityView,
ModBanView,
ModFeaturePostView,
ModHideCommunityView,
ModLockPostView,
ModRemoveCommentView,
ModRemoveCommunityView,
ModRemovePostView,
ModTransferCommunityView,
ModlogListParams,
AdminPurgeCommentView, AdminPurgeCommunityView, AdminPurgePersonView, AdminPurgePostView,
ModAddCommunityView, ModAddView, ModBanFromCommunityView, ModBanView, ModFeaturePostView,
ModHideCommunityView, ModLockPostView, ModRemoveCommentView, ModRemoveCommunityView,
ModRemovePostView, ModTransferCommunityView, ModlogListParams,
};
use lemmy_utils::error::LemmyError;
use ModlogActionType::*;

View File

@ -6,8 +6,7 @@ use lemmy_api_common::{
};
use lemmy_db_schema::source::local_site::LocalSite;
use lemmy_db_views::{
registration_application_view::RegistrationApplicationQuery,
structs::LocalUserView,
registration_application_view::RegistrationApplicationQuery, structs::LocalUserView,
};
use lemmy_utils::error::LemmyError;

View File

@ -1,8 +1,6 @@
use actix_web::web::{Data, Json};
use lemmy_api_common::{
context::LemmyContext,
site::GetUnreadRegistrationApplicationCountResponse,
utils::is_admin,
context::LemmyContext, site::GetUnreadRegistrationApplicationCountResponse, utils::is_admin,
};
use lemmy_db_schema::source::local_site::LocalSite;
use lemmy_db_views::structs::{LocalUserView, RegistrationApplicationView};

View File

@ -1,7 +1,6 @@
use lemmy_db_schema::{
newtypes::{CommentId, CommentReportId, CommunityId, LanguageId, LocalUserId, PostId},
CommentSortType,
ListingType,
CommentSortType, ListingType,
};
use lemmy_db_views::structs::{CommentReportView, CommentView};
use serde::{Deserialize, Serialize};

View File

@ -1,8 +1,7 @@
use lemmy_db_schema::{
newtypes::{CommunityId, LanguageId, PersonId},
source::site::Site,
ListingType,
SortType,
ListingType, SortType,
};
use lemmy_db_views_actor::structs::{CommunityModeratorView, CommunityView, PersonView};
use serde::{Deserialize, Serialize};

View File

@ -1,16 +1,11 @@
use crate::sensitive::Sensitive;
use lemmy_db_schema::{
newtypes::{CommentReplyId, CommunityId, LanguageId, PersonId, PersonMentionId},
CommentSortType,
ListingType,
SortType,
CommentSortType, ListingType, SortType,
};
use lemmy_db_views::structs::{CommentView, PostView};
use lemmy_db_views_actor::structs::{
CommentReplyView,
CommunityModeratorView,
PersonMentionView,
PersonView,
CommentReplyView, CommunityModeratorView, PersonMentionView, PersonView,
};
use serde::{Deserialize, Serialize};
use serde_with::skip_serializing_none;

View File

@ -1,8 +1,6 @@
use lemmy_db_schema::{
newtypes::{CommentId, CommunityId, DbUrl, LanguageId, PostId, PostReportId},
ListingType,
PostFeatureType,
SortType,
ListingType, PostFeatureType, SortType,
};
use lemmy_db_views::structs::{PaginationCursor, PostReportView, PostView};
use lemmy_db_views_actor::structs::{CommunityModeratorView, CommunityView};

View File

@ -302,10 +302,7 @@ mod tests {
#![allow(clippy::indexing_slicing)]
use crate::request::{
build_user_agent,
fetch_site_metadata,
html_to_site_metadata,
SiteMetadata,
build_user_agent, fetch_site_metadata, html_to_site_metadata, SiteMetadata,
};
use lemmy_utils::settings::SETTINGS;
use url::Url;

View File

@ -9,10 +9,7 @@ use futures::future::BoxFuture;
use lemmy_db_schema::{
newtypes::{CommunityId, DbUrl, PersonId},
source::{
comment::Comment,
community::Community,
person::Person,
post::Post,
comment::Comment, community::Community, person::Person, post::Post,
private_message::PrivateMessage,
},
};

View File

@ -1,45 +1,20 @@
use lemmy_db_schema::{
newtypes::{CommentId, CommunityId, InstanceId, LanguageId, PersonId, PostId},
source::{instance::Instance, language::Language, tagline::Tagline},
ListingType,
ModlogActionType,
RegistrationMode,
SearchType,
SortType,
ListingType, ModlogActionType, RegistrationMode, SearchType, SortType,
};
use lemmy_db_views::structs::{
CommentView,
CustomEmojiView,
LocalUserView,
PostView,
RegistrationApplicationView,
SiteView,
CommentView, CustomEmojiView, LocalUserView, PostView, RegistrationApplicationView, SiteView,
};
use lemmy_db_views_actor::structs::{
CommunityBlockView,
CommunityFollowerView,
CommunityModeratorView,
CommunityView,
InstanceBlockView,
PersonBlockView,
PersonView,
CommunityBlockView, CommunityFollowerView, CommunityModeratorView, CommunityView,
InstanceBlockView, PersonBlockView, PersonView,
};
use lemmy_db_views_moderator::structs::{
AdminPurgeCommentView,
AdminPurgeCommunityView,
AdminPurgePersonView,
AdminPurgePostView,
ModAddCommunityView,
ModAddView,
ModBanFromCommunityView,
ModBanView,
ModFeaturePostView,
ModHideCommunityView,
ModLockPostView,
ModRemoveCommentView,
ModRemoveCommunityView,
ModRemovePostView,
ModTransferCommunityView,
AdminPurgeCommentView, AdminPurgeCommunityView, AdminPurgePersonView, AdminPurgePostView,
ModAddCommunityView, ModAddView, ModBanFromCommunityView, ModBanView, ModFeaturePostView,
ModHideCommunityView, ModLockPostView, ModRemoveCommentView, ModRemoveCommunityView,
ModRemovePostView, ModTransferCommunityView,
};
use serde::{Deserialize, Serialize};
use serde_with::skip_serializing_none;

View File

@ -21,9 +21,7 @@ use lemmy_db_schema::{
};
use lemmy_db_views::{comment_view::CommentQuery, structs::LocalUserView};
use lemmy_db_views_actor::structs::{
CommunityModeratorView,
CommunityPersonBanView,
CommunityView,
CommunityModeratorView, CommunityPersonBanView, CommunityView,
};
use lemmy_utils::{
email::{send_email, translations::Lang},

View File

@ -6,13 +6,8 @@ use lemmy_api_common::{
context::LemmyContext,
send_activity::{ActivityChannel, SendActivityData},
utils::{
check_community_ban,
check_community_deleted_or_removed,
check_post_deleted_or_removed,
generate_local_apub_endpoint,
get_post,
local_site_to_slur_regex,
sanitize_html_api,
check_community_ban, check_community_deleted_or_removed, check_post_deleted_or_removed,
generate_local_apub_endpoint, get_post, local_site_to_slur_regex, sanitize_html_api,
EndpointType,
},
};
@ -31,9 +26,7 @@ use lemmy_db_views::structs::LocalUserView;
use lemmy_utils::{
error::{LemmyError, LemmyErrorExt, LemmyErrorType},
utils::{
mention::scrape_text_for_mentions,
slurs::remove_slurs,
validation::is_valid_body_field,
mention::scrape_text_for_mentions, slurs::remove_slurs, validation::is_valid_body_field,
},
};

View File

@ -20,9 +20,7 @@ use lemmy_db_views::structs::{CommentView, LocalUserView};
use lemmy_utils::{
error::{LemmyError, LemmyErrorExt, LemmyErrorType},
utils::{
mention::scrape_text_for_mentions,
slurs::remove_slurs,
validation::is_valid_body_field,
mention::scrape_text_for_mentions, slurs::remove_slurs, validation::is_valid_body_field,
},
};

View File

@ -5,26 +5,16 @@ use lemmy_api_common::{
community::{CommunityResponse, CreateCommunity},
context::LemmyContext,
utils::{
generate_followers_url,
generate_inbox_url,
generate_local_apub_endpoint,
generate_shared_inbox_url,
is_admin,
local_site_to_slur_regex,
sanitize_html_api,
sanitize_html_api_opt,
EndpointType,
generate_followers_url, generate_inbox_url, generate_local_apub_endpoint,
generate_shared_inbox_url, is_admin, local_site_to_slur_regex, sanitize_html_api,
sanitize_html_api_opt, EndpointType,
},
};
use lemmy_db_schema::{
source::{
actor_language::{CommunityLanguage, SiteLanguage},
community::{
Community,
CommunityFollower,
CommunityFollowerForm,
CommunityInsertForm,
CommunityModerator,
Community, CommunityFollower, CommunityFollowerForm, CommunityInsertForm, CommunityModerator,
CommunityModeratorForm,
},
},

View File

@ -7,15 +7,9 @@ use lemmy_api_common::{
request::fetch_site_data,
send_activity::{ActivityChannel, SendActivityData},
utils::{
check_community_ban,
check_community_deleted_or_removed,
generate_local_apub_endpoint,
honeypot_check,
local_site_to_slur_regex,
mark_post_as_read,
sanitize_html_api,
sanitize_html_api_opt,
EndpointType,
check_community_ban, check_community_deleted_or_removed, generate_local_apub_endpoint,
honeypot_check, local_site_to_slur_regex, mark_post_as_read, sanitize_html_api,
sanitize_html_api_opt, EndpointType,
},
};
use lemmy_db_schema::{

View File

@ -5,13 +5,8 @@ use lemmy_api_common::{
private_message::{CreatePrivateMessage, PrivateMessageResponse},
send_activity::{ActivityChannel, SendActivityData},
utils::{
check_person_block,
generate_local_apub_endpoint,
get_interface_language,
local_site_to_slur_regex,
sanitize_html_api,
send_email_to_user,
EndpointType,
check_person_block, generate_local_apub_endpoint, get_interface_language,
local_site_to_slur_regex, sanitize_html_api, send_email_to_user, EndpointType,
},
};
use lemmy_db_schema::{

View File

@ -5,11 +5,8 @@ use lemmy_api_common::{
context::LemmyContext,
site::{CreateSite, SiteResponse},
utils::{
generate_site_inbox_url,
is_admin,
local_site_rate_limit_to_rate_limit_config,
sanitize_html_api,
sanitize_html_api_opt,
generate_site_inbox_url, is_admin, local_site_rate_limit_to_rate_limit_config,
sanitize_html_api, sanitize_html_api_opt,
},
};
use lemmy_db_schema::{
@ -29,11 +26,8 @@ use lemmy_utils::{
utils::{
slurs::{check_slurs, check_slurs_opt},
validation::{
build_and_check_regex,
check_site_visibility_valid,
is_valid_body_field,
site_description_length_check,
site_name_length_check,
build_and_check_regex, check_site_visibility_valid, is_valid_body_field,
site_description_length_check, site_name_length_check,
},
},
};

View File

@ -10,12 +10,8 @@ use lemmy_db_schema::source::{
};
use lemmy_db_views::structs::{CustomEmojiView, LocalUserView, SiteView};
use lemmy_db_views_actor::structs::{
CommunityBlockView,
CommunityFollowerView,
CommunityModeratorView,
InstanceBlockView,
PersonBlockView,
PersonView,
CommunityBlockView, CommunityFollowerView, CommunityModeratorView, InstanceBlockView,
PersonBlockView, PersonView,
};
use lemmy_utils::{
error::{LemmyError, LemmyErrorExt, LemmyErrorType},

View File

@ -26,11 +26,8 @@ use lemmy_utils::{
utils::{
slurs::check_slurs_opt,
validation::{
build_and_check_regex,
check_site_visibility_valid,
is_valid_body_field,
site_description_length_check,
site_name_length_check,
build_and_check_regex, check_site_visibility_valid, is_valid_body_field,
site_description_length_check, site_name_length_check,
},
},
};

View File

@ -4,17 +4,9 @@ use lemmy_api_common::{
context::LemmyContext,
person::{LoginResponse, Register},
utils::{
generate_inbox_url,
generate_local_apub_endpoint,
generate_shared_inbox_url,
honeypot_check,
local_site_to_slur_regex,
password_length_check,
sanitize_html_api,
sanitize_html_api_opt,
send_new_applicant_email_to_admins,
send_verification_email,
EndpointType,
generate_inbox_url, generate_local_apub_endpoint, generate_shared_inbox_url, honeypot_check,
local_site_to_slur_regex, password_length_check, sanitize_html_api, sanitize_html_api_opt,
send_new_applicant_email_to_admins, send_verification_email, EndpointType,
},
};
use lemmy_db_schema::{

View File

@ -2,10 +2,7 @@ use crate::{
activities::{
block::{generate_cc, SiteOrCommunity},
community::send_activity_in_community,
generate_activity_id,
send_lemmy_activity,
verify_is_public,
verify_mod_action,
generate_activity_id, send_lemmy_activity, verify_is_public, verify_mod_action,
verify_person_in_community,
},
activity_lists::AnnouncableActivities,
@ -29,10 +26,7 @@ use lemmy_db_schema::{
source::{
activity::ActivitySendTargets,
community::{
CommunityFollower,
CommunityFollowerForm,
CommunityPersonBan,
CommunityPersonBanForm,
CommunityFollower, CommunityFollowerForm, CommunityPersonBan, CommunityPersonBanForm,
},
moderator::{ModBan, ModBanForm, ModBanFromCommunity, ModBanFromCommunityForm},
person::{Person, PersonUpdateForm},

View File

@ -2,9 +2,7 @@ use crate::{
activities::{
block::{generate_cc, SiteOrCommunity},
community::send_activity_in_community,
generate_activity_id,
send_lemmy_activity,
verify_is_public,
generate_activity_id, send_lemmy_activity, verify_is_public,
},
activity_lists::AnnouncableActivities,
insert_received_activity,

View File

@ -1,9 +1,6 @@
use crate::{
activities::{
generate_activity_id,
generate_announce_activity_id,
send_lemmy_activity,
verify_is_public,
generate_activity_id, generate_announce_activity_id, send_lemmy_activity, verify_is_public,
verify_person_in_community,
},
activity_lists::AnnouncableActivities,
@ -11,9 +8,7 @@ use crate::{
objects::community::ApubCommunity,
protocol::{
activities::community::announce::{AnnounceActivity, RawAnnouncableActivities},
Id,
IdOrNestedObject,
InCommunity,
Id, IdOrNestedObject, InCommunity,
},
};
use activitypub_federation::{

View File

@ -1,10 +1,7 @@
use crate::{
activities::{
community::send_activity_in_community,
generate_activity_id,
verify_is_public,
verify_mod_action,
verify_person_in_community,
community::send_activity_in_community, generate_activity_id, verify_is_public,
verify_mod_action, verify_person_in_community,
},
activity_lists::AnnouncableActivities,
insert_received_activity,

View File

@ -1,10 +1,7 @@
use crate::{
activities::{
community::send_activity_in_community,
generate_activity_id,
verify_is_public,
verify_mod_action,
verify_person_in_community,
community::send_activity_in_community, generate_activity_id, verify_is_public,
verify_mod_action, verify_person_in_community,
},
activity_lists::AnnouncableActivities,
insert_received_activity,

View File

@ -1,11 +1,7 @@
use crate::{
activities::{
check_community_deleted_or_removed,
community::send_activity_in_community,
generate_activity_id,
verify_is_public,
verify_mod_action,
verify_person_in_community,
check_community_deleted_or_removed, community::send_activity_in_community,
generate_activity_id, verify_is_public, verify_mod_action, verify_person_in_community,
},
activity_lists::AnnouncableActivities,
insert_received_activity,

View File

@ -1,10 +1,7 @@
use crate::{
activities::{
community::send_activity_in_community,
generate_activity_id,
verify_is_public,
verify_mod_action,
verify_person_in_community,
community::send_activity_in_community, generate_activity_id, verify_is_public,
verify_mod_action, verify_person_in_community,
},
activity_lists::AnnouncableActivities,
insert_received_activity,

View File

@ -1,10 +1,7 @@
use crate::{
activities::{
check_community_deleted_or_removed,
community::send_activity_in_community,
generate_activity_id,
verify_is_public,
verify_person_in_community,
check_community_deleted_or_removed, community::send_activity_in_community,
generate_activity_id, verify_is_public, verify_person_in_community,
},
activity_lists::AnnouncableActivities,
insert_received_activity,

View File

@ -1,11 +1,7 @@
use crate::{
activities::{
check_community_deleted_or_removed,
community::send_activity_in_community,
generate_activity_id,
verify_is_public,
verify_mod_action,
verify_person_in_community,
check_community_deleted_or_removed, community::send_activity_in_community,
generate_activity_id, verify_is_public, verify_mod_action, verify_person_in_community,
},
activity_lists::AnnouncableActivities,
insert_received_activity,

View File

@ -3,8 +3,7 @@ use crate::{
insert_received_activity,
objects::{person::ApubPerson, private_message::ApubPrivateMessage},
protocol::activities::{
create_or_update::chat_message::CreateOrUpdateChatMessage,
CreateOrUpdateType,
create_or_update::chat_message::CreateOrUpdateChatMessage, CreateOrUpdateType,
},
};
use activitypub_federation::{

View File

@ -14,12 +14,8 @@ use lemmy_db_schema::{
comment::{Comment, CommentUpdateForm},
community::{Community, CommunityUpdateForm},
moderator::{
ModRemoveComment,
ModRemoveCommentForm,
ModRemoveCommunity,
ModRemoveCommunityForm,
ModRemovePost,
ModRemovePostForm,
ModRemoveComment, ModRemoveCommentForm, ModRemoveCommunity, ModRemoveCommunityForm,
ModRemovePost, ModRemovePostForm,
},
post::{Post, PostUpdateForm},
},

View File

@ -1,18 +1,11 @@
use crate::{
activities::{
community::send_activity_in_community,
send_lemmy_activity,
verify_is_public,
verify_mod_action,
verify_person,
verify_person_in_community,
community::send_activity_in_community, send_lemmy_activity, verify_is_public,
verify_mod_action, verify_person, verify_person_in_community,
},
activity_lists::AnnouncableActivities,
objects::{
comment::ApubComment,
community::ApubCommunity,
person::ApubPerson,
post::ApubPost,
comment::ApubComment, community::ApubCommunity, person::ApubPerson, post::ApubPost,
private_message::ApubPrivateMessage,
},
protocol::{

View File

@ -14,12 +14,8 @@ use lemmy_db_schema::{
comment::{Comment, CommentUpdateForm},
community::{Community, CommunityUpdateForm},
moderator::{
ModRemoveComment,
ModRemoveCommentForm,
ModRemoveCommunity,
ModRemoveCommunityForm,
ModRemovePost,
ModRemovePostForm,
ModRemoveComment, ModRemoveCommentForm, ModRemoveCommunity, ModRemoveCommunityForm,
ModRemovePost, ModRemovePostForm,
},
post::{Post, PostUpdateForm},
},

View File

@ -1,9 +1,6 @@
use crate::{
activities::{
generate_activity_id,
send_lemmy_activity,
verify_person,
verify_person_in_community,
generate_activity_id, send_lemmy_activity, verify_person, verify_person_in_community,
},
fetcher::user_or_community::UserOrCommunity,
insert_received_activity,

View File

@ -9,11 +9,8 @@ use crate::{
},
create_or_update::private_message::send_create_or_update_pm,
deletion::{
delete_user::delete_user,
send_apub_delete_in_community,
send_apub_delete_in_community_new,
send_apub_delete_private_message,
DeletableObjects,
delete_user::delete_user, send_apub_delete_in_community, send_apub_delete_in_community_new,
send_apub_delete_private_message, DeletableObjects,
},
voting::send_like_activity,
},

View File

@ -1,7 +1,6 @@
use crate::{
activities::{
generate_activity_id,
verify_person_in_community,
generate_activity_id, verify_person_in_community,
voting::{undo_vote_comment, undo_vote_post},
},
insert_received_activity,

View File

@ -1,7 +1,6 @@
use crate::{
activities::{
generate_activity_id,
verify_person_in_community,
generate_activity_id, verify_person_in_community,
voting::{vote_comment, vote_post},
},
insert_received_activity,

View File

@ -12,9 +12,7 @@ use crate::{
update::UpdateCommunity,
},
create_or_update::{
chat_message::CreateOrUpdateChatMessage,
note::CreateOrUpdateNote,
page::CreateOrUpdatePage,
chat_message::CreateOrUpdateChatMessage, note::CreateOrUpdateNote, page::CreateOrUpdatePage,
},
deletion::{delete::Delete, delete_user::DeleteUser, undo_delete::UndoDelete},
following::{accept::AcceptFollow, follow::Follow, undo_follow::UndoFollow},

View File

@ -1,6 +1,5 @@
use crate::{
api::listing_type_with_default,
fetcher::resolve_actor_identifier,
api::listing_type_with_default, fetcher::resolve_actor_identifier,
objects::community::ApubCommunity,
};
use activitypub_federation::config::Data;

View File

@ -1,6 +1,5 @@
use crate::{
api::listing_type_with_default,
fetcher::resolve_actor_identifier,
api::listing_type_with_default, fetcher::resolve_actor_identifier,
objects::community::ApubCommunity,
};
use activitypub_federation::config::Data;

View File

@ -7,10 +7,7 @@ use lemmy_api_common::{
utils::{check_private_instance, is_mod_or_admin_opt},
};
use lemmy_db_schema::source::{
actor_language::CommunityLanguage,
community::Community,
local_site::LocalSite,
site::Site,
actor_language::CommunityLanguage, community::Community, local_site::LocalSite, site::Site,
};
use lemmy_db_views::structs::LocalUserView;
use lemmy_db_views_actor::structs::{CommunityModeratorView, CommunityView};

View File

@ -1,7 +1,5 @@
use crate::fetcher::search::{
search_query_to_object_id,
search_query_to_object_id_local,
SearchableObjects,
search_query_to_object_id, search_query_to_object_id_local, SearchableObjects,
};
use activitypub_federation::config::Data;
use actix_web::web::{Json, Query};

View File

@ -3,11 +3,8 @@ use crate::{
protocol::collections::group_moderators::GroupModerators,
};
use activitypub_federation::{
config::Data,
fetch::object_id::ObjectId,
kinds::collection::OrderedCollectionType,
protocol::verification::verify_domains_match,
traits::Collection,
config::Data, fetch::object_id::ObjectId, kinds::collection::OrderedCollectionType,
protocol::verification::verify_domains_match, traits::Collection,
};
use lemmy_api_common::{context::LemmyContext, utils::generate_moderators_url};
use lemmy_db_schema::{
@ -108,8 +105,7 @@ mod tests {
use super::*;
use crate::{
objects::{
community::tests::parse_lemmy_community,
person::tests::parse_lemmy_person,
community::tests::parse_lemmy_community, person::tests::parse_lemmy_person,
tests::init_context,
},
protocol::tests::file_to_json_object,

View File

@ -3,8 +3,7 @@ use crate::{
objects::{community::ApubCommunity, post::ApubPost},
protocol::{
activities::{
community::announce::AnnounceActivity,
create_or_update::page::CreateOrUpdatePage,
community::announce::AnnounceActivity, create_or_update::page::CreateOrUpdatePage,
CreateOrUpdateType,
},
collections::group_outbox::GroupOutbox,

View File

@ -1,8 +1,7 @@
use crate::{
activity_lists::GroupInboxActivities,
collections::{
community_featured::ApubCommunityFeatured,
community_moderators::ApubCommunityModerators,
community_featured::ApubCommunityFeatured, community_moderators::ApubCommunityModerators,
community_outbox::ApubCommunityOutbox,
},
http::{create_apub_response, create_apub_tombstone_response},

View File

@ -1,13 +1,9 @@
use crate::{
activity_lists::SharedInboxActivities,
fetcher::user_or_community::UserOrCommunity,
protocol::objects::tombstone::Tombstone,
CONTEXT,
activity_lists::SharedInboxActivities, fetcher::user_or_community::UserOrCommunity,
protocol::objects::tombstone::Tombstone, CONTEXT,
};
use activitypub_federation::{
actix_web::inbox::receive_activity,
config::Data,
protocol::context::WithContext,
actix_web::inbox::receive_activity, config::Data, protocol::context::WithContext,
FEDERATION_CONTENT_TYPE,
};
use actix_web::{web, web::Bytes, HttpRequest, HttpResponse};

View File

@ -6,10 +6,7 @@ use crate::{
protocol::collections::empty_outbox::EmptyOutbox,
};
use activitypub_federation::{
actix_web::inbox::receive_activity,
config::Data,
protocol::context::WithContext,
traits::Object,
actix_web::inbox::receive_activity, config::Data, protocol::context::WithContext, traits::Object,
};
use actix_web::{web, web::Bytes, HttpRequest, HttpResponse};
use lemmy_api_common::{context::LemmyContext, utils::generate_outbox_url};

View File

@ -1,12 +1,8 @@
use crate::http::{
comment::get_apub_comment,
community::{
community_inbox,
get_apub_community_featured,
get_apub_community_followers,
get_apub_community_http,
get_apub_community_moderators,
get_apub_community_outbox,
community_inbox, get_apub_community_featured, get_apub_community_followers,
get_apub_community_http, get_apub_community_moderators, get_apub_community_outbox,
},
get_activity,
person::{get_apub_person_http, get_apub_person_outbox, person_inbox},

View File

@ -5,10 +5,7 @@ use crate::{
protocol::collections::empty_outbox::EmptyOutbox,
};
use activitypub_federation::{
actix_web::inbox::receive_activity,
config::Data,
protocol::context::WithContext,
traits::Object,
actix_web::inbox::receive_activity, config::Data, protocol::context::WithContext, traits::Object,
};
use actix_web::{web::Bytes, HttpRequest, HttpResponse};
use lemmy_api_common::context::LemmyContext;

View File

@ -5,8 +5,7 @@ use crate::{
objects::{read_from_string_or_source, verify_is_remote_object},
protocol::{
objects::{note::Note, LanguageTag},
InCommunity,
Source,
InCommunity, Source,
},
};
use activitypub_federation::{

View File

@ -1,12 +1,10 @@
use crate::{
activities::GetActorType,
check_apub_id_valid,
local_site_data_cached,
check_apub_id_valid, local_site_data_cached,
objects::instance::fetch_instance_actor_for_object,
protocol::{
objects::{group::Group, Endpoints, LanguageTag},
ImageObject,
Source,
ImageObject, Source,
},
};
use activitypub_federation::{

View File

@ -1,12 +1,10 @@
use crate::{
activities::GetActorType,
check_apub_id_valid_with_strictness,
local_site_data_cached,
check_apub_id_valid_with_strictness, local_site_data_cached,
objects::read_from_string_or_source_opt,
protocol::{
objects::{instance::Instance, LanguageTag},
ImageObject,
Source,
ImageObject, Source,
},
};
use activitypub_federation::{

View File

@ -1,15 +1,13 @@
use crate::{
activities::GetActorType,
check_apub_id_valid_with_strictness,
local_site_data_cached,
check_apub_id_valid_with_strictness, local_site_data_cached,
objects::{instance::fetch_instance_actor_for_object, read_from_string_or_source_opt},
protocol::{
objects::{
person::{Person, UserTypes},
Endpoints,
},
ImageObject,
Source,
ImageObject, Source,
},
};
use activitypub_federation::{
@ -21,9 +19,7 @@ use chrono::{DateTime, Utc};
use lemmy_api_common::{
context::LemmyContext,
utils::{
generate_outbox_url,
local_site_opt_to_slur_regex,
sanitize_html_federation,
generate_outbox_url, local_site_opt_to_slur_regex, sanitize_html_federation,
sanitize_html_federation_opt,
},
};

View File

@ -1,16 +1,13 @@
use crate::{
activities::{verify_is_public, verify_person_in_community},
check_apub_id_valid_with_strictness,
local_site_data_cached,
check_apub_id_valid_with_strictness, local_site_data_cached,
objects::{read_from_string_or_source_opt, verify_is_remote_object},
protocol::{
objects::{
page::{Attachment, AttributedTo, Page, PageType},
LanguageTag,
},
ImageObject,
InCommunity,
Source,
ImageObject, InCommunity, Source,
},
};
use activitypub_federation::{
@ -26,11 +23,8 @@ use lemmy_api_common::{
context::LemmyContext,
request::fetch_site_data,
utils::{
is_mod_or_admin,
local_site_opt_to_sensitive,
local_site_opt_to_slur_regex,
sanitize_html_federation,
sanitize_html_federation_opt,
is_mod_or_admin, local_site_opt_to_sensitive, local_site_opt_to_slur_regex,
sanitize_html_federation, sanitize_html_federation_opt,
},
};
use lemmy_db_schema::{
@ -300,9 +294,7 @@ mod tests {
use super::*;
use crate::{
objects::{
community::tests::parse_lemmy_community,
person::tests::parse_lemmy_person,
post::ApubPost,
community::tests::parse_lemmy_community, person::tests::parse_lemmy_person, post::ApubPost,
tests::init_context,
},
protocol::tests::file_to_json_object,

View File

@ -4,9 +4,7 @@ use crate::{
protocol::InCommunity,
};
use activitypub_federation::{
config::Data,
fetch::object_id::ObjectId,
kinds::activity::BlockType,
config::Data, fetch::object_id::ObjectId, kinds::activity::BlockType,
protocol::helpers::deserialize_one_or_many,
};
use anyhow::anyhow;

View File

@ -4,9 +4,7 @@ use crate::{
protocol::{activities::block::block_user::BlockUser, InCommunity},
};
use activitypub_federation::{
config::Data,
fetch::object_id::ObjectId,
kinds::activity::UndoType,
config::Data, fetch::object_id::ObjectId, kinds::activity::UndoType,
protocol::helpers::deserialize_one_or_many,
};
use lemmy_api_common::context::LemmyContext;

View File

@ -1,7 +1,6 @@
use crate::{objects::community::ApubCommunity, protocol::IdOrNestedObject};
use activitypub_federation::{
fetch::object_id::ObjectId,
kinds::activity::AnnounceType,
fetch::object_id::ObjectId, kinds::activity::AnnounceType,
protocol::helpers::deserialize_one_or_many,
};
use serde::{Deserialize, Serialize};

View File

@ -4,9 +4,7 @@ use crate::{
protocol::InCommunity,
};
use activitypub_federation::{
config::Data,
fetch::object_id::ObjectId,
kinds::activity::AddType,
config::Data, fetch::object_id::ObjectId, kinds::activity::AddType,
protocol::helpers::deserialize_one_or_many,
};
use lemmy_api_common::context::LemmyContext;

View File

@ -4,9 +4,7 @@ use crate::{
protocol::InCommunity,
};
use activitypub_federation::{
config::Data,
fetch::object_id::ObjectId,
kinds::activity::RemoveType,
config::Data, fetch::object_id::ObjectId, kinds::activity::RemoveType,
protocol::helpers::deserialize_one_or_many,
};
use lemmy_api_common::context::LemmyContext;

View File

@ -4,9 +4,7 @@ use crate::{
protocol::InCommunity,
};
use activitypub_federation::{
config::Data,
fetch::object_id::ObjectId,
kinds::activity::UndoType,
config::Data, fetch::object_id::ObjectId, kinds::activity::UndoType,
protocol::helpers::deserialize_one_or_many,
};
use lemmy_api_common::context::LemmyContext;

View File

@ -5,9 +5,7 @@ use crate::{
protocol::InCommunity,
};
use activitypub_federation::{
config::Data,
fetch::object_id::ObjectId,
kinds::activity::FlagType,
config::Data, fetch::object_id::ObjectId, kinds::activity::FlagType,
protocol::helpers::deserialize_one,
};
use lemmy_api_common::context::LemmyContext;

View File

@ -4,9 +4,7 @@ use crate::{
protocol::{objects::group::Group, InCommunity},
};
use activitypub_federation::{
config::Data,
fetch::object_id::ObjectId,
kinds::activity::UpdateType,
config::Data, fetch::object_id::ObjectId, kinds::activity::UpdateType,
protocol::helpers::deserialize_one_or_many,
};
use lemmy_api_common::context::LemmyContext;

View File

@ -9,9 +9,7 @@ mod tests {
use crate::protocol::{
activities::create_or_update::{
chat_message::CreateOrUpdateChatMessage,
note::CreateOrUpdateNote,
page::CreateOrUpdatePage,
chat_message::CreateOrUpdateChatMessage, note::CreateOrUpdateNote, page::CreateOrUpdatePage,
},
tests::test_parse_lemmy_item,
};

View File

@ -5,9 +5,7 @@ use crate::{
protocol::{activities::CreateOrUpdateType, objects::note::Note, InCommunity},
};
use activitypub_federation::{
config::Data,
fetch::object_id::ObjectId,
protocol::helpers::deserialize_one_or_many,
config::Data, fetch::object_id::ObjectId, protocol::helpers::deserialize_one_or_many,
};
use lemmy_api_common::context::LemmyContext;
use lemmy_db_schema::{source::community::Community, traits::Crud};

View File

@ -4,9 +4,7 @@ use crate::{
protocol::{activities::CreateOrUpdateType, objects::page::Page, InCommunity},
};
use activitypub_federation::{
config::Data,
fetch::object_id::ObjectId,
protocol::helpers::deserialize_one_or_many,
config::Data, fetch::object_id::ObjectId, protocol::helpers::deserialize_one_or_many,
};
use lemmy_api_common::context::LemmyContext;
use lemmy_utils::error::LemmyError;

View File

@ -4,9 +4,7 @@ use crate::{
protocol::{objects::tombstone::Tombstone, IdOrNestedObject, InCommunity},
};
use activitypub_federation::{
config::Data,
fetch::object_id::ObjectId,
kinds::activity::DeleteType,
config::Data, fetch::object_id::ObjectId, kinds::activity::DeleteType,
protocol::helpers::deserialize_one_or_many,
};
use anyhow::anyhow;

View File

@ -1,7 +1,6 @@
use crate::objects::person::ApubPerson;
use activitypub_federation::{
fetch::object_id::ObjectId,
kinds::activity::DeleteType,
fetch::object_id::ObjectId, kinds::activity::DeleteType,
protocol::helpers::deserialize_one_or_many,
};
use serde::{Deserialize, Serialize};

View File

@ -4,9 +4,7 @@ use crate::{
protocol::{activities::deletion::delete::Delete, InCommunity},
};
use activitypub_federation::{
config::Data,
fetch::object_id::ObjectId,
kinds::activity::UndoType,
config::Data, fetch::object_id::ObjectId, kinds::activity::UndoType,
protocol::helpers::deserialize_one_or_many,
};
use lemmy_api_common::context::LemmyContext;

View File

@ -3,8 +3,7 @@ use crate::{
protocol::activities::following::follow::Follow,
};
use activitypub_federation::{
fetch::object_id::ObjectId,
kinds::activity::AcceptType,
fetch::object_id::ObjectId, kinds::activity::AcceptType,
protocol::helpers::deserialize_skip_error,
};
use serde::{Deserialize, Serialize};

View File

@ -1,7 +1,6 @@
use crate::{fetcher::user_or_community::UserOrCommunity, objects::person::ApubPerson};
use activitypub_federation::{
fetch::object_id::ObjectId,
kinds::activity::FollowType,
fetch::object_id::ObjectId, kinds::activity::FollowType,
protocol::helpers::deserialize_skip_error,
};
use serde::{Deserialize, Serialize};

View File

@ -1,8 +1,6 @@
use crate::{objects::person::ApubPerson, protocol::activities::following::follow::Follow};
use activitypub_federation::{
fetch::object_id::ObjectId,
kinds::activity::UndoType,
protocol::helpers::deserialize_skip_error,
fetch::object_id::ObjectId, kinds::activity::UndoType, protocol::helpers::deserialize_skip_error,
};
use serde::{Deserialize, Serialize};
use url::Url;

View File

@ -1,7 +1,6 @@
use crate::objects::person::ApubPerson;
use activitypub_federation::{
fetch::object_id::ObjectId,
kinds::collection::OrderedCollectionType,
fetch::object_id::ObjectId, kinds::collection::OrderedCollectionType,
};
use serde::{Deserialize, Serialize};
use url::Url;

View File

@ -11,11 +11,8 @@ mod tests {
use crate::protocol::{
collections::{
empty_outbox::EmptyOutbox,
group_featured::GroupFeatured,
group_followers::GroupFollowers,
group_moderators::GroupModerators,
group_outbox::GroupOutbox,
empty_outbox::EmptyOutbox, group_featured::GroupFeatured, group_followers::GroupFollowers,
group_moderators::GroupModerators, group_outbox::GroupOutbox,
},
tests::{test_json, test_parse_lemmy_item},
};

View File

@ -1,8 +1,6 @@
use crate::objects::community::ApubCommunity;
use activitypub_federation::{
config::Data,
fetch::fetch_object_http,
kinds::object::ImageType,
config::Data, fetch::fetch_object_http, kinds::object::ImageType,
protocol::values::MediaTypeMarkdown,
};
use lemmy_api_common::context::LemmyContext;

View File

@ -1,25 +1,21 @@
use crate::{
check_apub_id_valid_with_strictness,
collections::{
community_featured::ApubCommunityFeatured,
community_moderators::ApubCommunityModerators,
community_featured::ApubCommunityFeatured, community_moderators::ApubCommunityModerators,
community_outbox::ApubCommunityOutbox,
},
local_site_data_cached,
objects::{community::ApubCommunity, read_from_string_or_source_opt},
protocol::{
objects::{Endpoints, LanguageTag},
ImageObject,
Source,
ImageObject, Source,
},
};
use activitypub_federation::{
fetch::{collection_id::CollectionId, object_id::ObjectId},
kinds::actor::GroupType,
protocol::{
helpers::deserialize_skip_error,
public_key::PublicKey,
verification::verify_domains_match,
helpers::deserialize_skip_error, public_key::PublicKey, verification::verify_domains_match,
},
};
use chrono::{DateTime, Utc};

View File

@ -1,7 +1,5 @@
use lemmy_db_schema::{
impls::actor_language::UNDETERMINED_ID,
newtypes::LanguageId,
source::language::Language,
impls::actor_language::UNDETERMINED_ID, newtypes::LanguageId, source::language::Language,
utils::DbPool,
};
use lemmy_utils::error::LemmyError;
@ -100,13 +98,8 @@ mod tests {
use crate::protocol::{
objects::{
chat_message::ChatMessage,
group::Group,
instance::Instance,
note::Note,
page::Page,
person::Person,
tombstone::Tombstone,
chat_message::ChatMessage, group::Group, instance::Instance, note::Note, page::Page,
person::Person, tombstone::Tombstone,
},
tests::{test_json, test_parse_lemmy_item},
};

View File

@ -4,8 +4,7 @@ use crate::{
schema::{community_aggregates, post, post_aggregates},
utils::{
functions::{hot_rank, scaled_rank},
get_conn,
DbPool,
get_conn, DbPool,
},
};
use diesel::{result::Error, ExpressionMethods, JoinOnDsl, QueryDsl};

View File

@ -1,12 +1,8 @@
use crate::newtypes::{CommentId, CommunityId, InstanceId, PersonId, PostId, SiteId};
#[cfg(feature = "full")]
use crate::schema::{
comment_aggregates,
community_aggregates,
person_aggregates,
person_post_aggregates,
post_aggregates,
site_aggregates,
comment_aggregates, community_aggregates, person_aggregates, person_post_aggregates,
post_aggregates, site_aggregates,
};
use chrono::{DateTime, Utc};
use serde::{Deserialize, Serialize};

View File

@ -7,8 +7,7 @@ use crate::{
use diesel::{
dsl::insert_into,
result::{DatabaseErrorKind, Error, Error::DatabaseError},
ExpressionMethods,
QueryDsl,
ExpressionMethods, QueryDsl,
};
use diesel_async::RunQueryDsl;

View File

@ -4,12 +4,8 @@ use crate::{
schema::{local_site, site, site_language},
source::{
actor_language::{
CommunityLanguage,
CommunityLanguageForm,
LocalUserLanguage,
LocalUserLanguageForm,
SiteLanguage,
SiteLanguageForm,
CommunityLanguage, CommunityLanguageForm, LocalUserLanguage, LocalUserLanguageForm,
SiteLanguage, SiteLanguageForm,
},
language::Language,
site::Site,
@ -21,9 +17,7 @@ use diesel::{
dsl::{count, exists},
insert_into,
result::Error,
select,
ExpressionMethods,
QueryDsl,
select, ExpressionMethods, QueryDsl,
};
use diesel_async::{AsyncPgConnection, RunQueryDsl};
use lemmy_utils::error::{LemmyError, LemmyErrorType};
@ -37,9 +31,7 @@ impl LocalUserLanguage {
for_local_user_id: LocalUserId,
) -> Result<Vec<LanguageId>, Error> {
use crate::schema::local_user_language::dsl::{
language_id,
local_user_id,
local_user_language,
language_id, local_user_id, local_user_language,
};
let conn = &mut get_conn(pool).await?;
@ -222,9 +214,7 @@ impl CommunityLanguage {
for_instance_id: InstanceId,
) -> Result<(), Error> {
use crate::schema::{
community::dsl as c,
community_language::dsl as cl,
site_language::dsl as sl,
community::dsl as c, community_language::dsl as cl, site_language::dsl as sl,
};
let community_languages: Vec<LanguageId> = cl::community_language
.left_outer_join(sl::site_language.on(cl::language_id.eq(sl::language_id)))
@ -390,17 +380,8 @@ mod tests {
use super::*;
use crate::{
impls::actor_language::{
convert_read_languages,
convert_update_languages,
default_post_language,
get_conn,
CommunityLanguage,
DbPool,
Language,
LanguageId,
LocalUserLanguage,
QueryDsl,
RunQueryDsl,
convert_read_languages, convert_update_languages, default_post_language, get_conn,
CommunityLanguage, DbPool, Language, LanguageId, LocalUserLanguage, QueryDsl, RunQueryDsl,
SiteLanguage,
},
source::{

View File

@ -4,13 +4,7 @@ use crate::{
utils::{functions::lower, get_conn, DbPool},
};
use diesel::{
delete,
dsl::exists,
insert_into,
result::Error,
select,
ExpressionMethods,
QueryDsl,
delete, dsl::exists, insert_into, result::Error, select, ExpressionMethods, QueryDsl,
};
use diesel_async::RunQueryDsl;

View File

@ -2,12 +2,7 @@ use crate::{
newtypes::{CommentId, DbUrl, PersonId},
schema::comment::dsl::{ap_id, comment, content, creator_id, deleted, path, removed, updated},
source::comment::{
Comment,
CommentInsertForm,
CommentLike,
CommentLikeForm,
CommentSaved,
CommentSavedForm,
Comment, CommentInsertForm, CommentLike, CommentLikeForm, CommentSaved, CommentSavedForm,
CommentUpdateForm,
},
traits::{Crud, Likeable, Saveable},
@ -16,8 +11,7 @@ use crate::{
use diesel::{
dsl::{insert_into, sql_query},
result::Error,
ExpressionMethods,
QueryDsl,
ExpressionMethods, QueryDsl,
};
use diesel_async::RunQueryDsl;
use diesel_ltree::Ltree;
@ -249,12 +243,7 @@ mod tests {
newtypes::LanguageId,
source::{
comment::{
Comment,
CommentInsertForm,
CommentLike,
CommentLikeForm,
CommentSaved,
CommentSavedForm,
Comment, CommentInsertForm, CommentLike, CommentLikeForm, CommentSaved, CommentSavedForm,
CommentUpdateForm,
},
community::{Community, CommunityInsertForm},

View File

@ -8,8 +8,7 @@ use crate::{
use diesel::{
dsl::{insert_into, update},
result::Error,
ExpressionMethods,
QueryDsl,
ExpressionMethods, QueryDsl,
};
use diesel_async::RunQueryDsl;

View File

@ -4,15 +4,8 @@ use crate::{
source::{
actor_language::CommunityLanguage,
community::{
Community,
CommunityFollower,
CommunityFollowerForm,
CommunityInsertForm,
CommunityModerator,
CommunityModeratorForm,
CommunityPersonBan,
CommunityPersonBanForm,
CommunityUpdateForm,
Community, CommunityFollower, CommunityFollowerForm, CommunityInsertForm, CommunityModerator,
CommunityModeratorForm, CommunityPersonBan, CommunityPersonBanForm, CommunityUpdateForm,
},
},
traits::{ApubActor, Bannable, Crud, Followable, Joinable},
@ -20,16 +13,8 @@ use crate::{
SubscribedType,
};
use diesel::{
deserialize,
dsl,
dsl::insert_into,
pg::Pg,
result::Error,
sql_types,
ExpressionMethods,
NullableExpressionMethods,
QueryDsl,
Queryable,
deserialize, dsl, dsl::insert_into, pg::Pg, result::Error, sql_types, ExpressionMethods,
NullableExpressionMethods, QueryDsl, Queryable,
};
use diesel_async::RunQueryDsl;
@ -262,10 +247,7 @@ impl Followable for CommunityFollower {
person_id_: PersonId,
) -> Result<Self, Error> {
use crate::schema::community_follower::dsl::{
community_follower,
community_id,
pending,
person_id,
community_follower, community_id, pending, person_id,
};
let conn = &mut get_conn(pool).await?;
diesel::update(
@ -349,14 +331,8 @@ mod tests {
use crate::{
source::{
community::{
Community,
CommunityFollower,
CommunityFollowerForm,
CommunityInsertForm,
CommunityModerator,
CommunityModeratorForm,
CommunityPersonBan,
CommunityPersonBanForm,
Community, CommunityFollower, CommunityFollowerForm, CommunityInsertForm,
CommunityModerator, CommunityModeratorForm, CommunityPersonBan, CommunityPersonBanForm,
CommunityUpdateForm,
},
instance::Instance,

View File

@ -1,10 +1,7 @@
use crate::{
newtypes::LocalUserId,
schema::email_verification::dsl::{
email_verification,
local_user_id,
published,
verification_token,
email_verification, local_user_id, published, verification_token,
},
source::email_verification::{EmailVerification, EmailVerificationForm},
utils::{get_conn, DbPool},
@ -14,9 +11,7 @@ use diesel::{
insert_into,
result::Error,
sql_types::Timestamptz,
ExpressionMethods,
IntoSql,
QueryDsl,
ExpressionMethods, IntoSql, QueryDsl,
};
use diesel_async::RunQueryDsl;

View File

@ -9,10 +9,7 @@ use diesel::{
dsl::{count_star, insert_into},
result::Error,
sql_types::{Nullable, Timestamptz},
ExpressionMethods,
NullableExpressionMethods,
QueryDsl,
SelectableHelper,
ExpressionMethods, NullableExpressionMethods, QueryDsl, SelectableHelper,
};
use diesel_async::RunQueryDsl;

View File

@ -1,9 +1,7 @@
use crate::{
schema::local_site_rate_limit,
source::local_site_rate_limit::{
LocalSiteRateLimit,
LocalSiteRateLimitInsertForm,
LocalSiteRateLimitUpdateForm,
LocalSiteRateLimit, LocalSiteRateLimitInsertForm, LocalSiteRateLimitUpdateForm,
},
utils::{get_conn, DbPool},
};

View File

@ -1,12 +1,7 @@
use crate::{
newtypes::LocalUserId,
schema::local_user::dsl::{
accepted_application,
email,
email_verified,
local_user,
password_encrypted,
validator_time,
accepted_application, email, email_verified, local_user, password_encrypted, validator_time,
},
source::{
actor_language::{LocalUserLanguage, SiteLanguage},

View File

@ -1,35 +1,12 @@
use crate::{
source::moderator::{
AdminPurgeComment,
AdminPurgeCommentForm,
AdminPurgeCommunity,
AdminPurgeCommunityForm,
AdminPurgePerson,
AdminPurgePersonForm,
AdminPurgePost,
AdminPurgePostForm,
ModAdd,
ModAddCommunity,
ModAddCommunityForm,
ModAddForm,
ModBan,
ModBanForm,
ModBanFromCommunity,
ModBanFromCommunityForm,
ModFeaturePost,
ModFeaturePostForm,
ModHideCommunity,
ModHideCommunityForm,
ModLockPost,
ModLockPostForm,
ModRemoveComment,
ModRemoveCommentForm,
ModRemoveCommunity,
ModRemoveCommunityForm,
ModRemovePost,
ModRemovePostForm,
ModTransferCommunity,
ModTransferCommunityForm,
AdminPurgeComment, AdminPurgeCommentForm, AdminPurgeCommunity, AdminPurgeCommunityForm,
AdminPurgePerson, AdminPurgePersonForm, AdminPurgePost, AdminPurgePostForm, ModAdd,
ModAddCommunity, ModAddCommunityForm, ModAddForm, ModBan, ModBanForm, ModBanFromCommunity,
ModBanFromCommunityForm, ModFeaturePost, ModFeaturePostForm, ModHideCommunity,
ModHideCommunityForm, ModLockPost, ModLockPostForm, ModRemoveComment, ModRemoveCommentForm,
ModRemoveCommunity, ModRemoveCommunityForm, ModRemovePost, ModRemovePostForm,
ModTransferCommunity, ModTransferCommunityForm,
},
traits::Crud,
utils::{get_conn, DbPool},
@ -475,24 +452,10 @@ mod tests {
community::{Community, CommunityInsertForm},
instance::Instance,
moderator::{
ModAdd,
ModAddCommunity,
ModAddCommunityForm,
ModAddForm,
ModBan,
ModBanForm,
ModBanFromCommunity,
ModBanFromCommunityForm,
ModFeaturePost,
ModFeaturePostForm,
ModLockPost,
ModLockPostForm,
ModRemoveComment,
ModRemoveCommentForm,
ModRemoveCommunity,
ModRemoveCommunityForm,
ModRemovePost,
ModRemovePostForm,
ModAdd, ModAddCommunity, ModAddCommunityForm, ModAddForm, ModBan, ModBanForm,
ModBanFromCommunity, ModBanFromCommunityForm, ModFeaturePost, ModFeaturePostForm,
ModLockPost, ModLockPostForm, ModRemoveComment, ModRemoveCommentForm, ModRemoveCommunity,
ModRemoveCommunityForm, ModRemovePost, ModRemovePostForm,
},
person::{Person, PersonInsertForm},
post::{Post, PostInsertForm},

View File

@ -9,9 +9,7 @@ use diesel::{
dsl::{insert_into, now, IntervalDsl},
result::Error,
sql_types::Timestamptz,
ExpressionMethods,
IntoSql,
QueryDsl,
ExpressionMethods, IntoSql, QueryDsl,
};
use diesel_async::RunQueryDsl;

View File

@ -2,11 +2,7 @@ use crate::{
newtypes::{CommunityId, DbUrl, PersonId},
schema::{instance, local_user, person, person_follower},
source::person::{
Person,
PersonFollower,
PersonFollowerForm,
PersonInsertForm,
PersonUpdateForm,
Person, PersonFollower, PersonFollowerForm, PersonInsertForm, PersonUpdateForm,
},
traits::{ApubActor, Crud, Followable},
utils::{functions::lower, get_conn, naive_now, DbPool},

View File

@ -2,30 +2,11 @@ use super::instance::coalesce;
use crate::{
newtypes::{CommunityId, DbUrl, PersonId, PostId},
schema::post::dsl::{
ap_id,
body,
community_id,
creator_id,
deleted,
featured_community,
local,
name,
post,
published,
removed,
thumbnail_url,
updated,
url,
ap_id, body, community_id, creator_id, deleted, featured_community, local, name, post,
published, removed, thumbnail_url, updated, url,
},
source::post::{
Post,
PostInsertForm,
PostLike,
PostLikeForm,
PostRead,
PostReadForm,
PostSaved,
PostSavedForm,
Post, PostInsertForm, PostLike, PostLikeForm, PostRead, PostReadForm, PostSaved, PostSavedForm,
PostUpdateForm,
},
traits::{Crud, Likeable, Readable, Saveable},
@ -347,15 +328,8 @@ mod tests {
instance::Instance,
person::{Person, PersonInsertForm},
post::{
Post,
PostInsertForm,
PostLike,
PostLikeForm,
PostRead,
PostReadForm,
PostSaved,
PostSavedForm,
PostUpdateForm,
Post, PostInsertForm, PostLike, PostLikeForm, PostRead, PostReadForm, PostSaved,
PostSavedForm, PostUpdateForm,
},
},
traits::{Crud, Likeable, Readable, Saveable},

Some files were not shown because too many files have changed in this diff Show More