Group imports in some modules

This commit is contained in:
silverpill 2023-01-19 20:34:46 +00:00
parent 05f6bb6091
commit c26fc9235d
9 changed files with 104 additions and 82 deletions

View file

@ -9,12 +9,14 @@ use crate::activitypub::{
use crate::config::Config;
use crate::database::DatabaseClient;
use crate::errors::ValidationError;
use crate::models::profiles::queries::get_profile_by_remote_actor_id;
use crate::models::relationships::queries::{
follow_request_accepted,
get_follow_request_by_id,
use crate::models::{
profiles::queries::get_profile_by_remote_actor_id,
relationships::queries::{
follow_request_accepted,
get_follow_request_by_id,
},
relationships::types::FollowRequestStatus,
};
use crate::models::relationships::types::FollowRequestStatus;
use super::HandlerResult;
#[derive(Deserialize)]

View file

@ -8,9 +8,11 @@ use crate::activitypub::{
use crate::config::Config;
use crate::database::DatabaseClient;
use crate::errors::ValidationError;
use crate::models::profiles::queries::get_profile_by_remote_actor_id;
use crate::models::relationships::queries::subscribe_opt;
use crate::models::users::queries::get_user_by_name;
use crate::models::{
profiles::queries::get_profile_by_remote_actor_id,
relationships::queries::subscribe_opt,
users::queries::get_user_by_name,
};
use super::{HandlerError, HandlerResult};
#[derive(Deserialize)]

View file

@ -10,11 +10,13 @@ use crate::activitypub::{
use crate::config::Config;
use crate::database::{DatabaseClient, DatabaseError};
use crate::errors::ValidationError;
use crate::models::posts::queries::{
create_post,
get_post_by_remote_object_id,
use crate::models::{
posts::queries::{
create_post,
get_post_by_remote_object_id,
},
posts::types::PostCreateData,
};
use crate::models::posts::types::PostCreateData;
use super::HandlerResult;
#[derive(Deserialize)]

View file

@ -21,29 +21,31 @@ use crate::activitypub::{
use crate::config::{Config, Instance};
use crate::database::{DatabaseClient, DatabaseError};
use crate::errors::{ConversionError, ValidationError};
use crate::models::attachments::queries::create_attachment;
use crate::models::emojis::queries::{
create_emoji,
get_emoji_by_remote_object_id,
update_emoji,
};
use crate::models::posts::{
hashtags::normalize_hashtag,
helpers::get_post_by_object_id,
mentions::mention_to_address,
queries::create_post,
types::{Post, PostCreateData, Visibility},
validators::{
content_allowed_classes,
ATTACHMENTS_MAX_NUM,
CONTENT_MAX_SIZE,
EMOJI_MAX_SIZE,
EMOJI_MEDIA_TYPES,
EMOJIS_MAX_NUM,
use crate::models::{
attachments::queries::create_attachment,
emojis::queries::{
create_emoji,
get_emoji_by_remote_object_id,
update_emoji,
},
posts::{
hashtags::normalize_hashtag,
helpers::get_post_by_object_id,
mentions::mention_to_address,
queries::create_post,
types::{Post, PostCreateData, Visibility},
validators::{
content_allowed_classes,
ATTACHMENTS_MAX_NUM,
CONTENT_MAX_SIZE,
EMOJI_MAX_SIZE,
EMOJI_MEDIA_TYPES,
EMOJIS_MAX_NUM,
},
},
profiles::types::DbActorProfile,
users::queries::get_user_by_name,
};
use crate::models::profiles::types::DbActorProfile;
use crate::models::users::queries::get_user_by_name;
use crate::utils::{
html::clean_html,
urls::get_hostname,

View file

@ -8,13 +8,15 @@ use crate::activitypub::{
use crate::config::Config;
use crate::database::{DatabaseClient, DatabaseError};
use crate::errors::ValidationError;
use crate::models::posts::queries::{
delete_post,
get_post_by_remote_object_id,
};
use crate::models::profiles::queries::{
delete_profile,
get_profile_by_remote_actor_id,
use crate::models::{
posts::queries::{
delete_post,
get_post_by_remote_object_id,
},
profiles::queries::{
delete_profile,
get_profile_by_remote_actor_id,
},
};
use super::HandlerResult;

View file

@ -9,12 +9,14 @@ use crate::activitypub::{
use crate::config::Config;
use crate::database::DatabaseClient;
use crate::errors::ValidationError;
use crate::models::profiles::queries::get_profile_by_remote_actor_id;
use crate::models::relationships::queries::{
follow_request_rejected,
get_follow_request_by_id,
use crate::models::{
profiles::queries::get_profile_by_remote_actor_id,
relationships::queries::{
follow_request_rejected,
get_follow_request_by_id,
},
relationships::types::FollowRequestStatus,
};
use crate::models::relationships::types::FollowRequestStatus;
use super::HandlerResult;
#[derive(Deserialize)]

View file

@ -8,12 +8,14 @@ use crate::activitypub::{
use crate::config::Config;
use crate::database::{DatabaseClient, DatabaseError};
use crate::errors::ValidationError;
use crate::models::notifications::queries::{
create_subscription_expiration_notification,
use crate::models::{
notifications::queries::{
create_subscription_expiration_notification,
},
profiles::queries::get_profile_by_remote_actor_id,
relationships::queries::unsubscribe,
users::queries::get_user_by_name,
};
use crate::models::profiles::queries::get_profile_by_remote_actor_id;
use crate::models::relationships::queries::unsubscribe;
use crate::models::users::queries::get_user_by_name;
use super::{HandlerError, HandlerResult};
#[derive(Deserialize)]

View file

@ -11,26 +11,30 @@ use crate::activitypub::{
};
use crate::config::Config;
use crate::database::DatabaseClient;
use crate::ethereum::signatures::generate_ecdsa_key;
use crate::ethereum::sync::save_current_block_number;
use crate::ethereum::utils::key_to_ethereum_address;
use crate::models::attachments::queries::delete_unused_attachments;
use crate::models::cleanup::find_orphaned_files;
use crate::models::emojis::queries::delete_emoji;
use crate::models::posts::queries::{delete_post, find_extraneous_posts, get_post_by_id};
use crate::models::profiles::queries::{
delete_profile,
find_empty_profiles,
get_profile_by_id,
get_profile_by_remote_actor_id,
use crate::ethereum::{
signatures::generate_ecdsa_key,
sync::save_current_block_number,
utils::key_to_ethereum_address,
};
use crate::models::oauth::queries::delete_oauth_tokens;
use crate::models::subscriptions::queries::reset_subscriptions;
use crate::models::users::queries::{
create_invite_code,
get_invite_codes,
get_user_by_id,
set_user_password,
use crate::models::{
attachments::queries::delete_unused_attachments,
cleanup::find_orphaned_files,
emojis::queries::delete_emoji,
oauth::queries::delete_oauth_tokens,
posts::queries::{delete_post, find_extraneous_posts, get_post_by_id},
profiles::queries::{
delete_profile,
find_empty_profiles,
get_profile_by_id,
get_profile_by_remote_actor_id,
},
subscriptions::queries::reset_subscriptions,
users::queries::{
create_invite_code,
get_invite_codes,
get_user_by_id,
set_user_password,
},
};
use crate::monero::{
helpers::check_expired_invoice,

View file

@ -6,20 +6,24 @@ use uuid::Uuid;
use crate::errors::{HttpError, ValidationError};
use crate::identity::did::Did;
use crate::mastodon_api::pagination::PageSize;
use crate::mastodon_api::uploads::{save_b64_file, UploadError};
use crate::models::profiles::types::{
DbActorProfile,
ExtraField,
PaymentOption,
ProfileImage,
ProfileUpdateData,
use crate::mastodon_api::{
pagination::PageSize,
uploads::{save_b64_file, UploadError},
};
use crate::models::profiles::validators::validate_username;
use crate::models::subscriptions::types::Subscription;
use crate::models::users::types::{
validate_local_username,
User,
use crate::models::{
profiles::types::{
DbActorProfile,
ExtraField,
PaymentOption,
ProfileImage,
ProfileUpdateData,
},
profiles::validators::validate_username,
subscriptions::types::Subscription,
users::types::{
validate_local_username,
User,
},
};
use crate::utils::{
files::get_file_url,