mirror of
https://github.com/LemmyNet/lemmy.git
synced 2025-02-02 15:21:40 +00:00
Remove instrument macros (#5368)
* Remove instrument macros * shear * revert test change * clippy, another unused function
This commit is contained in:
parent
f4eb8877a0
commit
f3f1ea0e9e
159 changed files with 8 additions and 324 deletions
1
Cargo.lock
generated
1
Cargo.lock
generated
|
@ -2633,7 +2633,6 @@ dependencies = [
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"serde_with",
|
"serde_with",
|
||||||
"tracing",
|
|
||||||
"url",
|
"url",
|
||||||
"uuid",
|
"uuid",
|
||||||
]
|
]
|
||||||
|
|
|
@ -105,7 +105,7 @@ actix-web = { version = "4.9.0", default-features = false, features = [
|
||||||
"macros",
|
"macros",
|
||||||
"rustls-0_23",
|
"rustls-0_23",
|
||||||
] }
|
] }
|
||||||
tracing = "0.1.41"
|
tracing = { version = "0.1.41", default-features = false }
|
||||||
tracing-actix-web = { version = "0.7.15", default-features = false }
|
tracing-actix-web = { version = "0.7.15", default-features = false }
|
||||||
tracing-subscriber = { version = "0.3.19", features = ["env-filter"] }
|
tracing-subscriber = { version = "0.3.19", features = ["env-filter"] }
|
||||||
url = { version = "2.5.4", features = ["serde"] }
|
url = { version = "2.5.4", features = ["serde"] }
|
||||||
|
|
|
@ -11,7 +11,6 @@ use lemmy_db_schema::{
|
||||||
use lemmy_db_views::structs::{CommentView, LocalUserView};
|
use lemmy_db_views::structs::{CommentView, LocalUserView};
|
||||||
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
|
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn distinguish_comment(
|
pub async fn distinguish_comment(
|
||||||
data: Json<DistinguishComment>,
|
data: Json<DistinguishComment>,
|
||||||
context: Data<LemmyContext>,
|
context: Data<LemmyContext>,
|
||||||
|
|
|
@ -20,7 +20,6 @@ use lemmy_db_views::structs::{CommentView, LocalUserView};
|
||||||
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
|
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
|
||||||
use std::ops::Deref;
|
use std::ops::Deref;
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn like_comment(
|
pub async fn like_comment(
|
||||||
data: Json<CreateCommentLike>,
|
data: Json<CreateCommentLike>,
|
||||||
context: Data<LemmyContext>,
|
context: Data<LemmyContext>,
|
||||||
|
|
|
@ -8,7 +8,6 @@ use lemmy_db_views::structs::{CommentView, LocalUserView, VoteView};
|
||||||
use lemmy_utils::error::LemmyResult;
|
use lemmy_utils::error::LemmyResult;
|
||||||
|
|
||||||
/// Lists likes for a comment
|
/// Lists likes for a comment
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn list_comment_likes(
|
pub async fn list_comment_likes(
|
||||||
data: Query<ListCommentLikes>,
|
data: Query<ListCommentLikes>,
|
||||||
context: Data<LemmyContext>,
|
context: Data<LemmyContext>,
|
||||||
|
|
|
@ -10,7 +10,6 @@ use lemmy_db_schema::{
|
||||||
use lemmy_db_views::structs::{CommentView, LocalUserView};
|
use lemmy_db_views::structs::{CommentView, LocalUserView};
|
||||||
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
|
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn save_comment(
|
pub async fn save_comment(
|
||||||
data: Json<SaveComment>,
|
data: Json<SaveComment>,
|
||||||
context: Data<LemmyContext>,
|
context: Data<LemmyContext>,
|
||||||
|
|
|
@ -17,7 +17,6 @@ use lemmy_db_schema::{
|
||||||
use lemmy_db_views::structs::{CommunityModeratorView, LocalUserView};
|
use lemmy_db_views::structs::{CommunityModeratorView, LocalUserView};
|
||||||
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
|
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn add_mod_to_community(
|
pub async fn add_mod_to_community(
|
||||||
data: Json<AddModToCommunity>,
|
data: Json<AddModToCommunity>,
|
||||||
context: Data<LemmyContext>,
|
context: Data<LemmyContext>,
|
||||||
|
|
|
@ -30,7 +30,6 @@ use lemmy_utils::{
|
||||||
utils::validation::is_valid_body_field,
|
utils::validation::is_valid_body_field,
|
||||||
};
|
};
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn ban_from_community(
|
pub async fn ban_from_community(
|
||||||
data: Json<BanFromCommunity>,
|
data: Json<BanFromCommunity>,
|
||||||
context: Data<LemmyContext>,
|
context: Data<LemmyContext>,
|
||||||
|
|
|
@ -15,7 +15,6 @@ use lemmy_db_schema::{
|
||||||
use lemmy_db_views::structs::{CommunityView, LocalUserView};
|
use lemmy_db_views::structs::{CommunityView, LocalUserView};
|
||||||
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
|
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn user_block_community(
|
pub async fn user_block_community(
|
||||||
data: Json<BlockCommunity>,
|
data: Json<BlockCommunity>,
|
||||||
context: Data<LemmyContext>,
|
context: Data<LemmyContext>,
|
||||||
|
|
|
@ -17,7 +17,6 @@ use lemmy_db_schema::{
|
||||||
use lemmy_db_views::structs::{CommunityPersonBanView, CommunityView, LocalUserView};
|
use lemmy_db_views::structs::{CommunityPersonBanView, CommunityView, LocalUserView};
|
||||||
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
|
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn follow_community(
|
pub async fn follow_community(
|
||||||
data: Json<FollowCommunity>,
|
data: Json<FollowCommunity>,
|
||||||
context: Data<LemmyContext>,
|
context: Data<LemmyContext>,
|
||||||
|
|
|
@ -17,7 +17,6 @@ use lemmy_db_schema::{
|
||||||
use lemmy_db_views::structs::LocalUserView;
|
use lemmy_db_views::structs::LocalUserView;
|
||||||
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
|
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn hide_community(
|
pub async fn hide_community(
|
||||||
data: Json<HideCommunity>,
|
data: Json<HideCommunity>,
|
||||||
context: Data<LemmyContext>,
|
context: Data<LemmyContext>,
|
||||||
|
|
|
@ -13,7 +13,6 @@ use lemmy_db_schema::source::{
|
||||||
use lemmy_db_views::structs::{CommunityView, LocalUserView};
|
use lemmy_db_views::structs::{CommunityView, LocalUserView};
|
||||||
use lemmy_utils::error::LemmyResult;
|
use lemmy_utils::error::LemmyResult;
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn get_random_community(
|
pub async fn get_random_community(
|
||||||
data: Query<GetRandomCommunity>,
|
data: Query<GetRandomCommunity>,
|
||||||
context: Data<LemmyContext>,
|
context: Data<LemmyContext>,
|
||||||
|
|
|
@ -20,7 +20,7 @@ use lemmy_utils::{
|
||||||
|
|
||||||
// TODO: we dont do anything for federation here, it should be updated the next time the community
|
// TODO: we dont do anything for federation here, it should be updated the next time the community
|
||||||
// gets fetched. i hope we can get rid of the community creator role soon.
|
// gets fetched. i hope we can get rid of the community creator role soon.
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn transfer_community(
|
pub async fn transfer_community(
|
||||||
data: Json<TransferCommunity>,
|
data: Json<TransferCommunity>,
|
||||||
context: Data<LemmyContext>,
|
context: Data<LemmyContext>,
|
||||||
|
|
|
@ -146,7 +146,6 @@ fn build_totp_2fa(hostname: &str, username: &str, secret: &str) -> LemmyResult<T
|
||||||
/// So when doing a site ban for a non-local user, you need to federate/send a
|
/// So when doing a site ban for a non-local user, you need to federate/send a
|
||||||
/// community ban for every local community they've participated in.
|
/// community ban for every local community they've participated in.
|
||||||
/// See https://github.com/LemmyNet/lemmy/issues/4118
|
/// See https://github.com/LemmyNet/lemmy/issues/4118
|
||||||
#[tracing::instrument(skip_all)]
|
|
||||||
pub(crate) async fn ban_nonlocal_user_from_local_communities(
|
pub(crate) async fn ban_nonlocal_user_from_local_communities(
|
||||||
local_user_view: &LocalUserView,
|
local_user_view: &LocalUserView,
|
||||||
target: &Person,
|
target: &Person,
|
||||||
|
|
|
@ -14,7 +14,6 @@ use lemmy_db_schema::{
|
||||||
use lemmy_db_views::structs::{LocalUserView, PersonView};
|
use lemmy_db_views::structs::{LocalUserView, PersonView};
|
||||||
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
|
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn add_admin(
|
pub async fn add_admin(
|
||||||
data: Json<AddAdmin>,
|
data: Json<AddAdmin>,
|
||||||
context: Data<LemmyContext>,
|
context: Data<LemmyContext>,
|
||||||
|
|
|
@ -22,7 +22,6 @@ use lemmy_utils::{
|
||||||
utils::validation::is_valid_body_field,
|
utils::validation::is_valid_body_field,
|
||||||
};
|
};
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn ban_from_site(
|
pub async fn ban_from_site(
|
||||||
data: Json<BanPerson>,
|
data: Json<BanPerson>,
|
||||||
context: Data<LemmyContext>,
|
context: Data<LemmyContext>,
|
||||||
|
|
|
@ -10,7 +10,6 @@ use lemmy_db_schema::{
|
||||||
use lemmy_db_views::structs::{LocalUserView, PersonView};
|
use lemmy_db_views::structs::{LocalUserView, PersonView};
|
||||||
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
|
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn user_block_person(
|
pub async fn user_block_person(
|
||||||
data: Json<BlockPerson>,
|
data: Json<BlockPerson>,
|
||||||
context: Data<LemmyContext>,
|
context: Data<LemmyContext>,
|
||||||
|
|
|
@ -13,7 +13,6 @@ use lemmy_db_schema::source::{local_user::LocalUser, login_token::LoginToken};
|
||||||
use lemmy_db_views::structs::LocalUserView;
|
use lemmy_db_views::structs::LocalUserView;
|
||||||
use lemmy_utils::error::{LemmyErrorType, LemmyResult};
|
use lemmy_utils::error::{LemmyErrorType, LemmyResult};
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn change_password(
|
pub async fn change_password(
|
||||||
data: Json<ChangePassword>,
|
data: Json<ChangePassword>,
|
||||||
req: HttpRequest,
|
req: HttpRequest,
|
||||||
|
|
|
@ -12,7 +12,6 @@ use lemmy_db_schema::source::{
|
||||||
};
|
};
|
||||||
use lemmy_utils::error::{LemmyErrorType, LemmyResult};
|
use lemmy_utils::error::{LemmyErrorType, LemmyResult};
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn change_password_after_reset(
|
pub async fn change_password_after_reset(
|
||||||
data: Json<PasswordChangeAfterReset>,
|
data: Json<PasswordChangeAfterReset>,
|
||||||
context: Data<LemmyContext>,
|
context: Data<LemmyContext>,
|
||||||
|
|
|
@ -11,7 +11,6 @@ use lemmy_utils::error::{LemmyErrorType, LemmyResult};
|
||||||
|
|
||||||
/// Generate a new secret for two-factor-authentication. Afterwards you need to call [toggle_totp]
|
/// Generate a new secret for two-factor-authentication. Afterwards you need to call [toggle_totp]
|
||||||
/// to enable it. This can only be called if 2FA is currently disabled.
|
/// to enable it. This can only be called if 2FA is currently disabled.
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn generate_totp_secret(
|
pub async fn generate_totp_secret(
|
||||||
local_user_view: LocalUserView,
|
local_user_view: LocalUserView,
|
||||||
context: Data<LemmyContext>,
|
context: Data<LemmyContext>,
|
||||||
|
|
|
@ -20,7 +20,6 @@ use lemmy_db_schema::source::{
|
||||||
};
|
};
|
||||||
use lemmy_utils::error::LemmyResult;
|
use lemmy_utils::error::LemmyResult;
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn get_captcha(context: Data<LemmyContext>) -> LemmyResult<HttpResponse> {
|
pub async fn get_captcha(context: Data<LemmyContext>) -> LemmyResult<HttpResponse> {
|
||||||
let local_site = LocalSite::read(&mut context.pool()).await?;
|
let local_site = LocalSite::read(&mut context.pool()).await?;
|
||||||
let mut res = HttpResponseBuilder::new(StatusCode::OK);
|
let mut res = HttpResponseBuilder::new(StatusCode::OK);
|
||||||
|
|
|
@ -6,7 +6,6 @@ use lemmy_api_common::{
|
||||||
use lemmy_db_views::structs::{LocalImageView, LocalUserView};
|
use lemmy_db_views::structs::{LocalImageView, LocalUserView};
|
||||||
use lemmy_utils::error::LemmyResult;
|
use lemmy_utils::error::LemmyResult;
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn list_media(
|
pub async fn list_media(
|
||||||
data: Query<ListMedia>,
|
data: Query<ListMedia>,
|
||||||
context: Data<LemmyContext>,
|
context: Data<LemmyContext>,
|
||||||
|
|
|
@ -11,7 +11,6 @@ use lemmy_db_views::{
|
||||||
};
|
};
|
||||||
use lemmy_utils::error::LemmyResult;
|
use lemmy_utils::error::LemmyResult;
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn list_person_saved(
|
pub async fn list_person_saved(
|
||||||
data: Query<ListPersonSaved>,
|
data: Query<ListPersonSaved>,
|
||||||
context: Data<LemmyContext>,
|
context: Data<LemmyContext>,
|
||||||
|
|
|
@ -13,7 +13,6 @@ use lemmy_api_common::{
|
||||||
use lemmy_db_views::structs::{LocalUserView, SiteView};
|
use lemmy_db_views::structs::{LocalUserView, SiteView};
|
||||||
use lemmy_utils::error::{LemmyErrorType, LemmyResult};
|
use lemmy_utils::error::{LemmyErrorType, LemmyResult};
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn login(
|
pub async fn login(
|
||||||
data: Json<Login>,
|
data: Json<Login>,
|
||||||
req: HttpRequest,
|
req: HttpRequest,
|
||||||
|
|
|
@ -9,7 +9,6 @@ use lemmy_db_schema::source::login_token::LoginToken;
|
||||||
use lemmy_db_views::structs::LocalUserView;
|
use lemmy_db_views::structs::LocalUserView;
|
||||||
use lemmy_utils::error::{LemmyErrorType, LemmyResult};
|
use lemmy_utils::error::{LemmyErrorType, LemmyResult};
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn logout(
|
pub async fn logout(
|
||||||
req: HttpRequest,
|
req: HttpRequest,
|
||||||
// require login
|
// require login
|
||||||
|
|
|
@ -6,7 +6,6 @@ use lemmy_api_common::{
|
||||||
use lemmy_db_views::{combined::inbox_combined_view::InboxCombinedQuery, structs::LocalUserView};
|
use lemmy_db_views::{combined::inbox_combined_view::InboxCombinedQuery, structs::LocalUserView};
|
||||||
use lemmy_utils::error::LemmyResult;
|
use lemmy_utils::error::LemmyResult;
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn list_inbox(
|
pub async fn list_inbox(
|
||||||
data: Query<ListInbox>,
|
data: Query<ListInbox>,
|
||||||
context: Data<LemmyContext>,
|
context: Data<LemmyContext>,
|
||||||
|
|
|
@ -9,7 +9,6 @@ use lemmy_db_schema::source::{
|
||||||
use lemmy_db_views::structs::LocalUserView;
|
use lemmy_db_views::structs::LocalUserView;
|
||||||
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
|
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn mark_all_notifications_read(
|
pub async fn mark_all_notifications_read(
|
||||||
context: Data<LemmyContext>,
|
context: Data<LemmyContext>,
|
||||||
local_user_view: LocalUserView,
|
local_user_view: LocalUserView,
|
||||||
|
|
|
@ -11,7 +11,6 @@ use lemmy_db_schema::{
|
||||||
use lemmy_db_views::structs::LocalUserView;
|
use lemmy_db_views::structs::LocalUserView;
|
||||||
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
|
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn mark_comment_mention_as_read(
|
pub async fn mark_comment_mention_as_read(
|
||||||
data: Json<MarkPersonCommentMentionAsRead>,
|
data: Json<MarkPersonCommentMentionAsRead>,
|
||||||
context: Data<LemmyContext>,
|
context: Data<LemmyContext>,
|
||||||
|
|
|
@ -11,7 +11,6 @@ use lemmy_db_schema::{
|
||||||
use lemmy_db_views::structs::LocalUserView;
|
use lemmy_db_views::structs::LocalUserView;
|
||||||
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
|
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn mark_post_mention_as_read(
|
pub async fn mark_post_mention_as_read(
|
||||||
data: Json<MarkPersonPostMentionAsRead>,
|
data: Json<MarkPersonPostMentionAsRead>,
|
||||||
context: Data<LemmyContext>,
|
context: Data<LemmyContext>,
|
||||||
|
|
|
@ -7,7 +7,6 @@ use lemmy_db_schema::{
|
||||||
use lemmy_db_views::structs::LocalUserView;
|
use lemmy_db_views::structs::LocalUserView;
|
||||||
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
|
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn mark_reply_as_read(
|
pub async fn mark_reply_as_read(
|
||||||
data: Json<MarkCommentReplyAsRead>,
|
data: Json<MarkCommentReplyAsRead>,
|
||||||
context: Data<LemmyContext>,
|
context: Data<LemmyContext>,
|
||||||
|
|
|
@ -3,7 +3,6 @@ use lemmy_api_common::{context::LemmyContext, person::GetUnreadCountResponse};
|
||||||
use lemmy_db_views::structs::{InboxCombinedViewInternal, LocalUserView};
|
use lemmy_db_views::structs::{InboxCombinedViewInternal, LocalUserView};
|
||||||
use lemmy_utils::error::LemmyResult;
|
use lemmy_utils::error::LemmyResult;
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn unread_count(
|
pub async fn unread_count(
|
||||||
context: Data<LemmyContext>,
|
context: Data<LemmyContext>,
|
||||||
local_user_view: LocalUserView,
|
local_user_view: LocalUserView,
|
||||||
|
|
|
@ -7,7 +7,6 @@ use lemmy_api_common::{
|
||||||
use lemmy_db_views::structs::{LocalUserView, ReportCombinedViewInternal};
|
use lemmy_db_views::structs::{LocalUserView, ReportCombinedViewInternal};
|
||||||
use lemmy_utils::error::LemmyResult;
|
use lemmy_utils::error::LemmyResult;
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn report_count(
|
pub async fn report_count(
|
||||||
data: Query<GetReportCount>,
|
data: Query<GetReportCount>,
|
||||||
context: Data<LemmyContext>,
|
context: Data<LemmyContext>,
|
||||||
|
|
|
@ -9,7 +9,6 @@ use lemmy_db_views::structs::{LocalUserView, SiteView};
|
||||||
use lemmy_utils::error::LemmyResult;
|
use lemmy_utils::error::LemmyResult;
|
||||||
use tracing::error;
|
use tracing::error;
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn reset_password(
|
pub async fn reset_password(
|
||||||
data: Json<PasswordReset>,
|
data: Json<PasswordReset>,
|
||||||
context: Data<LemmyContext>,
|
context: Data<LemmyContext>,
|
||||||
|
|
|
@ -28,7 +28,6 @@ use lemmy_utils::{
|
||||||
};
|
};
|
||||||
use std::ops::Deref;
|
use std::ops::Deref;
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn save_user_settings(
|
pub async fn save_user_settings(
|
||||||
data: Json<SaveUserSettings>,
|
data: Json<SaveUserSettings>,
|
||||||
context: Data<LemmyContext>,
|
context: Data<LemmyContext>,
|
||||||
|
|
|
@ -16,7 +16,6 @@ use lemmy_utils::error::LemmyResult;
|
||||||
///
|
///
|
||||||
/// Disabling is only possible if 2FA was previously enabled. Again it is necessary to pass a valid
|
/// Disabling is only possible if 2FA was previously enabled. Again it is necessary to pass a valid
|
||||||
/// token.
|
/// token.
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn update_totp(
|
pub async fn update_totp(
|
||||||
data: Json<UpdateTotp>,
|
data: Json<UpdateTotp>,
|
||||||
local_user_view: LocalUserView,
|
local_user_view: LocalUserView,
|
||||||
|
|
|
@ -8,7 +8,6 @@ use lemmy_db_schema::{
|
||||||
use lemmy_db_views::structs::LocalUserView;
|
use lemmy_db_views::structs::LocalUserView;
|
||||||
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
|
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn user_block_instance(
|
pub async fn user_block_instance(
|
||||||
data: Json<UserBlockInstanceParams>,
|
data: Json<UserBlockInstanceParams>,
|
||||||
local_user_view: LocalUserView,
|
local_user_view: LocalUserView,
|
||||||
|
|
|
@ -11,7 +11,6 @@ use lemmy_utils::error::{LemmyErrorType, LemmyResult};
|
||||||
|
|
||||||
/// Returns an error message if the auth token is invalid for any reason. Necessary because other
|
/// Returns an error message if the auth token is invalid for any reason. Necessary because other
|
||||||
/// endpoints silently treat any call with invalid auth as unauthenticated.
|
/// endpoints silently treat any call with invalid auth as unauthenticated.
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn validate_auth(
|
pub async fn validate_auth(
|
||||||
req: HttpRequest,
|
req: HttpRequest,
|
||||||
context: Data<LemmyContext>,
|
context: Data<LemmyContext>,
|
||||||
|
|
|
@ -19,7 +19,6 @@ use lemmy_db_schema::{
|
||||||
use lemmy_db_views::structs::LocalUserView;
|
use lemmy_db_views::structs::LocalUserView;
|
||||||
use lemmy_utils::error::LemmyResult;
|
use lemmy_utils::error::LemmyResult;
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn feature_post(
|
pub async fn feature_post(
|
||||||
data: Json<FeaturePost>,
|
data: Json<FeaturePost>,
|
||||||
context: Data<LemmyContext>,
|
context: Data<LemmyContext>,
|
||||||
|
|
|
@ -8,7 +8,6 @@ use lemmy_db_views::structs::LocalUserView;
|
||||||
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
|
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
|
||||||
use url::Url;
|
use url::Url;
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn get_link_metadata(
|
pub async fn get_link_metadata(
|
||||||
data: Query<GetSiteMetadata>,
|
data: Query<GetSiteMetadata>,
|
||||||
context: Data<LemmyContext>,
|
context: Data<LemmyContext>,
|
||||||
|
|
|
@ -7,7 +7,6 @@ use lemmy_db_schema::source::post::PostHide;
|
||||||
use lemmy_db_views::structs::{LocalUserView, PostView};
|
use lemmy_db_views::structs::{LocalUserView, PostView};
|
||||||
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
|
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn hide_post(
|
pub async fn hide_post(
|
||||||
data: Json<HidePost>,
|
data: Json<HidePost>,
|
||||||
context: Data<LemmyContext>,
|
context: Data<LemmyContext>,
|
||||||
|
|
|
@ -19,7 +19,6 @@ use lemmy_db_views::structs::{LocalUserView, PostView};
|
||||||
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
|
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
|
||||||
use std::ops::Deref;
|
use std::ops::Deref;
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn like_post(
|
pub async fn like_post(
|
||||||
data: Json<CreatePostLike>,
|
data: Json<CreatePostLike>,
|
||||||
context: Data<LemmyContext>,
|
context: Data<LemmyContext>,
|
||||||
|
|
|
@ -9,7 +9,6 @@ use lemmy_db_views::structs::{LocalUserView, VoteView};
|
||||||
use lemmy_utils::error::LemmyResult;
|
use lemmy_utils::error::LemmyResult;
|
||||||
|
|
||||||
/// Lists likes for a post
|
/// Lists likes for a post
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn list_post_likes(
|
pub async fn list_post_likes(
|
||||||
data: Query<ListPostLikes>,
|
data: Query<ListPostLikes>,
|
||||||
context: Data<LemmyContext>,
|
context: Data<LemmyContext>,
|
||||||
|
|
|
@ -17,7 +17,6 @@ use lemmy_db_schema::{
|
||||||
use lemmy_db_views::structs::{LocalUserView, PostView};
|
use lemmy_db_views::structs::{LocalUserView, PostView};
|
||||||
use lemmy_utils::error::LemmyResult;
|
use lemmy_utils::error::LemmyResult;
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn lock_post(
|
pub async fn lock_post(
|
||||||
data: Json<LockPost>,
|
data: Json<LockPost>,
|
||||||
context: Data<LemmyContext>,
|
context: Data<LemmyContext>,
|
||||||
|
|
|
@ -4,7 +4,6 @@ use lemmy_db_schema::source::post::PostRead;
|
||||||
use lemmy_db_views::structs::LocalUserView;
|
use lemmy_db_views::structs::LocalUserView;
|
||||||
use lemmy_utils::error::{LemmyErrorType, LemmyResult, MAX_API_PARAM_ELEMENTS};
|
use lemmy_utils::error::{LemmyErrorType, LemmyResult, MAX_API_PARAM_ELEMENTS};
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn mark_posts_as_read(
|
pub async fn mark_posts_as_read(
|
||||||
data: Json<MarkManyPostsAsRead>,
|
data: Json<MarkManyPostsAsRead>,
|
||||||
context: Data<LemmyContext>,
|
context: Data<LemmyContext>,
|
||||||
|
|
|
@ -7,7 +7,6 @@ use lemmy_db_schema::source::post::{PostRead, PostReadForm};
|
||||||
use lemmy_db_views::structs::{LocalUserView, PostView};
|
use lemmy_db_views::structs::{LocalUserView, PostView};
|
||||||
use lemmy_utils::error::LemmyResult;
|
use lemmy_utils::error::LemmyResult;
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn mark_post_as_read(
|
pub async fn mark_post_as_read(
|
||||||
data: Json<MarkPostAsRead>,
|
data: Json<MarkPostAsRead>,
|
||||||
context: Data<LemmyContext>,
|
context: Data<LemmyContext>,
|
||||||
|
|
|
@ -10,7 +10,6 @@ use lemmy_db_schema::{
|
||||||
use lemmy_db_views::structs::{LocalUserView, PostView};
|
use lemmy_db_views::structs::{LocalUserView, PostView};
|
||||||
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
|
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn save_post(
|
pub async fn save_post(
|
||||||
data: Json<SavePost>,
|
data: Json<SavePost>,
|
||||||
context: Data<LemmyContext>,
|
context: Data<LemmyContext>,
|
||||||
|
|
|
@ -11,7 +11,6 @@ use lemmy_db_schema::{
|
||||||
use lemmy_db_views::structs::LocalUserView;
|
use lemmy_db_views::structs::LocalUserView;
|
||||||
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
|
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn mark_pm_as_read(
|
pub async fn mark_pm_as_read(
|
||||||
data: Json<MarkPrivateMessageAsRead>,
|
data: Json<MarkPrivateMessageAsRead>,
|
||||||
context: Data<LemmyContext>,
|
context: Data<LemmyContext>,
|
||||||
|
|
|
@ -22,7 +22,6 @@ use lemmy_db_views::structs::{CommentReportView, CommentView, LocalUserView};
|
||||||
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
|
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
|
||||||
|
|
||||||
/// Creates a comment report and notifies the moderators of the community
|
/// Creates a comment report and notifies the moderators of the community
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn create_comment_report(
|
pub async fn create_comment_report(
|
||||||
data: Json<CreateCommentReport>,
|
data: Json<CreateCommentReport>,
|
||||||
context: Data<LemmyContext>,
|
context: Data<LemmyContext>,
|
||||||
|
|
|
@ -9,7 +9,6 @@ use lemmy_db_views::structs::{CommentReportView, LocalUserView};
|
||||||
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
|
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
|
||||||
|
|
||||||
/// Resolves or unresolves a comment report and notifies the moderators of the community
|
/// Resolves or unresolves a comment report and notifies the moderators of the community
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn resolve_comment_report(
|
pub async fn resolve_comment_report(
|
||||||
data: Json<ResolveCommentReport>,
|
data: Json<ResolveCommentReport>,
|
||||||
context: Data<LemmyContext>,
|
context: Data<LemmyContext>,
|
||||||
|
|
|
@ -22,7 +22,6 @@ use lemmy_db_views::structs::{LocalUserView, PostReportView, PostView};
|
||||||
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
|
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
|
||||||
|
|
||||||
/// Creates a post report and notifies the moderators of the community
|
/// Creates a post report and notifies the moderators of the community
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn create_post_report(
|
pub async fn create_post_report(
|
||||||
data: Json<CreatePostReport>,
|
data: Json<CreatePostReport>,
|
||||||
context: Data<LemmyContext>,
|
context: Data<LemmyContext>,
|
||||||
|
|
|
@ -9,7 +9,6 @@ use lemmy_db_views::structs::{LocalUserView, PostReportView};
|
||||||
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
|
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
|
||||||
|
|
||||||
/// Resolves or unresolves a post report and notifies the moderators of the community
|
/// Resolves or unresolves a post report and notifies the moderators of the community
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn resolve_post_report(
|
pub async fn resolve_post_report(
|
||||||
data: Json<ResolvePostReport>,
|
data: Json<ResolvePostReport>,
|
||||||
context: Data<LemmyContext>,
|
context: Data<LemmyContext>,
|
||||||
|
|
|
@ -16,7 +16,6 @@ use lemmy_db_schema::{
|
||||||
use lemmy_db_views::structs::{LocalUserView, PrivateMessageReportView};
|
use lemmy_db_views::structs::{LocalUserView, PrivateMessageReportView};
|
||||||
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
|
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn create_pm_report(
|
pub async fn create_pm_report(
|
||||||
data: Json<CreatePrivateMessageReport>,
|
data: Json<CreatePrivateMessageReport>,
|
||||||
context: Data<LemmyContext>,
|
context: Data<LemmyContext>,
|
||||||
|
|
|
@ -8,7 +8,6 @@ use lemmy_db_schema::{source::private_message_report::PrivateMessageReport, trai
|
||||||
use lemmy_db_views::structs::{LocalUserView, PrivateMessageReportView};
|
use lemmy_db_views::structs::{LocalUserView, PrivateMessageReportView};
|
||||||
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
|
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn resolve_pm_report(
|
pub async fn resolve_pm_report(
|
||||||
data: Json<ResolvePrivateMessageReport>,
|
data: Json<ResolvePrivateMessageReport>,
|
||||||
context: Data<LemmyContext>,
|
context: Data<LemmyContext>,
|
||||||
|
|
|
@ -9,7 +9,6 @@ use lemmy_utils::error::LemmyResult;
|
||||||
|
|
||||||
/// Lists reports for a community if an id is supplied
|
/// Lists reports for a community if an id is supplied
|
||||||
/// or returns all reports for communities a user moderates
|
/// or returns all reports for communities a user moderates
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn list_reports(
|
pub async fn list_reports(
|
||||||
data: Query<ListReports>,
|
data: Query<ListReports>,
|
||||||
context: Data<LemmyContext>,
|
context: Data<LemmyContext>,
|
||||||
|
|
|
@ -18,7 +18,6 @@ use lemmy_db_schema::{
|
||||||
use lemmy_db_views::structs::LocalUserView;
|
use lemmy_db_views::structs::LocalUserView;
|
||||||
use lemmy_utils::error::LemmyResult;
|
use lemmy_utils::error::LemmyResult;
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn admin_allow_instance(
|
pub async fn admin_allow_instance(
|
||||||
data: Json<AdminAllowInstanceParams>,
|
data: Json<AdminAllowInstanceParams>,
|
||||||
local_user_view: LocalUserView,
|
local_user_view: LocalUserView,
|
||||||
|
|
|
@ -18,7 +18,6 @@ use lemmy_db_schema::{
|
||||||
use lemmy_db_views::structs::LocalUserView;
|
use lemmy_db_views::structs::LocalUserView;
|
||||||
use lemmy_utils::error::LemmyResult;
|
use lemmy_utils::error::LemmyResult;
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn admin_block_instance(
|
pub async fn admin_block_instance(
|
||||||
data: Json<AdminBlockInstanceParams>,
|
data: Json<AdminBlockInstanceParams>,
|
||||||
local_user_view: LocalUserView,
|
local_user_view: LocalUserView,
|
||||||
|
|
|
@ -7,7 +7,6 @@ use lemmy_api_common::{
|
||||||
use lemmy_db_views::structs::SiteView;
|
use lemmy_db_views::structs::SiteView;
|
||||||
use lemmy_utils::error::LemmyResult;
|
use lemmy_utils::error::LemmyResult;
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn get_federated_instances(
|
pub async fn get_federated_instances(
|
||||||
context: Data<LemmyContext>,
|
context: Data<LemmyContext>,
|
||||||
) -> LemmyResult<Json<GetFederatedInstancesResponse>> {
|
) -> LemmyResult<Json<GetFederatedInstancesResponse>> {
|
||||||
|
|
|
@ -18,7 +18,6 @@ use lemmy_utils::{
|
||||||
VERSION,
|
VERSION,
|
||||||
};
|
};
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn leave_admin(
|
pub async fn leave_admin(
|
||||||
context: Data<LemmyContext>,
|
context: Data<LemmyContext>,
|
||||||
local_user_view: LocalUserView,
|
local_user_view: LocalUserView,
|
||||||
|
|
|
@ -7,7 +7,6 @@ use lemmy_api_common::{
|
||||||
use lemmy_db_views::structs::{LocalImageView, LocalUserView};
|
use lemmy_db_views::structs::{LocalImageView, LocalUserView};
|
||||||
use lemmy_utils::error::LemmyResult;
|
use lemmy_utils::error::LemmyResult;
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn list_all_media(
|
pub async fn list_all_media(
|
||||||
data: Query<ListMedia>,
|
data: Query<ListMedia>,
|
||||||
context: Data<LemmyContext>,
|
context: Data<LemmyContext>,
|
||||||
|
|
|
@ -8,7 +8,6 @@ use lemmy_db_schema::source::local_site::LocalSite;
|
||||||
use lemmy_db_views::{combined::modlog_combined_view::ModlogCombinedQuery, structs::LocalUserView};
|
use lemmy_db_views::{combined::modlog_combined_view::ModlogCombinedQuery, structs::LocalUserView};
|
||||||
use lemmy_utils::error::LemmyResult;
|
use lemmy_utils::error::LemmyResult;
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn get_mod_log(
|
pub async fn get_mod_log(
|
||||||
data: Query<GetModlog>,
|
data: Query<GetModlog>,
|
||||||
context: Data<LemmyContext>,
|
context: Data<LemmyContext>,
|
||||||
|
|
|
@ -18,7 +18,6 @@ use lemmy_db_schema::{
|
||||||
use lemmy_db_views::structs::{CommentView, LocalUserView};
|
use lemmy_db_views::structs::{CommentView, LocalUserView};
|
||||||
use lemmy_utils::error::LemmyResult;
|
use lemmy_utils::error::LemmyResult;
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn purge_comment(
|
pub async fn purge_comment(
|
||||||
data: Json<PurgeComment>,
|
data: Json<PurgeComment>,
|
||||||
context: Data<LemmyContext>,
|
context: Data<LemmyContext>,
|
||||||
|
|
|
@ -20,7 +20,6 @@ use lemmy_db_schema::{
|
||||||
use lemmy_db_views::structs::{CommunityModeratorView, LocalUserView};
|
use lemmy_db_views::structs::{CommunityModeratorView, LocalUserView};
|
||||||
use lemmy_utils::error::LemmyResult;
|
use lemmy_utils::error::LemmyResult;
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn purge_community(
|
pub async fn purge_community(
|
||||||
data: Json<PurgeCommunity>,
|
data: Json<PurgeCommunity>,
|
||||||
context: Data<LemmyContext>,
|
context: Data<LemmyContext>,
|
||||||
|
|
|
@ -19,7 +19,6 @@ use lemmy_db_schema::{
|
||||||
use lemmy_db_views::structs::LocalUserView;
|
use lemmy_db_views::structs::LocalUserView;
|
||||||
use lemmy_utils::error::LemmyResult;
|
use lemmy_utils::error::LemmyResult;
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn purge_person(
|
pub async fn purge_person(
|
||||||
data: Json<PurgePerson>,
|
data: Json<PurgePerson>,
|
||||||
context: Data<LemmyContext>,
|
context: Data<LemmyContext>,
|
||||||
|
|
|
@ -19,7 +19,6 @@ use lemmy_db_schema::{
|
||||||
use lemmy_db_views::structs::LocalUserView;
|
use lemmy_db_views::structs::LocalUserView;
|
||||||
use lemmy_utils::error::LemmyResult;
|
use lemmy_utils::error::LemmyResult;
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn purge_post(
|
pub async fn purge_post(
|
||||||
data: Json<PurgePost>,
|
data: Json<PurgePost>,
|
||||||
context: Data<LemmyContext>,
|
context: Data<LemmyContext>,
|
||||||
|
|
|
@ -91,7 +91,7 @@ pub async fn build_post_response(
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: this function is a mess and should be split up to handle email separately
|
// TODO: this function is a mess and should be split up to handle email separately
|
||||||
#[tracing::instrument(skip_all)]
|
|
||||||
pub async fn send_local_notifs(
|
pub async fn send_local_notifs(
|
||||||
mentions: Vec<MentionData>,
|
mentions: Vec<MentionData>,
|
||||||
post_or_comment_id: PostOrCommentId,
|
post_or_comment_id: PostOrCommentId,
|
||||||
|
|
|
@ -49,7 +49,6 @@ pub fn client_builder(settings: &Settings) -> ClientBuilder {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Fetches metadata for the given link and optionally generates thumbnail.
|
/// Fetches metadata for the given link and optionally generates thumbnail.
|
||||||
#[tracing::instrument(skip_all)]
|
|
||||||
pub async fn fetch_link_metadata(
|
pub async fn fetch_link_metadata(
|
||||||
url: &Url,
|
url: &Url,
|
||||||
context: &LemmyContext,
|
context: &LemmyContext,
|
||||||
|
@ -422,7 +421,6 @@ pub async fn delete_image_from_pictrs(alias: &str, context: &LemmyContext) -> Le
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Retrieves the image with local pict-rs and generates a thumbnail. Returns the thumbnail url.
|
/// Retrieves the image with local pict-rs and generates a thumbnail. Returns the thumbnail url.
|
||||||
#[tracing::instrument(skip_all)]
|
|
||||||
async fn generate_pictrs_thumbnail(image_url: &Url, context: &LemmyContext) -> LemmyResult<Url> {
|
async fn generate_pictrs_thumbnail(image_url: &Url, context: &LemmyContext) -> LemmyResult<Url> {
|
||||||
let pictrs_config = context.settings().pictrs()?;
|
let pictrs_config = context.settings().pictrs()?;
|
||||||
|
|
||||||
|
@ -476,7 +474,6 @@ async fn generate_pictrs_thumbnail(image_url: &Url, context: &LemmyContext) -> L
|
||||||
/// Fetches the image details for pictrs proxied images
|
/// Fetches the image details for pictrs proxied images
|
||||||
///
|
///
|
||||||
/// We don't need to check for image mode, as that's already been done
|
/// We don't need to check for image mode, as that's already been done
|
||||||
#[tracing::instrument(skip_all)]
|
|
||||||
pub async fn fetch_pictrs_proxied_image_details(
|
pub async fn fetch_pictrs_proxied_image_details(
|
||||||
image_url: &Url,
|
image_url: &Url,
|
||||||
context: &LemmyContext,
|
context: &LemmyContext,
|
||||||
|
@ -512,7 +509,7 @@ pub async fn fetch_pictrs_proxied_image_details(
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: get rid of this by reading content type from db
|
// TODO: get rid of this by reading content type from db
|
||||||
#[tracing::instrument(skip_all)]
|
|
||||||
async fn is_image_content_type(client: &ClientWithMiddleware, url: &Url) -> LemmyResult<()> {
|
async fn is_image_content_type(client: &ClientWithMiddleware, url: &Url) -> LemmyResult<()> {
|
||||||
let response = client.get(url.as_str()).send().await?;
|
let response = client.get(url.as_str()).send().await?;
|
||||||
if response
|
if response
|
||||||
|
|
|
@ -86,7 +86,6 @@ use webmention::{Webmention, WebmentionError};
|
||||||
|
|
||||||
pub const AUTH_COOKIE_NAME: &str = "jwt";
|
pub const AUTH_COOKIE_NAME: &str = "jwt";
|
||||||
|
|
||||||
#[tracing::instrument(skip_all)]
|
|
||||||
pub async fn is_mod_or_admin(
|
pub async fn is_mod_or_admin(
|
||||||
pool: &mut DbPool<'_>,
|
pool: &mut DbPool<'_>,
|
||||||
person: &Person,
|
person: &Person,
|
||||||
|
@ -96,7 +95,6 @@ pub async fn is_mod_or_admin(
|
||||||
CommunityView::check_is_mod_or_admin(pool, person.id, community_id).await
|
CommunityView::check_is_mod_or_admin(pool, person.id, community_id).await
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracing::instrument(skip_all)]
|
|
||||||
pub async fn is_mod_or_admin_opt(
|
pub async fn is_mod_or_admin_opt(
|
||||||
pool: &mut DbPool<'_>,
|
pool: &mut DbPool<'_>,
|
||||||
local_user_view: Option<&LocalUserView>,
|
local_user_view: Option<&LocalUserView>,
|
||||||
|
@ -116,7 +114,6 @@ pub async fn is_mod_or_admin_opt(
|
||||||
/// Check that a person is either a mod of any community, or an admin
|
/// Check that a person is either a mod of any community, or an admin
|
||||||
///
|
///
|
||||||
/// Should only be used for read operations
|
/// Should only be used for read operations
|
||||||
#[tracing::instrument(skip_all)]
|
|
||||||
pub async fn check_community_mod_of_any_or_admin_action(
|
pub async fn check_community_mod_of_any_or_admin_action(
|
||||||
local_user_view: &LocalUserView,
|
local_user_view: &LocalUserView,
|
||||||
pool: &mut DbPool<'_>,
|
pool: &mut DbPool<'_>,
|
||||||
|
@ -154,7 +151,6 @@ pub fn is_top_mod(
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Updates the read comment count for a post. Usually done when reading or creating a new comment.
|
/// Updates the read comment count for a post. Usually done when reading or creating a new comment.
|
||||||
#[tracing::instrument(skip_all)]
|
|
||||||
pub async fn update_read_comments(
|
pub async fn update_read_comments(
|
||||||
person_id: PersonId,
|
person_id: PersonId,
|
||||||
post_id: PostId,
|
post_id: PostId,
|
||||||
|
@ -285,7 +281,6 @@ pub fn check_comment_deleted_or_removed(comment: &Comment) -> LemmyResult<()> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracing::instrument(skip_all)]
|
|
||||||
pub async fn check_person_instance_community_block(
|
pub async fn check_person_instance_community_block(
|
||||||
my_id: PersonId,
|
my_id: PersonId,
|
||||||
potential_blocker_id: PersonId,
|
potential_blocker_id: PersonId,
|
||||||
|
@ -299,7 +294,6 @@ pub async fn check_person_instance_community_block(
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracing::instrument(skip_all)]
|
|
||||||
pub async fn check_local_vote_mode(
|
pub async fn check_local_vote_mode(
|
||||||
score: i16,
|
score: i16,
|
||||||
post_or_comment_id: PostOrCommentId,
|
post_or_comment_id: PostOrCommentId,
|
||||||
|
@ -328,7 +322,6 @@ pub async fn check_local_vote_mode(
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Dont allow bots to do certain actions, like voting
|
/// Dont allow bots to do certain actions, like voting
|
||||||
#[tracing::instrument(skip_all)]
|
|
||||||
pub fn check_bot_account(person: &Person) -> LemmyResult<()> {
|
pub fn check_bot_account(person: &Person) -> LemmyResult<()> {
|
||||||
if person.bot_account {
|
if person.bot_account {
|
||||||
Err(LemmyErrorType::InvalidBotAction)?
|
Err(LemmyErrorType::InvalidBotAction)?
|
||||||
|
@ -337,7 +330,6 @@ pub fn check_bot_account(person: &Person) -> LemmyResult<()> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracing::instrument(skip_all)]
|
|
||||||
pub fn check_private_instance(
|
pub fn check_private_instance(
|
||||||
local_user_view: &Option<LocalUserView>,
|
local_user_view: &Option<LocalUserView>,
|
||||||
local_site: &LocalSite,
|
local_site: &LocalSite,
|
||||||
|
@ -350,7 +342,6 @@ pub fn check_private_instance(
|
||||||
}
|
}
|
||||||
|
|
||||||
/// If private messages are disabled, dont allow them to be sent / received
|
/// If private messages are disabled, dont allow them to be sent / received
|
||||||
#[tracing::instrument(skip_all)]
|
|
||||||
pub fn check_private_messages_enabled(local_user_view: &LocalUserView) -> Result<(), LemmyError> {
|
pub fn check_private_messages_enabled(local_user_view: &LocalUserView) -> Result<(), LemmyError> {
|
||||||
if !local_user_view.local_user.enable_private_messages {
|
if !local_user_view.local_user.enable_private_messages {
|
||||||
Err(LemmyErrorType::CouldntCreatePrivateMessage)?
|
Err(LemmyErrorType::CouldntCreatePrivateMessage)?
|
||||||
|
@ -359,7 +350,6 @@ pub fn check_private_messages_enabled(local_user_view: &LocalUserView) -> Result
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracing::instrument(skip_all)]
|
|
||||||
pub async fn build_federated_instances(
|
pub async fn build_federated_instances(
|
||||||
local_site: &LocalSite,
|
local_site: &LocalSite,
|
||||||
pool: &mut DbPool<'_>,
|
pool: &mut DbPool<'_>,
|
||||||
|
@ -1037,7 +1027,6 @@ fn limit_expire_time(expires: DateTime<Utc>) -> LemmyResult<Option<DateTime<Utc>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracing::instrument(skip_all)]
|
|
||||||
pub fn check_conflicting_like_filters(
|
pub fn check_conflicting_like_filters(
|
||||||
liked_only: Option<bool>,
|
liked_only: Option<bool>,
|
||||||
disliked_only: Option<bool>,
|
disliked_only: Option<bool>,
|
||||||
|
@ -1153,7 +1142,6 @@ fn build_proxied_image_url(
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracing::instrument(skip_all)]
|
|
||||||
pub async fn local_user_view_from_jwt(
|
pub async fn local_user_view_from_jwt(
|
||||||
jwt: &str,
|
jwt: &str,
|
||||||
context: &LemmyContext,
|
context: &LemmyContext,
|
||||||
|
|
|
@ -20,7 +20,6 @@ lemmy_api_common = { workspace = true, features = ["full"] }
|
||||||
activitypub_federation = { workspace = true }
|
activitypub_federation = { workspace = true }
|
||||||
bcrypt = { workspace = true }
|
bcrypt = { workspace = true }
|
||||||
actix-web = { workspace = true }
|
actix-web = { workspace = true }
|
||||||
tracing = { workspace = true }
|
|
||||||
url = { workspace = true }
|
url = { workspace = true }
|
||||||
futures.workspace = true
|
futures.workspace = true
|
||||||
uuid = { workspace = true }
|
uuid = { workspace = true }
|
||||||
|
|
|
@ -33,7 +33,6 @@ use lemmy_utils::{
|
||||||
MAX_COMMENT_DEPTH_LIMIT,
|
MAX_COMMENT_DEPTH_LIMIT,
|
||||||
};
|
};
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn create_comment(
|
pub async fn create_comment(
|
||||||
data: Json<CreateComment>,
|
data: Json<CreateComment>,
|
||||||
context: Data<LemmyContext>,
|
context: Data<LemmyContext>,
|
||||||
|
|
|
@ -15,7 +15,6 @@ use lemmy_db_schema::{
|
||||||
use lemmy_db_views::structs::{CommentView, LocalUserView};
|
use lemmy_db_views::structs::{CommentView, LocalUserView};
|
||||||
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
|
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn delete_comment(
|
pub async fn delete_comment(
|
||||||
data: Json<DeleteComment>,
|
data: Json<DeleteComment>,
|
||||||
context: Data<LemmyContext>,
|
context: Data<LemmyContext>,
|
||||||
|
|
|
@ -9,7 +9,6 @@ use lemmy_db_schema::source::local_site::LocalSite;
|
||||||
use lemmy_db_views::structs::LocalUserView;
|
use lemmy_db_views::structs::LocalUserView;
|
||||||
use lemmy_utils::error::LemmyResult;
|
use lemmy_utils::error::LemmyResult;
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn get_comment(
|
pub async fn get_comment(
|
||||||
data: Query<GetComment>,
|
data: Query<GetComment>,
|
||||||
context: Data<LemmyContext>,
|
context: Data<LemmyContext>,
|
||||||
|
|
|
@ -20,7 +20,6 @@ use lemmy_db_schema::{
|
||||||
use lemmy_db_views::structs::{CommentView, LocalUserView};
|
use lemmy_db_views::structs::{CommentView, LocalUserView};
|
||||||
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
|
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn remove_comment(
|
pub async fn remove_comment(
|
||||||
data: Json<RemoveComment>,
|
data: Json<RemoveComment>,
|
||||||
context: Data<LemmyContext>,
|
context: Data<LemmyContext>,
|
||||||
|
|
|
@ -28,7 +28,6 @@ use lemmy_utils::{
|
||||||
utils::{mention::scrape_text_for_mentions, validation::is_valid_body_field},
|
utils::{mention::scrape_text_for_mentions, validation::is_valid_body_field},
|
||||||
};
|
};
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn update_comment(
|
pub async fn update_comment(
|
||||||
data: Json<EditComment>,
|
data: Json<EditComment>,
|
||||||
context: Data<LemmyContext>,
|
context: Data<LemmyContext>,
|
||||||
|
|
|
@ -44,7 +44,6 @@ use lemmy_utils::{
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn create_community(
|
pub async fn create_community(
|
||||||
data: Json<CreateCommunity>,
|
data: Json<CreateCommunity>,
|
||||||
context: Data<LemmyContext>,
|
context: Data<LemmyContext>,
|
||||||
|
|
|
@ -14,7 +14,6 @@ use lemmy_db_schema::{
|
||||||
use lemmy_db_views::structs::{CommunityModeratorView, LocalUserView};
|
use lemmy_db_views::structs::{CommunityModeratorView, LocalUserView};
|
||||||
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
|
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn delete_community(
|
pub async fn delete_community(
|
||||||
data: Json<DeleteCommunity>,
|
data: Json<DeleteCommunity>,
|
||||||
context: Data<LemmyContext>,
|
context: Data<LemmyContext>,
|
||||||
|
|
|
@ -10,7 +10,6 @@ use lemmy_db_views::{
|
||||||
};
|
};
|
||||||
use lemmy_utils::error::LemmyResult;
|
use lemmy_utils::error::LemmyResult;
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn list_communities(
|
pub async fn list_communities(
|
||||||
data: Query<ListCommunities>,
|
data: Query<ListCommunities>,
|
||||||
context: Data<LemmyContext>,
|
context: Data<LemmyContext>,
|
||||||
|
|
|
@ -17,7 +17,6 @@ use lemmy_db_schema::{
|
||||||
use lemmy_db_views::structs::LocalUserView;
|
use lemmy_db_views::structs::LocalUserView;
|
||||||
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
|
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn remove_community(
|
pub async fn remove_community(
|
||||||
data: Json<RemoveCommunity>,
|
data: Json<RemoveCommunity>,
|
||||||
context: Data<LemmyContext>,
|
context: Data<LemmyContext>,
|
||||||
|
|
|
@ -29,7 +29,6 @@ use lemmy_utils::{
|
||||||
utils::{slurs::check_slurs_opt, validation::is_valid_body_field},
|
utils::{slurs::check_slurs_opt, validation::is_valid_body_field},
|
||||||
};
|
};
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn update_community(
|
pub async fn update_community(
|
||||||
data: Json<EditCommunity>,
|
data: Json<EditCommunity>,
|
||||||
context: Data<LemmyContext>,
|
context: Data<LemmyContext>,
|
||||||
|
|
|
@ -15,7 +15,6 @@ use lemmy_db_schema::{
|
||||||
use lemmy_db_views::structs::{CustomEmojiView, LocalUserView};
|
use lemmy_db_views::structs::{CustomEmojiView, LocalUserView};
|
||||||
use lemmy_utils::error::LemmyResult;
|
use lemmy_utils::error::LemmyResult;
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn create_custom_emoji(
|
pub async fn create_custom_emoji(
|
||||||
data: Json<CreateCustomEmoji>,
|
data: Json<CreateCustomEmoji>,
|
||||||
context: Data<LemmyContext>,
|
context: Data<LemmyContext>,
|
||||||
|
|
|
@ -10,7 +10,6 @@ use lemmy_db_schema::{source::custom_emoji::CustomEmoji, traits::Crud};
|
||||||
use lemmy_db_views::structs::LocalUserView;
|
use lemmy_db_views::structs::LocalUserView;
|
||||||
use lemmy_utils::error::LemmyResult;
|
use lemmy_utils::error::LemmyResult;
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn delete_custom_emoji(
|
pub async fn delete_custom_emoji(
|
||||||
data: Json<DeleteCustomEmoji>,
|
data: Json<DeleteCustomEmoji>,
|
||||||
context: Data<LemmyContext>,
|
context: Data<LemmyContext>,
|
||||||
|
|
|
@ -3,13 +3,11 @@ use lemmy_api_common::{
|
||||||
context::LemmyContext,
|
context::LemmyContext,
|
||||||
custom_emoji::{ListCustomEmojis, ListCustomEmojisResponse},
|
custom_emoji::{ListCustomEmojis, ListCustomEmojisResponse},
|
||||||
};
|
};
|
||||||
use lemmy_db_views::structs::{CustomEmojiView, LocalUserView};
|
use lemmy_db_views::structs::CustomEmojiView;
|
||||||
use lemmy_utils::error::LemmyError;
|
use lemmy_utils::error::LemmyError;
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn list_custom_emojis(
|
pub async fn list_custom_emojis(
|
||||||
data: Query<ListCustomEmojis>,
|
data: Query<ListCustomEmojis>,
|
||||||
local_user_view: Option<LocalUserView>,
|
|
||||||
context: Data<LemmyContext>,
|
context: Data<LemmyContext>,
|
||||||
) -> Result<Json<ListCustomEmojisResponse>, LemmyError> {
|
) -> Result<Json<ListCustomEmojisResponse>, LemmyError> {
|
||||||
let custom_emojis = CustomEmojiView::list(
|
let custom_emojis = CustomEmojiView::list(
|
||||||
|
|
|
@ -15,7 +15,6 @@ use lemmy_db_schema::{
|
||||||
use lemmy_db_views::structs::{CustomEmojiView, LocalUserView};
|
use lemmy_db_views::structs::{CustomEmojiView, LocalUserView};
|
||||||
use lemmy_utils::error::LemmyResult;
|
use lemmy_utils::error::LemmyResult;
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn update_custom_emoji(
|
pub async fn update_custom_emoji(
|
||||||
data: Json<EditCustomEmoji>,
|
data: Json<EditCustomEmoji>,
|
||||||
context: Data<LemmyContext>,
|
context: Data<LemmyContext>,
|
||||||
|
|
|
@ -13,7 +13,6 @@ use lemmy_db_views::structs::LocalUserView;
|
||||||
use lemmy_utils::error::LemmyError;
|
use lemmy_utils::error::LemmyError;
|
||||||
use url::Url;
|
use url::Url;
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn create_oauth_provider(
|
pub async fn create_oauth_provider(
|
||||||
data: Json<CreateOAuthProvider>,
|
data: Json<CreateOAuthProvider>,
|
||||||
context: Data<LemmyContext>,
|
context: Data<LemmyContext>,
|
||||||
|
|
|
@ -10,7 +10,6 @@ use lemmy_db_schema::{source::oauth_provider::OAuthProvider, traits::Crud};
|
||||||
use lemmy_db_views::structs::LocalUserView;
|
use lemmy_db_views::structs::LocalUserView;
|
||||||
use lemmy_utils::error::{LemmyError, LemmyErrorExt, LemmyErrorType};
|
use lemmy_utils::error::{LemmyError, LemmyErrorExt, LemmyErrorType};
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn delete_oauth_provider(
|
pub async fn delete_oauth_provider(
|
||||||
data: Json<DeleteOAuthProvider>,
|
data: Json<DeleteOAuthProvider>,
|
||||||
context: Data<LemmyContext>,
|
context: Data<LemmyContext>,
|
||||||
|
|
|
@ -10,7 +10,6 @@ use lemmy_db_schema::{
|
||||||
use lemmy_db_views::structs::LocalUserView;
|
use lemmy_db_views::structs::LocalUserView;
|
||||||
use lemmy_utils::error::LemmyError;
|
use lemmy_utils::error::LemmyError;
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn update_oauth_provider(
|
pub async fn update_oauth_provider(
|
||||||
data: Json<EditOAuthProvider>,
|
data: Json<EditOAuthProvider>,
|
||||||
context: Data<LemmyContext>,
|
context: Data<LemmyContext>,
|
||||||
|
|
|
@ -43,7 +43,6 @@ use lemmy_utils::{
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn create_post(
|
pub async fn create_post(
|
||||||
data: Json<CreatePost>,
|
data: Json<CreatePost>,
|
||||||
context: Data<LemmyContext>,
|
context: Data<LemmyContext>,
|
||||||
|
|
|
@ -17,7 +17,6 @@ use lemmy_db_schema::{
|
||||||
use lemmy_db_views::structs::LocalUserView;
|
use lemmy_db_views::structs::LocalUserView;
|
||||||
use lemmy_utils::error::{LemmyErrorType, LemmyResult};
|
use lemmy_utils::error::{LemmyErrorType, LemmyResult};
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn delete_post(
|
pub async fn delete_post(
|
||||||
data: Json<DeletePost>,
|
data: Json<DeletePost>,
|
||||||
context: Data<LemmyContext>,
|
context: Data<LemmyContext>,
|
||||||
|
|
|
@ -17,7 +17,6 @@ use lemmy_db_views::{
|
||||||
};
|
};
|
||||||
use lemmy_utils::error::{LemmyErrorType, LemmyResult};
|
use lemmy_utils::error::{LemmyErrorType, LemmyResult};
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn get_post(
|
pub async fn get_post(
|
||||||
data: Query<GetPost>,
|
data: Query<GetPost>,
|
||||||
context: Data<LemmyContext>,
|
context: Data<LemmyContext>,
|
||||||
|
|
|
@ -20,7 +20,6 @@ use lemmy_db_schema::{
|
||||||
use lemmy_db_views::structs::LocalUserView;
|
use lemmy_db_views::structs::LocalUserView;
|
||||||
use lemmy_utils::error::LemmyResult;
|
use lemmy_utils::error::LemmyResult;
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn remove_post(
|
pub async fn remove_post(
|
||||||
data: Json<RemovePost>,
|
data: Json<RemovePost>,
|
||||||
context: Data<LemmyContext>,
|
context: Data<LemmyContext>,
|
||||||
|
|
|
@ -44,7 +44,6 @@ use lemmy_utils::{
|
||||||
};
|
};
|
||||||
use std::ops::Deref;
|
use std::ops::Deref;
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn update_post(
|
pub async fn update_post(
|
||||||
data: Json<EditPost>,
|
data: Json<EditPost>,
|
||||||
context: Data<LemmyContext>,
|
context: Data<LemmyContext>,
|
||||||
|
|
|
@ -27,7 +27,6 @@ use lemmy_utils::{
|
||||||
utils::{markdown::markdown_to_html, validation::is_valid_body_field},
|
utils::{markdown::markdown_to_html, validation::is_valid_body_field},
|
||||||
};
|
};
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn create_private_message(
|
pub async fn create_private_message(
|
||||||
data: Json<CreatePrivateMessage>,
|
data: Json<CreatePrivateMessage>,
|
||||||
context: Data<LemmyContext>,
|
context: Data<LemmyContext>,
|
||||||
|
|
|
@ -12,7 +12,6 @@ use lemmy_db_schema::{
|
||||||
use lemmy_db_views::structs::{LocalUserView, PrivateMessageView};
|
use lemmy_db_views::structs::{LocalUserView, PrivateMessageView};
|
||||||
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
|
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn delete_private_message(
|
pub async fn delete_private_message(
|
||||||
data: Json<DeletePrivateMessage>,
|
data: Json<DeletePrivateMessage>,
|
||||||
context: Data<LemmyContext>,
|
context: Data<LemmyContext>,
|
||||||
|
|
|
@ -20,7 +20,6 @@ use lemmy_utils::{
|
||||||
utils::validation::is_valid_body_field,
|
utils::validation::is_valid_body_field,
|
||||||
};
|
};
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn update_private_message(
|
pub async fn update_private_message(
|
||||||
data: Json<EditPrivateMessage>,
|
data: Json<EditPrivateMessage>,
|
||||||
context: Data<LemmyContext>,
|
context: Data<LemmyContext>,
|
||||||
|
|
|
@ -41,7 +41,6 @@ use lemmy_utils::{
|
||||||
};
|
};
|
||||||
use url::Url;
|
use url::Url;
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn create_site(
|
pub async fn create_site(
|
||||||
data: Json<CreateSite>,
|
data: Json<CreateSite>,
|
||||||
context: Data<LemmyContext>,
|
context: Data<LemmyContext>,
|
||||||
|
|
|
@ -12,7 +12,6 @@ use lemmy_db_views::structs::{LocalUserView, PersonView, SiteView};
|
||||||
use lemmy_utils::{build_cache, error::LemmyResult, CacheLock, VERSION};
|
use lemmy_utils::{build_cache, error::LemmyResult, CacheLock, VERSION};
|
||||||
use std::sync::LazyLock;
|
use std::sync::LazyLock;
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn get_site_v3(
|
pub async fn get_site_v3(
|
||||||
local_user_view: Option<LocalUserView>,
|
local_user_view: Option<LocalUserView>,
|
||||||
context: Data<LemmyContext>,
|
context: Data<LemmyContext>,
|
||||||
|
@ -24,7 +23,6 @@ pub async fn get_site_v3(
|
||||||
Ok(site)
|
Ok(site)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn get_site_v4(
|
pub async fn get_site_v4(
|
||||||
local_user_view: Option<LocalUserView>,
|
local_user_view: Option<LocalUserView>,
|
||||||
context: Data<LemmyContext>,
|
context: Data<LemmyContext>,
|
||||||
|
|
|
@ -43,7 +43,6 @@ use lemmy_utils::{
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn update_site(
|
pub async fn update_site(
|
||||||
data: Json<EditSite>,
|
data: Json<EditSite>,
|
||||||
context: Data<LemmyContext>,
|
context: Data<LemmyContext>,
|
||||||
|
|
|
@ -15,7 +15,6 @@ use lemmy_db_schema::{
|
||||||
use lemmy_db_views::structs::LocalUserView;
|
use lemmy_db_views::structs::LocalUserView;
|
||||||
use lemmy_utils::error::LemmyError;
|
use lemmy_utils::error::LemmyError;
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn create_tagline(
|
pub async fn create_tagline(
|
||||||
data: Json<CreateTagline>,
|
data: Json<CreateTagline>,
|
||||||
context: Data<LemmyContext>,
|
context: Data<LemmyContext>,
|
||||||
|
|
|
@ -10,7 +10,6 @@ use lemmy_db_schema::{source::tagline::Tagline, traits::Crud};
|
||||||
use lemmy_db_views::structs::LocalUserView;
|
use lemmy_db_views::structs::LocalUserView;
|
||||||
use lemmy_utils::error::LemmyError;
|
use lemmy_utils::error::LemmyError;
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn delete_tagline(
|
pub async fn delete_tagline(
|
||||||
data: Json<DeleteTagline>,
|
data: Json<DeleteTagline>,
|
||||||
context: Data<LemmyContext>,
|
context: Data<LemmyContext>,
|
||||||
|
|
|
@ -4,13 +4,10 @@ use lemmy_api_common::{
|
||||||
tagline::{ListTaglines, ListTaglinesResponse},
|
tagline::{ListTaglines, ListTaglinesResponse},
|
||||||
};
|
};
|
||||||
use lemmy_db_schema::source::tagline::Tagline;
|
use lemmy_db_schema::source::tagline::Tagline;
|
||||||
use lemmy_db_views::structs::LocalUserView;
|
|
||||||
use lemmy_utils::error::LemmyError;
|
use lemmy_utils::error::LemmyError;
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn list_taglines(
|
pub async fn list_taglines(
|
||||||
data: Query<ListTaglines>,
|
data: Query<ListTaglines>,
|
||||||
local_user_view: Option<LocalUserView>,
|
|
||||||
context: Data<LemmyContext>,
|
context: Data<LemmyContext>,
|
||||||
) -> Result<Json<ListTaglinesResponse>, LemmyError> {
|
) -> Result<Json<ListTaglinesResponse>, LemmyError> {
|
||||||
let taglines = Tagline::list(&mut context.pool(), data.page, data.limit).await?;
|
let taglines = Tagline::list(&mut context.pool(), data.page, data.limit).await?;
|
||||||
|
|
|
@ -16,7 +16,6 @@ use lemmy_db_schema::{
|
||||||
use lemmy_db_views::structs::LocalUserView;
|
use lemmy_db_views::structs::LocalUserView;
|
||||||
use lemmy_utils::error::LemmyError;
|
use lemmy_utils::error::LemmyError;
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
|
||||||
pub async fn update_tagline(
|
pub async fn update_tagline(
|
||||||
data: Json<UpdateTagline>,
|
data: Json<UpdateTagline>,
|
||||||
context: Data<LemmyContext>,
|
context: Data<LemmyContext>,
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue