Use skip_all for more instrument attributes, don't skip 'self' in some api actions

This commit is contained in:
Aode (lion) 2021-11-25 12:37:31 -06:00
parent b176b71d09
commit d8310a151f
72 changed files with 310 additions and 311 deletions

View file

@ -32,7 +32,7 @@ use crate::Perform;
impl Perform for MarkCommentAsRead {
type Response = CommentResponse;
#[tracing::instrument(skip(self, context, _websocket_id))]
#[tracing::instrument(skip(context, _websocket_id))]
async fn perform(
&self,
context: &Data<LemmyContext>,
@ -91,7 +91,7 @@ impl Perform for MarkCommentAsRead {
impl Perform for SaveComment {
type Response = CommentResponse;
#[tracing::instrument(skip(self, context, _websocket_id))]
#[tracing::instrument(skip(context, _websocket_id))]
async fn perform(
&self,
context: &Data<LemmyContext>,
@ -139,7 +139,7 @@ impl Perform for SaveComment {
impl Perform for CreateCommentLike {
type Response = CommentResponse;
#[tracing::instrument(skip(self, context, websocket_id))]
#[tracing::instrument(skip(context, websocket_id))]
async fn perform(
&self,
context: &Data<LemmyContext>,

View file

@ -22,7 +22,7 @@ use lemmy_websocket::{messages::SendModRoomMessage, LemmyContext, UserOperation}
impl Perform for CreateCommentReport {
type Response = CommentReportResponse;
#[tracing::instrument(skip(self, context, websocket_id))]
#[tracing::instrument(skip(context, websocket_id))]
async fn perform(
&self,
context: &Data<LemmyContext>,
@ -98,7 +98,7 @@ impl Perform for CreateCommentReport {
impl Perform for ResolveCommentReport {
type Response = CommentReportResponse;
#[tracing::instrument(skip(self, context, websocket_id))]
#[tracing::instrument(skip(context, websocket_id))]
async fn perform(
&self,
context: &Data<LemmyContext>,
@ -159,7 +159,7 @@ impl Perform for ResolveCommentReport {
impl Perform for ListCommentReports {
type Response = ListCommentReportsResponse;
#[tracing::instrument(skip(self, context, _websocket_id))]
#[tracing::instrument(skip(context, _websocket_id))]
async fn perform(
&self,
context: &Data<LemmyContext>,

View file

@ -61,7 +61,7 @@ use lemmy_websocket::{messages::SendCommunityRoomMessage, LemmyContext, UserOper
impl Perform for FollowCommunity {
type Response = CommunityResponse;
#[tracing::instrument(skip(self, context, _websocket_id))]
#[tracing::instrument(skip(context, _websocket_id))]
async fn perform(
&self,
context: &Data<LemmyContext>,
@ -138,7 +138,7 @@ impl Perform for FollowCommunity {
impl Perform for BlockCommunity {
type Response = BlockCommunityResponse;
#[tracing::instrument(skip(self, context, _websocket_id))]
#[tracing::instrument(skip(context, _websocket_id))]
async fn perform(
&self,
context: &Data<LemmyContext>,
@ -202,7 +202,7 @@ impl Perform for BlockCommunity {
impl Perform for BanFromCommunity {
type Response = BanFromCommunityResponse;
#[tracing::instrument(skip(self, context, websocket_id))]
#[tracing::instrument(skip(context, websocket_id))]
async fn perform(
&self,
context: &Data<LemmyContext>,
@ -346,7 +346,7 @@ impl Perform for BanFromCommunity {
impl Perform for AddModToCommunity {
type Response = AddModToCommunityResponse;
#[tracing::instrument(skip(self, context, websocket_id))]
#[tracing::instrument(skip(context, websocket_id))]
async fn perform(
&self,
context: &Data<LemmyContext>,
@ -447,7 +447,7 @@ impl Perform for AddModToCommunity {
impl Perform for TransferCommunity {
type Response = GetCommunityResponse;
#[tracing::instrument(skip(self, context, _websocket_id))]
#[tracing::instrument(skip(context, _websocket_id))]
async fn perform(
&self,
context: &Data<LemmyContext>,

View file

@ -62,7 +62,7 @@ use lemmy_websocket::{
impl Perform for Login {
type Response = LoginResponse;
#[tracing::instrument(skip(self, context, _websocket_id))]
#[tracing::instrument(skip(context, _websocket_id))]
async fn perform(
&self,
context: &Data<LemmyContext>,
@ -104,7 +104,7 @@ impl Perform for Login {
impl Perform for GetCaptcha {
type Response = GetCaptchaResponse;
#[tracing::instrument(skip(self, context, _websocket_id))]
#[tracing::instrument(skip(context, _websocket_id))]
async fn perform(
&self,
context: &Data<LemmyContext>,
@ -150,7 +150,7 @@ impl Perform for GetCaptcha {
impl Perform for SaveUserSettings {
type Response = LoginResponse;
#[tracing::instrument(skip(self, context, _websocket_id))]
#[tracing::instrument(skip(context, _websocket_id))]
async fn perform(
&self,
context: &Data<LemmyContext>,
@ -325,7 +325,7 @@ impl Perform for ChangePassword {
impl Perform for AddAdmin {
type Response = AddAdminResponse;
#[tracing::instrument(skip(self, context, websocket_id))]
#[tracing::instrument(skip(context, websocket_id))]
async fn perform(
&self,
context: &Data<LemmyContext>,
@ -385,7 +385,7 @@ impl Perform for AddAdmin {
impl Perform for BanPerson {
type Response = BanPersonResponse;
#[tracing::instrument(skip(self, context, websocket_id))]
#[tracing::instrument(skip(context, websocket_id))]
async fn perform(
&self,
context: &Data<LemmyContext>,
@ -480,7 +480,7 @@ impl Perform for BanPerson {
impl Perform for BlockPerson {
type Response = BlockPersonResponse;
#[tracing::instrument(skip(self, context, _websocket_id))]
#[tracing::instrument(skip(context, _websocket_id))]
async fn perform(
&self,
context: &Data<LemmyContext>,
@ -537,7 +537,7 @@ impl Perform for BlockPerson {
impl Perform for GetReplies {
type Response = GetRepliesResponse;
#[tracing::instrument(skip(self, context, _websocket_id))]
#[tracing::instrument(skip(context, _websocket_id))]
async fn perform(
&self,
context: &Data<LemmyContext>,
@ -576,7 +576,7 @@ impl Perform for GetReplies {
impl Perform for GetPersonMentions {
type Response = GetPersonMentionsResponse;
#[tracing::instrument(skip(self, context, _websocket_id))]
#[tracing::instrument(skip(context, _websocket_id))]
async fn perform(
&self,
context: &Data<LemmyContext>,
@ -612,7 +612,7 @@ impl Perform for GetPersonMentions {
impl Perform for MarkPersonMentionAsRead {
type Response = PersonMentionResponse;
#[tracing::instrument(skip(self, context, _websocket_id))]
#[tracing::instrument(skip(context, _websocket_id))]
async fn perform(
&self,
context: &Data<LemmyContext>,
@ -658,7 +658,7 @@ impl Perform for MarkPersonMentionAsRead {
impl Perform for MarkAllAsRead {
type Response = GetRepliesResponse;
#[tracing::instrument(skip(self, context, _websocket_id))]
#[tracing::instrument(skip(context, _websocket_id))]
async fn perform(
&self,
context: &Data<LemmyContext>,
@ -813,7 +813,7 @@ impl Perform for PasswordChange {
impl Perform for GetReportCount {
type Response = GetReportCountResponse;
#[tracing::instrument(skip(self, context, _websocket_id))]
#[tracing::instrument(skip(context, _websocket_id))]
async fn perform(
&self,
context: &Data<LemmyContext>,
@ -851,7 +851,7 @@ impl Perform for GetReportCount {
impl Perform for GetUnreadCount {
type Response = GetUnreadCountResponse;
#[tracing::instrument(skip(self, context, _websocket_id))]
#[tracing::instrument(skip(context, _websocket_id))]
async fn perform(
&self,
context: &Data<LemmyContext>,

View file

@ -37,7 +37,7 @@ use std::convert::TryInto;
impl Perform for CreatePostLike {
type Response = PostResponse;
#[tracing::instrument(skip(self, context, websocket_id))]
#[tracing::instrument(skip(context, websocket_id))]
async fn perform(
&self,
context: &Data<LemmyContext>,
@ -125,7 +125,7 @@ impl Perform for CreatePostLike {
impl Perform for MarkPostAsRead {
type Response = PostResponse;
#[tracing::instrument(skip(self, context, _websocket_id))]
#[tracing::instrument(skip(context, _websocket_id))]
async fn perform(
&self,
context: &Data<LemmyContext>,
@ -161,7 +161,7 @@ impl Perform for MarkPostAsRead {
impl Perform for LockPost {
type Response = PostResponse;
#[tracing::instrument(skip(self, context, websocket_id))]
#[tracing::instrument(skip(context, websocket_id))]
async fn perform(
&self,
context: &Data<LemmyContext>,
@ -231,7 +231,7 @@ impl Perform for LockPost {
impl Perform for StickyPost {
type Response = PostResponse;
#[tracing::instrument(skip(self, context, websocket_id))]
#[tracing::instrument(skip(context, websocket_id))]
async fn perform(
&self,
context: &Data<LemmyContext>,
@ -305,7 +305,7 @@ impl Perform for StickyPost {
impl Perform for SavePost {
type Response = PostResponse;
#[tracing::instrument(skip(self, context, _websocket_id))]
#[tracing::instrument(skip(context, _websocket_id))]
async fn perform(
&self,
context: &Data<LemmyContext>,
@ -352,7 +352,7 @@ impl Perform for SavePost {
impl Perform for GetSiteMetadata {
type Response = GetSiteMetadataResponse;
#[tracing::instrument(skip(self, context, _websocket_id))]
#[tracing::instrument(skip(context, _websocket_id))]
async fn perform(
&self,
context: &Data<LemmyContext>,

View file

@ -31,7 +31,7 @@ use lemmy_websocket::{messages::SendModRoomMessage, LemmyContext, UserOperation}
impl Perform for CreatePostReport {
type Response = PostReportResponse;
#[tracing::instrument(skip(self, context, websocket_id))]
#[tracing::instrument(skip(context, websocket_id))]
async fn perform(
&self,
context: &Data<LemmyContext>,
@ -107,7 +107,7 @@ impl Perform for CreatePostReport {
impl Perform for ResolvePostReport {
type Response = PostReportResponse;
#[tracing::instrument(skip(self, context, websocket_id))]
#[tracing::instrument(skip(context, websocket_id))]
async fn perform(
&self,
context: &Data<LemmyContext>,
@ -165,7 +165,7 @@ impl Perform for ResolvePostReport {
impl Perform for ListPostReports {
type Response = ListPostReportsResponse;
#[tracing::instrument(skip(self, context, _websocket_id))]
#[tracing::instrument(skip(context, _websocket_id))]
async fn perform(
&self,
context: &Data<LemmyContext>,

View file

@ -13,7 +13,7 @@ use lemmy_websocket::{send::send_pm_ws_message, LemmyContext, UserOperation};
impl Perform for MarkPrivateMessageAsRead {
type Response = PrivateMessageResponse;
#[tracing::instrument(skip(self, context, websocket_id))]
#[tracing::instrument(skip(context, websocket_id))]
async fn perform(
&self,
context: &Data<LemmyContext>,

View file

@ -56,7 +56,7 @@ use lemmy_websocket::LemmyContext;
impl Perform for GetModlog {
type Response = GetModlogResponse;
#[tracing::instrument(skip(self, context, _websocket_id))]
#[tracing::instrument(skip(context, _websocket_id))]
async fn perform(
&self,
context: &Data<LemmyContext>,
@ -137,7 +137,7 @@ impl Perform for GetModlog {
impl Perform for Search {
type Response = SearchResponse;
#[tracing::instrument(skip(self, context, _websocket_id))]
#[tracing::instrument(skip(context, _websocket_id))]
async fn perform(
&self,
context: &Data<LemmyContext>,
@ -378,7 +378,7 @@ impl Perform for Search {
impl Perform for ResolveObject {
type Response = ResolveObjectResponse;
#[tracing::instrument(skip(self, context, _websocket_id))]
#[tracing::instrument(skip(context, _websocket_id))]
async fn perform(
&self,
context: &Data<LemmyContext>,
@ -440,7 +440,7 @@ async fn convert_response(
impl Perform for TransferSite {
type Response = GetSiteResponse;
#[tracing::instrument(skip(self, context, _websocket_id))]
#[tracing::instrument(skip(context, _websocket_id))]
async fn perform(
&self,
context: &Data<LemmyContext>,
@ -509,7 +509,7 @@ impl Perform for TransferSite {
impl Perform for GetSiteConfig {
type Response = GetSiteConfigResponse;
#[tracing::instrument(skip(self, context, _websocket_id))]
#[tracing::instrument(skip(context, _websocket_id))]
async fn perform(
&self,
context: &Data<LemmyContext>,
@ -532,7 +532,7 @@ impl Perform for GetSiteConfig {
impl Perform for SaveSiteConfig {
type Response = GetSiteConfigResponse;
#[tracing::instrument(skip(self, context, _websocket_id))]
#[tracing::instrument(skip(context, _websocket_id))]
async fn perform(
&self,
context: &Data<LemmyContext>,

View file

@ -11,7 +11,7 @@ use lemmy_websocket::{
impl Perform for UserJoin {
type Response = UserJoinResponse;
#[tracing::instrument(skip(self, context, websocket_id))]
#[tracing::instrument(skip(context, websocket_id))]
async fn perform(
&self,
context: &Data<LemmyContext>,
@ -36,7 +36,7 @@ impl Perform for UserJoin {
impl Perform for CommunityJoin {
type Response = CommunityJoinResponse;
#[tracing::instrument(skip(self, context, websocket_id))]
#[tracing::instrument(skip(context, websocket_id))]
async fn perform(
&self,
context: &Data<LemmyContext>,
@ -59,7 +59,7 @@ impl Perform for CommunityJoin {
impl Perform for ModJoin {
type Response = ModJoinResponse;
#[tracing::instrument(skip(self, context, websocket_id))]
#[tracing::instrument(skip(context, websocket_id))]
async fn perform(
&self,
context: &Data<LemmyContext>,
@ -82,7 +82,7 @@ impl Perform for ModJoin {
impl Perform for PostJoin {
type Response = PostJoinResponse;
#[tracing::instrument(skip(self, context, websocket_id))]
#[tracing::instrument(skip(context, websocket_id))]
async fn perform(
&self,
context: &Data<LemmyContext>,

View file

@ -2,7 +2,7 @@ use lemmy_db_schema::newtypes::{CommentId, CommentReportId, CommunityId, LocalUs
use lemmy_db_views::{comment_report_view::CommentReportView, comment_view::CommentView};
use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize)]
#[derive(Debug, Serialize, Deserialize)]
pub struct CreateComment {
pub content: String,
pub post_id: PostId,
@ -11,13 +11,13 @@ pub struct CreateComment {
pub auth: String,
}
#[derive(Serialize, Deserialize)]
#[derive(Debug, Serialize, Deserialize)]
pub struct GetComment {
pub id: CommentId,
pub auth: Option<String>,
}
#[derive(Serialize, Deserialize)]
#[derive(Debug, Serialize, Deserialize)]
pub struct EditComment {
pub content: String,
pub comment_id: CommentId,
@ -25,14 +25,14 @@ pub struct EditComment {
pub auth: String,
}
#[derive(Serialize, Deserialize)]
#[derive(Debug, Serialize, Deserialize)]
pub struct DeleteComment {
pub comment_id: CommentId,
pub deleted: bool,
pub auth: String,
}
#[derive(Serialize, Deserialize)]
#[derive(Debug, Serialize, Deserialize)]
pub struct RemoveComment {
pub comment_id: CommentId,
pub removed: bool,
@ -40,35 +40,35 @@ pub struct RemoveComment {
pub auth: String,
}
#[derive(Serialize, Deserialize)]
#[derive(Debug, Serialize, Deserialize)]
pub struct MarkCommentAsRead {
pub comment_id: CommentId,
pub read: bool,
pub auth: String,
}
#[derive(Serialize, Deserialize)]
#[derive(Debug, Serialize, Deserialize)]
pub struct SaveComment {
pub comment_id: CommentId,
pub save: bool,
pub auth: String,
}
#[derive(Serialize, Deserialize, Clone)]
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct CommentResponse {
pub comment_view: CommentView,
pub recipient_ids: Vec<LocalUserId>,
pub form_id: Option<String>, // An optional front end ID, to tell which is coming back
}
#[derive(Serialize, Deserialize)]
#[derive(Debug, Serialize, Deserialize)]
pub struct CreateCommentLike {
pub comment_id: CommentId,
pub score: i16,
pub auth: String,
}
#[derive(Serialize, Deserialize)]
#[derive(Debug, Serialize, Deserialize)]
pub struct GetComments {
pub type_: Option<String>,
pub sort: Option<String>,
@ -80,31 +80,31 @@ pub struct GetComments {
pub auth: Option<String>,
}
#[derive(Serialize, Deserialize)]
#[derive(Debug, Serialize, Deserialize)]
pub struct GetCommentsResponse {
pub comments: Vec<CommentView>,
}
#[derive(Serialize, Deserialize)]
#[derive(Debug, Serialize, Deserialize)]
pub struct CreateCommentReport {
pub comment_id: CommentId,
pub reason: String,
pub auth: String,
}
#[derive(Serialize, Deserialize, Clone)]
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct CommentReportResponse {
pub comment_report_view: CommentReportView,
}
#[derive(Serialize, Deserialize)]
#[derive(Debug, Serialize, Deserialize)]
pub struct ResolveCommentReport {
pub report_id: CommentReportId,
pub resolved: bool,
pub auth: String,
}
#[derive(Serialize, Deserialize)]
#[derive(Debug, Serialize, Deserialize)]
pub struct ListCommentReports {
pub page: Option<i64>,
pub limit: Option<i64>,
@ -115,7 +115,7 @@ pub struct ListCommentReports {
pub auth: String,
}
#[derive(Serialize, Deserialize)]
#[derive(Debug, Serialize, Deserialize)]
pub struct ListCommentReportsResponse {
pub comment_reports: Vec<CommentReportView>,
}

View file

@ -6,7 +6,7 @@ use lemmy_db_views_actor::{
};
use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize)]
#[derive(Debug, Serialize, Deserialize)]
pub struct GetCommunity {
pub id: Option<CommunityId>,
/// Example: star_trek , or star_trek@xyz.tld
@ -14,14 +14,14 @@ pub struct GetCommunity {
pub auth: Option<String>,
}
#[derive(Serialize, Deserialize)]
#[derive(Debug, Serialize, Deserialize)]
pub struct GetCommunityResponse {
pub community_view: CommunityView,
pub moderators: Vec<CommunityModeratorView>,
pub online: usize,
}
#[derive(Serialize, Deserialize)]
#[derive(Debug, Serialize, Deserialize)]
pub struct CreateCommunity {
pub name: String,
pub title: String,
@ -32,7 +32,7 @@ pub struct CreateCommunity {
pub auth: String,
}
#[derive(Serialize, Deserialize, Clone)]
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct CommunityResponse {
pub community_view: CommunityView,
}
@ -51,7 +51,7 @@ pub struct ListCommunitiesResponse {
pub communities: Vec<CommunityView>,
}
#[derive(Serialize, Deserialize, Clone)]
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct BanFromCommunity {
pub community_id: CommunityId,
pub person_id: PersonId,
@ -62,13 +62,13 @@ pub struct BanFromCommunity {
pub auth: String,
}
#[derive(Serialize, Deserialize, Clone)]
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct BanFromCommunityResponse {
pub person_view: PersonViewSafe,
pub banned: bool,
}
#[derive(Serialize, Deserialize)]
#[derive(Debug, Serialize, Deserialize)]
pub struct AddModToCommunity {
pub community_id: CommunityId,
pub person_id: PersonId,
@ -76,12 +76,12 @@ pub struct AddModToCommunity {
pub auth: String,
}
#[derive(Serialize, Deserialize, Clone)]
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct AddModToCommunityResponse {
pub moderators: Vec<CommunityModeratorView>,
}
#[derive(Serialize, Deserialize)]
#[derive(Debug, Serialize, Deserialize)]
pub struct EditCommunity {
pub community_id: CommunityId,
pub title: Option<String>,
@ -92,14 +92,14 @@ pub struct EditCommunity {
pub auth: String,
}
#[derive(Serialize, Deserialize)]
#[derive(Debug, Serialize, Deserialize)]
pub struct DeleteCommunity {
pub community_id: CommunityId,
pub deleted: bool,
pub auth: String,
}
#[derive(Serialize, Deserialize)]
#[derive(Debug, Serialize, Deserialize)]
pub struct RemoveCommunity {
pub community_id: CommunityId,
pub removed: bool,
@ -108,27 +108,27 @@ pub struct RemoveCommunity {
pub auth: String,
}
#[derive(Serialize, Deserialize)]
#[derive(Debug, Serialize, Deserialize)]
pub struct FollowCommunity {
pub community_id: CommunityId,
pub follow: bool,
pub auth: String,
}
#[derive(Serialize, Deserialize)]
#[derive(Debug, Serialize, Deserialize)]
pub struct BlockCommunity {
pub community_id: CommunityId,
pub block: bool,
pub auth: String,
}
#[derive(Serialize, Deserialize, Clone)]
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct BlockCommunityResponse {
pub community_view: CommunityView,
pub blocked: bool,
}
#[derive(Serialize, Deserialize)]
#[derive(Debug, Serialize, Deserialize)]
pub struct TransferCommunity {
pub community_id: CommunityId,
pub person_id: PersonId,

View file

@ -29,22 +29,22 @@ pub struct Register {
pub honeypot: Option<String>,
}
#[derive(Serialize, Deserialize)]
#[derive(Debug, Serialize, Deserialize)]
pub struct GetCaptcha {}
#[derive(Serialize, Deserialize)]
#[derive(Debug, Serialize, Deserialize)]
pub struct GetCaptchaResponse {
pub ok: Option<CaptchaResponse>, // Will be None if captchas are disabled
}
#[derive(Serialize, Deserialize)]
#[derive(Debug, Serialize, Deserialize)]
pub struct CaptchaResponse {
pub png: String, // A Base64 encoded png
pub wav: String, // A Base64 encoded wav audio
pub uuid: String,
}
#[derive(Serialize, Deserialize)]
#[derive(Debug, Serialize, Deserialize)]
pub struct SaveUserSettings {
pub show_nsfw: Option<bool>,
pub show_scores: Option<bool>,
@ -75,12 +75,12 @@ pub struct ChangePassword {
pub auth: String,
}
#[derive(Serialize, Deserialize)]
#[derive(Debug, Serialize, Deserialize)]
pub struct LoginResponse {
pub jwt: String,
}
#[derive(Serialize, Deserialize)]
#[derive(Debug, Serialize, Deserialize)]
pub struct GetPersonDetails {
pub person_id: Option<PersonId>, // One of these two are required
/// Example: dessalines , or dessalines@xyz.tld
@ -93,7 +93,7 @@ pub struct GetPersonDetails {
pub auth: Option<String>,
}
#[derive(Serialize, Deserialize)]
#[derive(Debug, Serialize, Deserialize)]
pub struct GetPersonDetailsResponse {
pub person_view: PersonViewSafe,
pub comments: Vec<CommentView>,
@ -101,34 +101,34 @@ pub struct GetPersonDetailsResponse {
pub moderates: Vec<CommunityModeratorView>,
}
#[derive(Serialize, Deserialize)]
#[derive(Debug, Serialize, Deserialize)]
pub struct GetRepliesResponse {
pub replies: Vec<CommentView>,
}
#[derive(Serialize, Deserialize)]
#[derive(Debug, Serialize, Deserialize)]
pub struct GetPersonMentionsResponse {
pub mentions: Vec<PersonMentionView>,
}
#[derive(Serialize, Deserialize)]
#[derive(Debug, Serialize, Deserialize)]
pub struct MarkAllAsRead {
pub auth: String,
}
#[derive(Serialize, Deserialize)]
#[derive(Debug, Serialize, Deserialize)]
pub struct AddAdmin {
pub person_id: PersonId,
pub added: bool,
pub auth: String,
}
#[derive(Serialize, Deserialize, Clone)]
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct AddAdminResponse {
pub admins: Vec<PersonViewSafe>,
}
#[derive(Serialize, Deserialize)]
#[derive(Debug, Serialize, Deserialize)]
pub struct BanPerson {
pub person_id: PersonId,
pub ban: bool,
@ -138,26 +138,26 @@ pub struct BanPerson {
pub auth: String,
}
#[derive(Serialize, Deserialize, Clone)]
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct BanPersonResponse {
pub person_view: PersonViewSafe,
pub banned: bool,
}
#[derive(Serialize, Deserialize)]
#[derive(Debug, Serialize, Deserialize)]
pub struct BlockPerson {
pub person_id: PersonId,
pub block: bool,
pub auth: String,
}
#[derive(Serialize, Deserialize, Clone)]
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct BlockPersonResponse {
pub person_view: PersonViewSafe,
pub blocked: bool,
}
#[derive(Serialize, Deserialize)]
#[derive(Debug, Serialize, Deserialize)]
pub struct GetReplies {
pub sort: Option<String>,
pub page: Option<i64>,
@ -166,7 +166,7 @@ pub struct GetReplies {
pub auth: String,
}
#[derive(Serialize, Deserialize)]
#[derive(Debug, Serialize, Deserialize)]
pub struct GetPersonMentions {
pub sort: Option<String>,
pub page: Option<i64>,
@ -175,14 +175,14 @@ pub struct GetPersonMentions {
pub auth: String,
}
#[derive(Serialize, Deserialize)]
#[derive(Debug, Serialize, Deserialize)]
pub struct MarkPersonMentionAsRead {
pub person_mention_id: PersonMentionId,
pub read: bool,
pub auth: String,
}
#[derive(Serialize, Deserialize, Clone)]
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct PersonMentionResponse {
pub person_mention_view: PersonMentionView,
}
@ -198,7 +198,7 @@ pub struct PasswordReset {
pub email: String,
}
#[derive(Serialize, Deserialize, Clone)]
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct PasswordResetResponse {}
#[derive(Serialize, Deserialize)]
@ -208,35 +208,35 @@ pub struct PasswordChange {
pub password_verify: String,
}
#[derive(Serialize, Deserialize)]
#[derive(Debug, Serialize, Deserialize)]
pub struct CreatePrivateMessage {
pub content: String,
pub recipient_id: PersonId,
pub auth: String,
}
#[derive(Serialize, Deserialize)]
#[derive(Debug, Serialize, Deserialize)]
pub struct EditPrivateMessage {
pub private_message_id: PrivateMessageId,
pub content: String,
pub auth: String,
}
#[derive(Serialize, Deserialize)]
#[derive(Debug, Serialize, Deserialize)]
pub struct DeletePrivateMessage {
pub private_message_id: PrivateMessageId,
pub deleted: bool,
pub auth: String,
}
#[derive(Serialize, Deserialize)]
#[derive(Debug, Serialize, Deserialize)]
pub struct MarkPrivateMessageAsRead {
pub private_message_id: PrivateMessageId,
pub read: bool,
pub auth: String,
}
#[derive(Serialize, Deserialize)]
#[derive(Debug, Serialize, Deserialize)]
pub struct GetPrivateMessages {
pub unread_only: Option<bool>,
pub page: Option<i64>,
@ -244,35 +244,35 @@ pub struct GetPrivateMessages {
pub auth: String,
}
#[derive(Serialize, Deserialize, Clone)]
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct PrivateMessagesResponse {
pub private_messages: Vec<PrivateMessageView>,
}
#[derive(Serialize, Deserialize, Clone)]
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct PrivateMessageResponse {
pub private_message_view: PrivateMessageView,
}
#[derive(Serialize, Deserialize)]
#[derive(Debug, Serialize, Deserialize)]
pub struct GetReportCount {
pub community_id: Option<CommunityId>,
pub auth: String,
}
#[derive(Serialize, Deserialize, Clone)]
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct GetReportCountResponse {
pub community_id: Option<CommunityId>,
pub comment_reports: i64,
pub post_reports: i64,
}
#[derive(Serialize, Deserialize)]
#[derive(Debug, Serialize, Deserialize)]
pub struct GetUnreadCount {
pub auth: String,
}
#[derive(Serialize, Deserialize, Clone)]
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct GetUnreadCountResponse {
pub replies: i64,
pub mentions: i64,

View file

@ -23,18 +23,18 @@ pub struct CreatePost {
pub auth: String,
}
#[derive(Serialize, Deserialize, Clone)]
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct PostResponse {
pub post_view: PostView,
}
#[derive(Serialize, Deserialize)]
#[derive(Debug, Serialize, Deserialize)]
pub struct GetPost {
pub id: PostId,
pub auth: Option<String>,
}
#[derive(Serialize, Deserialize)]
#[derive(Debug, Serialize, Deserialize)]
pub struct GetPostResponse {
pub post_view: PostView,
pub community_view: CommunityView,
@ -60,14 +60,14 @@ pub struct GetPostsResponse {
pub posts: Vec<PostView>,
}
#[derive(Serialize, Deserialize)]
#[derive(Debug, Serialize, Deserialize)]
pub struct CreatePostLike {
pub post_id: PostId,
pub score: i16,
pub auth: String,
}
#[derive(Serialize, Deserialize)]
#[derive(Debug, Serialize, Deserialize)]
pub struct EditPost {
pub post_id: PostId,
pub name: Option<String>,
@ -77,14 +77,14 @@ pub struct EditPost {
pub auth: String,
}
#[derive(Serialize, Deserialize)]
#[derive(Debug, Serialize, Deserialize)]
pub struct DeletePost {
pub post_id: PostId,
pub deleted: bool,
pub auth: String,
}
#[derive(Serialize, Deserialize)]
#[derive(Debug, Serialize, Deserialize)]
pub struct RemovePost {
pub post_id: PostId,
pub removed: bool,
@ -92,54 +92,54 @@ pub struct RemovePost {
pub auth: String,
}
#[derive(Serialize, Deserialize)]
#[derive(Debug, Serialize, Deserialize)]
pub struct MarkPostAsRead {
pub post_id: PostId,
pub read: bool,
pub auth: String,
}
#[derive(Serialize, Deserialize)]
#[derive(Debug, Serialize, Deserialize)]
pub struct LockPost {
pub post_id: PostId,
pub locked: bool,
pub auth: String,
}
#[derive(Serialize, Deserialize)]
#[derive(Debug, Serialize, Deserialize)]
pub struct StickyPost {
pub post_id: PostId,
pub stickied: bool,
pub auth: String,
}
#[derive(Serialize, Deserialize)]
#[derive(Debug, Serialize, Deserialize)]
pub struct SavePost {
pub post_id: PostId,
pub save: bool,
pub auth: String,
}
#[derive(Serialize, Deserialize)]
#[derive(Debug, Serialize, Deserialize)]
pub struct CreatePostReport {
pub post_id: PostId,
pub reason: String,
pub auth: String,
}
#[derive(Serialize, Deserialize, Clone)]
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct PostReportResponse {
pub post_report_view: PostReportView,
}
#[derive(Serialize, Deserialize)]
#[derive(Debug, Serialize, Deserialize)]
pub struct ResolvePostReport {
pub report_id: PostReportId,
pub resolved: bool,
pub auth: String,
}
#[derive(Serialize, Deserialize)]
#[derive(Debug, Serialize, Deserialize)]
pub struct ListPostReports {
pub page: Option<i64>,
pub limit: Option<i64>,
@ -150,7 +150,7 @@ pub struct ListPostReports {
pub auth: String,
}
#[derive(Serialize, Deserialize)]
#[derive(Debug, Serialize, Deserialize)]
pub struct ListPostReportsResponse {
pub post_reports: Vec<PostReportView>,
}

View file

@ -56,7 +56,7 @@ pub struct ResolveObject {
pub auth: Option<String>,
}
#[derive(Serialize, Deserialize, Default)]
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct ResolveObjectResponse {
pub comment: Option<CommentView>,
pub post: Option<PostView>,
@ -64,7 +64,7 @@ pub struct ResolveObjectResponse {
pub person: Option<PersonViewSafe>,
}
#[derive(Serialize, Deserialize)]
#[derive(Debug, Serialize, Deserialize)]
pub struct GetModlog {
pub mod_person_id: Option<PersonId>,
pub community_id: Option<CommunityId>,
@ -72,7 +72,7 @@ pub struct GetModlog {
pub limit: Option<i64>,
}
#[derive(Serialize, Deserialize)]
#[derive(Debug, Serialize, Deserialize)]
pub struct GetModlogResponse {
pub removed_posts: Vec<ModRemovePostView>,
pub locked_posts: Vec<ModLockPostView>,
@ -86,7 +86,7 @@ pub struct GetModlogResponse {
pub added: Vec<ModAddView>,
}
#[derive(Serialize, Deserialize)]
#[derive(Debug, Serialize, Deserialize)]
pub struct CreateSite {
pub name: String,
pub sidebar: Option<String>,
@ -100,7 +100,7 @@ pub struct CreateSite {
pub auth: String,
}
#[derive(Serialize, Deserialize)]
#[derive(Debug, Serialize, Deserialize)]
pub struct EditSite {
pub name: Option<String>,
pub sidebar: Option<String>,
@ -114,17 +114,17 @@ pub struct EditSite {
pub auth: String,
}
#[derive(Serialize, Deserialize)]
#[derive(Debug, Serialize, Deserialize)]
pub struct GetSite {
pub auth: Option<String>,
}
#[derive(Serialize, Deserialize, Clone)]
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct SiteResponse {
pub site_view: SiteView,
}
#[derive(Serialize, Deserialize)]
#[derive(Debug, Serialize, Deserialize)]
pub struct GetSiteResponse {
pub site_view: Option<SiteView>, // Because the site might not be set up yet
pub admins: Vec<PersonViewSafe>,
@ -135,7 +135,7 @@ pub struct GetSiteResponse {
pub federated_instances: Option<FederatedInstances>, // Federation may be disabled
}
#[derive(Serialize, Deserialize)]
#[derive(Debug, Serialize, Deserialize)]
pub struct MyUserInfo {
pub local_user_view: LocalUserSettingsView,
pub follows: Vec<CommunityFollowerView>,
@ -144,29 +144,29 @@ pub struct MyUserInfo {
pub person_blocks: Vec<PersonBlockView>,
}
#[derive(Serialize, Deserialize)]
#[derive(Debug, Serialize, Deserialize)]
pub struct TransferSite {
pub person_id: PersonId,
pub auth: String,
}
#[derive(Serialize, Deserialize)]
#[derive(Debug, Serialize, Deserialize)]
pub struct GetSiteConfig {
pub auth: String,
}
#[derive(Serialize, Deserialize)]
#[derive(Debug, Serialize, Deserialize)]
pub struct GetSiteConfigResponse {
pub config_hjson: String,
}
#[derive(Serialize, Deserialize)]
#[derive(Debug, Serialize, Deserialize)]
pub struct SaveSiteConfig {
pub config_hjson: String,
pub auth: String,
}
#[derive(Serialize, Deserialize)]
#[derive(Debug, Serialize, Deserialize)]
pub struct FederatedInstances {
pub linked: Vec<String>,
pub allowed: Option<Vec<String>>,

View file

@ -6,7 +6,7 @@ pub struct UserJoin {
pub auth: String,
}
#[derive(Serialize, Deserialize, Clone)]
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct UserJoinResponse {
pub joined: bool,
}
@ -16,7 +16,7 @@ pub struct CommunityJoin {
pub community_id: CommunityId,
}
#[derive(Serialize, Deserialize, Clone)]
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct CommunityJoinResponse {
pub joined: bool,
}
@ -26,7 +26,7 @@ pub struct ModJoin {
pub community_id: CommunityId,
}
#[derive(Serialize, Deserialize, Clone)]
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct ModJoinResponse {
pub joined: bool,
}
@ -36,7 +36,7 @@ pub struct PostJoin {
pub post_id: PostId,
}
#[derive(Serialize, Deserialize, Clone)]
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct PostJoinResponse {
pub joined: bool,
}

View file

@ -44,7 +44,7 @@ use lemmy_websocket::{
impl PerformCrud for CreateComment {
type Response = CommentResponse;
#[tracing::instrument(skip(self, context, websocket_id))]
#[tracing::instrument(skip(context, websocket_id))]
async fn perform(
&self,
context: &Data<LemmyContext>,

View file

@ -29,7 +29,7 @@ use lemmy_websocket::{
impl PerformCrud for DeleteComment {
type Response = CommentResponse;
#[tracing::instrument(skip(self, context, websocket_id))]
#[tracing::instrument(skip(context, websocket_id))]
async fn perform(
&self,
context: &Data<LemmyContext>,
@ -114,7 +114,7 @@ impl PerformCrud for DeleteComment {
impl PerformCrud for RemoveComment {
type Response = CommentResponse;
#[tracing::instrument(skip(self, context, websocket_id))]
#[tracing::instrument(skip(context, websocket_id))]
async fn perform(
&self,
context: &Data<LemmyContext>,

View file

@ -20,7 +20,7 @@ use lemmy_websocket::LemmyContext;
impl PerformCrud for GetComment {
type Response = CommentResponse;
#[tracing::instrument(skip(self, context, _websocket_id))]
#[tracing::instrument(skip(context, _websocket_id))]
async fn perform(
&self,
context: &Data<LemmyContext>,
@ -51,7 +51,7 @@ impl PerformCrud for GetComment {
impl PerformCrud for GetComments {
type Response = GetCommentsResponse;
#[tracing::instrument(skip(self, context, _websocket_id))]
#[tracing::instrument(skip(context, _websocket_id))]
async fn perform(
&self,
context: &Data<LemmyContext>,

View file

@ -31,7 +31,7 @@ use crate::PerformCrud;
impl PerformCrud for EditComment {
type Response = CommentResponse;
#[tracing::instrument(skip(self, context, websocket_id))]
#[tracing::instrument(skip(context, websocket_id))]
async fn perform(
&self,
context: &Data<LemmyContext>,

View file

@ -43,7 +43,7 @@ use lemmy_websocket::LemmyContext;
impl PerformCrud for CreateCommunity {
type Response = CommunityResponse;
#[tracing::instrument(skip(self, context, _websocket_id))]
#[tracing::instrument(skip(context, _websocket_id))]
async fn perform(
&self,
context: &Data<LemmyContext>,

View file

@ -17,7 +17,7 @@ use lemmy_websocket::{send::send_community_ws_message, LemmyContext, UserOperati
impl PerformCrud for DeleteCommunity {
type Response = CommunityResponse;
#[tracing::instrument(skip(self, context, websocket_id))]
#[tracing::instrument(skip(context, websocket_id))]
async fn perform(
&self,
context: &Data<LemmyContext>,
@ -74,7 +74,7 @@ impl PerformCrud for DeleteCommunity {
impl PerformCrud for RemoveCommunity {
type Response = CommunityResponse;
#[tracing::instrument(skip(self, context, websocket_id))]
#[tracing::instrument(skip(context, websocket_id))]
async fn perform(
&self,
context: &Data<LemmyContext>,

View file

@ -24,7 +24,7 @@ use lemmy_websocket::{messages::GetCommunityUsersOnline, LemmyContext};
impl PerformCrud for GetCommunity {
type Response = GetCommunityResponse;
#[tracing::instrument(skip(self, context, _websocket_id))]
#[tracing::instrument(skip(context, _websocket_id))]
async fn perform(
&self,
context: &Data<LemmyContext>,
@ -93,7 +93,7 @@ impl PerformCrud for GetCommunity {
impl PerformCrud for ListCommunities {
type Response = ListCommunitiesResponse;
#[tracing::instrument(skip(self, context, _websocket_id))]
#[tracing::instrument(skip(context, _websocket_id))]
async fn perform(
&self,
context: &Data<LemmyContext>,

View file

@ -21,7 +21,7 @@ use lemmy_websocket::{send::send_community_ws_message, LemmyContext, UserOperati
impl PerformCrud for EditCommunity {
type Response = CommunityResponse;
#[tracing::instrument(skip(self, context, websocket_id))]
#[tracing::instrument(skip(context, websocket_id))]
async fn perform(
&self,
context: &Data<LemmyContext>,

View file

@ -39,7 +39,7 @@ use webmention::{Webmention, WebmentionError};
impl PerformCrud for CreatePost {
type Response = PostResponse;
#[tracing::instrument(skip(self, context, websocket_id))]
#[tracing::instrument(skip(context, websocket_id))]
async fn perform(
&self,
context: &Data<LemmyContext>,

View file

@ -24,7 +24,7 @@ use lemmy_websocket::{send::send_post_ws_message, LemmyContext, UserOperationCru
impl PerformCrud for DeletePost {
type Response = PostResponse;
#[tracing::instrument(skip(self, context, websocket_id))]
#[tracing::instrument(skip(context, websocket_id))]
async fn perform(
&self,
context: &Data<LemmyContext>,
@ -92,7 +92,7 @@ impl PerformCrud for DeletePost {
impl PerformCrud for RemovePost {
type Response = PostResponse;
#[tracing::instrument(skip(self, context, websocket_id))]
#[tracing::instrument(skip(context, websocket_id))]
async fn perform(
&self,
context: &Data<LemmyContext>,

View file

@ -27,7 +27,7 @@ use lemmy_websocket::{messages::GetPostUsersOnline, LemmyContext};
impl PerformCrud for GetPost {
type Response = GetPostResponse;
#[tracing::instrument(skip(self, context, _websocket_id))]
#[tracing::instrument(skip(context, _websocket_id))]
async fn perform(
&self,
context: &Data<LemmyContext>,
@ -118,7 +118,7 @@ impl PerformCrud for GetPost {
impl PerformCrud for GetPosts {
type Response = GetPostsResponse;
#[tracing::instrument(skip(self, context, _websocket_id))]
#[tracing::instrument(skip(context, _websocket_id))]
async fn perform(
&self,
context: &Data<LemmyContext>,

View file

@ -30,7 +30,7 @@ use crate::PerformCrud;
impl PerformCrud for EditPost {
type Response = PostResponse;
#[tracing::instrument(skip(self, context, websocket_id))]
#[tracing::instrument(skip(context, websocket_id))]
async fn perform(
&self,
context: &Data<LemmyContext>,

View file

@ -25,7 +25,7 @@ use lemmy_websocket::LemmyContext;
impl PerformCrud for CreateSite {
type Response = SiteResponse;
#[tracing::instrument(skip(self, context, _websocket_id))]
#[tracing::instrument(skip(context, _websocket_id))]
async fn perform(
&self,
context: &Data<LemmyContext>,

View file

@ -23,7 +23,7 @@ use tracing::info;
impl PerformCrud for GetSite {
type Response = GetSiteResponse;
#[tracing::instrument(skip(self, context, websocket_id))]
#[tracing::instrument(skip(context, websocket_id))]
async fn perform(
&self,
context: &Data<LemmyContext>,

View file

@ -22,7 +22,7 @@ use lemmy_websocket::{messages::SendAllMessage, LemmyContext, UserOperationCrud}
impl PerformCrud for EditSite {
type Response = SiteResponse;
#[tracing::instrument(skip(self, context, websocket_id))]
#[tracing::instrument(skip(context, websocket_id))]
async fn perform(
&self,
context: &Data<LemmyContext>,

View file

@ -84,7 +84,7 @@ impl CreateOrUpdateComment {
impl ActivityHandler for CreateOrUpdateComment {
type DataType = LemmyContext;
#[tracing::instrument(skip(self, context))]
#[tracing::instrument(skip_all)]
async fn verify(
&self,
context: &Data<LemmyContext>,
@ -104,7 +104,7 @@ impl ActivityHandler for CreateOrUpdateComment {
Ok(())
}
#[tracing::instrument(skip(self, context))]
#[tracing::instrument(skip_all)]
async fn receive(
self,
context: &Data<LemmyContext>,
@ -134,7 +134,7 @@ impl ActivityHandler for CreateOrUpdateComment {
#[async_trait::async_trait(?Send)]
impl GetCommunity for CreateOrUpdateComment {
#[tracing::instrument(skip(self, context))]
#[tracing::instrument(skip_all)]
async fn get_community(
&self,
context: &LemmyContext,

View file

@ -11,7 +11,7 @@ use lemmy_websocket::{send::send_local_notifs, LemmyContext};
pub mod create_or_update;
#[tracing::instrument(skip(actor, comment, context))]
#[tracing::instrument(skip_all)]
async fn get_notif_recipients(
actor: &ObjectId<ApubPerson>,
comment: &Comment,

View file

@ -32,7 +32,7 @@ use lemmy_utils::LemmyError;
use lemmy_websocket::LemmyContext;
impl AddMod {
#[tracing::instrument(skip(community, added_mod, actor, context))]
#[tracing::instrument(skip_all)]
pub async fn send(
community: &ApubCommunity,
added_mod: &ApubPerson,
@ -64,7 +64,7 @@ impl AddMod {
impl ActivityHandler for AddMod {
type DataType = LemmyContext;
#[tracing::instrument(skip(context))]
#[tracing::instrument(skip_all)]
async fn verify(
&self,
context: &Data<LemmyContext>,
@ -79,7 +79,7 @@ impl ActivityHandler for AddMod {
Ok(())
}
#[tracing::instrument(skip(self, context))]
#[tracing::instrument(skip_all)]
async fn receive(
self,
context: &Data<LemmyContext>,
@ -112,7 +112,7 @@ impl ActivityHandler for AddMod {
#[async_trait::async_trait(?Send)]
impl GetCommunity for AddMod {
#[tracing::instrument(skip(self, context))]
#[tracing::instrument(skip_all)]
async fn get_community(
&self,
context: &LemmyContext,

View file

@ -44,7 +44,7 @@ impl AnnounceActivity {
})
}
#[tracing::instrument(skip(object, community, context))]
#[tracing::instrument(skip_all)]
pub async fn send(
object: AnnouncableActivities,
community: &ApubCommunity,
@ -87,7 +87,7 @@ impl AnnounceActivity {
impl ActivityHandler for AnnounceActivity {
type DataType = LemmyContext;
#[tracing::instrument(skip(self, context))]
#[tracing::instrument(skip_all)]
async fn verify(
&self,
context: &Data<LemmyContext>,
@ -99,7 +99,7 @@ impl ActivityHandler for AnnounceActivity {
Ok(())
}
#[tracing::instrument(skip(self, context))]
#[tracing::instrument(skip_all)]
async fn receive(
self,
context: &Data<LemmyContext>,

View file

@ -52,7 +52,7 @@ impl BlockUserFromCommunity {
})
}
#[tracing::instrument(skip(community, target, actor, context))]
#[tracing::instrument(skip_all)]
pub async fn send(
community: &ApubCommunity,
target: &ApubPerson,
@ -72,7 +72,7 @@ impl BlockUserFromCommunity {
impl ActivityHandler for BlockUserFromCommunity {
type DataType = LemmyContext;
#[tracing::instrument(skip(self, context))]
#[tracing::instrument(skip_all)]
async fn verify(
&self,
context: &Data<LemmyContext>,
@ -86,7 +86,7 @@ impl ActivityHandler for BlockUserFromCommunity {
Ok(())
}
#[tracing::instrument(skip(self, context))]
#[tracing::instrument(skip_all)]
async fn receive(
self,
context: &Data<LemmyContext>,
@ -123,7 +123,7 @@ impl ActivityHandler for BlockUserFromCommunity {
#[async_trait::async_trait(?Send)]
impl GetCommunity for BlockUserFromCommunity {
#[tracing::instrument(skip(self, context))]
#[tracing::instrument(skip_all)]
async fn get_community(
&self,
context: &LemmyContext,

View file

@ -17,7 +17,7 @@ pub mod report;
pub mod undo_block_user;
pub mod update;
#[tracing::instrument(skip(activity, actor, community, context))]
#[tracing::instrument(skip_all)]
pub(crate) async fn send_activity_in_community<T: ActorType>(
activity: AnnouncableActivities,
activity_id: &Url,
@ -36,7 +36,7 @@ pub(crate) async fn send_activity_in_community<T: ActorType>(
Ok(())
}
#[tracing::instrument(skip(moderators, context))]
#[tracing::instrument(skip_all)]
async fn get_community_from_moderators_url(
moderators: &Url,
context: &LemmyContext,

View file

@ -32,7 +32,7 @@ use lemmy_utils::LemmyError;
use lemmy_websocket::LemmyContext;
impl RemoveMod {
#[tracing::instrument(skip(community, removed_mod, actor, context))]
#[tracing::instrument(skip_all)]
pub async fn send(
community: &ApubCommunity,
removed_mod: &ApubPerson,
@ -64,7 +64,7 @@ impl RemoveMod {
impl ActivityHandler for RemoveMod {
type DataType = LemmyContext;
#[tracing::instrument(skip(self, context))]
#[tracing::instrument(skip_all)]
async fn verify(
&self,
context: &Data<LemmyContext>,
@ -79,7 +79,7 @@ impl ActivityHandler for RemoveMod {
Ok(())
}
#[tracing::instrument(skip(self, context))]
#[tracing::instrument(skip_all)]
async fn receive(
self,
context: &Data<LemmyContext>,
@ -103,7 +103,7 @@ impl ActivityHandler for RemoveMod {
#[async_trait::async_trait(?Send)]
impl GetCommunity for RemoveMod {
#[tracing::instrument(skip(self, context))]
#[tracing::instrument(skip_all)]
async fn get_community(
&self,
context: &LemmyContext,

View file

@ -28,7 +28,7 @@ use lemmy_utils::LemmyError;
use lemmy_websocket::{messages::SendModRoomMessage, LemmyContext, UserOperation};
impl Report {
#[tracing::instrument(skip(object_id, actor, community_id, reason, context))]
#[tracing::instrument(skip_all)]
pub async fn send(
object_id: ObjectId<PostOrComment>,
actor: &ApubPerson,
@ -67,7 +67,7 @@ impl Report {
impl ActivityHandler for Report {
type DataType = LemmyContext;
#[tracing::instrument(skip(self, context))]
#[tracing::instrument(skip_all)]
async fn verify(
&self,
context: &Data<LemmyContext>,
@ -79,7 +79,7 @@ impl ActivityHandler for Report {
Ok(())
}
#[tracing::instrument(skip(self, context))]
#[tracing::instrument(skip_all)]
async fn receive(
self,
context: &Data<LemmyContext>,

View file

@ -29,7 +29,7 @@ use lemmy_utils::LemmyError;
use lemmy_websocket::LemmyContext;
impl UndoBlockUserFromCommunity {
#[tracing::instrument(skip(community, target, actor, context))]
#[tracing::instrument(skip_all)]
pub async fn send(
community: &ApubCommunity,
target: &ApubPerson,
@ -62,7 +62,7 @@ impl UndoBlockUserFromCommunity {
impl ActivityHandler for UndoBlockUserFromCommunity {
type DataType = LemmyContext;
#[tracing::instrument(skip(self, context))]
#[tracing::instrument(skip_all)]
async fn verify(
&self,
context: &Data<LemmyContext>,
@ -77,7 +77,7 @@ impl ActivityHandler for UndoBlockUserFromCommunity {
Ok(())
}
#[tracing::instrument(skip(self, context))]
#[tracing::instrument(skip_all)]
async fn receive(
self,
context: &Data<LemmyContext>,
@ -106,7 +106,7 @@ impl ActivityHandler for UndoBlockUserFromCommunity {
#[async_trait::async_trait(?Send)]
impl GetCommunity for UndoBlockUserFromCommunity {
#[tracing::instrument(skip(self, context))]
#[tracing::instrument(skip_all)]
async fn get_community(
&self,
context: &LemmyContext,

View file

@ -26,7 +26,7 @@ use lemmy_utils::LemmyError;
use lemmy_websocket::{send::send_community_ws_message, LemmyContext, UserOperationCrud};
impl UpdateCommunity {
#[tracing::instrument(skip(community, actor, context))]
#[tracing::instrument(skip_all)]
pub async fn send(
community: ApubCommunity,
actor: &ApubPerson,
@ -55,7 +55,7 @@ impl UpdateCommunity {
impl ActivityHandler for UpdateCommunity {
type DataType = LemmyContext;
#[tracing::instrument(skip(self, context))]
#[tracing::instrument(skip_all)]
async fn verify(
&self,
context: &Data<LemmyContext>,
@ -76,7 +76,7 @@ impl ActivityHandler for UpdateCommunity {
Ok(())
}
#[tracing::instrument(skip(self, context))]
#[tracing::instrument(skip_all)]
async fn receive(
self,
context: &Data<LemmyContext>,
@ -114,7 +114,7 @@ impl ActivityHandler for UpdateCommunity {
#[async_trait::async_trait(?Send)]
impl GetCommunity for UpdateCommunity {
#[tracing::instrument(skip(self, context))]
#[tracing::instrument(skip_all)]
async fn get_community(
&self,
context: &LemmyContext,

View file

@ -45,7 +45,7 @@ use url::Url;
impl ActivityHandler for Delete {
type DataType = LemmyContext;
#[tracing::instrument(skip(self, context))]
#[tracing::instrument(skip_all)]
async fn verify(
&self,
context: &Data<LemmyContext>,
@ -66,7 +66,7 @@ impl ActivityHandler for Delete {
Ok(())
}
#[tracing::instrument(skip(self, context))]
#[tracing::instrument(skip_all)]
async fn receive(
self,
context: &Data<LemmyContext>,
@ -115,7 +115,7 @@ impl Delete {
})
}
#[tracing::instrument(skip(actor, community, object, summary, context))]
#[tracing::instrument(skip_all)]
pub(in crate::activities::deletion) async fn send(
actor: &ApubPerson,
community: &ApubCommunity,
@ -131,7 +131,7 @@ impl Delete {
}
}
#[tracing::instrument(skip(actor, object, reason, context))]
#[tracing::instrument(skip_all)]
pub(in crate::activities) async fn receive_remove_action(
actor: &ObjectId<ApubPerson>,
object: &Url,
@ -208,7 +208,7 @@ pub(in crate::activities) async fn receive_remove_action(
#[async_trait::async_trait(?Send)]
impl GetCommunity for Delete {
#[tracing::instrument(skip(self, context))]
#[tracing::instrument(skip_all)]
async fn get_community(
&self,
context: &LemmyContext,

View file

@ -20,7 +20,7 @@ use url::Url;
pub mod delete;
pub mod undo_delete;
#[tracing::instrument(skip(actor, community, object, deleted, context))]
#[tracing::instrument(skip_all)]
pub async fn send_apub_delete(
actor: &ApubPerson,
community: &ApubCommunity,
@ -37,7 +37,7 @@ pub async fn send_apub_delete(
// TODO: remove reason is actually optional in lemmy. we set an empty string in that case, but its
// ugly
#[tracing::instrument(skip(actor, community, object, reason, removed, context))]
#[tracing::instrument(skip_all)]
pub async fn send_apub_remove(
actor: &ApubPerson,
community: &ApubCommunity,
@ -60,7 +60,7 @@ pub enum DeletableObjects {
}
impl DeletableObjects {
#[tracing::instrument(skip(ap_id, context))]
#[tracing::instrument(skip_all)]
pub(crate) async fn read_from_db(
ap_id: &Url,
context: &LemmyContext,
@ -86,7 +86,7 @@ impl DeletableObjects {
}
}
#[tracing::instrument(skip(object, actor, community, is_mod_action, context))]
#[tracing::instrument(skip_all)]
pub(in crate::activities) async fn verify_delete_activity(
object: &Url,
actor: &ObjectId<ApubPerson>,
@ -132,7 +132,7 @@ pub(in crate::activities) async fn verify_delete_activity(
Ok(())
}
#[tracing::instrument(skip(actor, object_id, community, is_mod_action, context))]
#[tracing::instrument(skip_all)]
async fn verify_delete_activity_post_or_comment(
actor: &ObjectId<ApubPerson>,
object_id: &Url,
@ -154,7 +154,7 @@ async fn verify_delete_activity_post_or_comment(
/// Write deletion or restoring of an object to the database, and send websocket message.
/// TODO: we should do something similar for receive_remove_action(), but its much more complicated
/// because of the mod log
#[tracing::instrument(skip(object, actor, deleted, context))]
#[tracing::instrument(skip_all)]
async fn receive_delete_action(
object: &Url,
actor: &ObjectId<ApubPerson>,

View file

@ -30,7 +30,7 @@ use url::Url;
impl ActivityHandler for UndoDelete {
type DataType = LemmyContext;
#[tracing::instrument(skip(self, context))]
#[tracing::instrument(skip_all)]
async fn verify(
&self,
context: &Data<LemmyContext>,
@ -52,7 +52,7 @@ impl ActivityHandler for UndoDelete {
Ok(())
}
#[tracing::instrument(skip(self, context))]
#[tracing::instrument(skip_all)]
async fn receive(
self,
context: &Data<LemmyContext>,
@ -74,7 +74,7 @@ impl ActivityHandler for UndoDelete {
}
impl UndoDelete {
#[tracing::instrument(skip(actor, community, object, summary, context))]
#[tracing::instrument(skip_all)]
pub(in crate::activities::deletion) async fn send(
actor: &ApubPerson,
community: &ApubCommunity,
@ -102,7 +102,7 @@ impl UndoDelete {
send_activity_in_community(activity, &id, actor, community, vec![], context).await
}
#[tracing::instrument(skip(object, context))]
#[tracing::instrument(skip_all)]
pub(in crate::activities) async fn receive_undo_remove_action(
object: &Url,
context: &LemmyContext,
@ -142,7 +142,7 @@ impl UndoDelete {
#[async_trait::async_trait(?Send)]
impl GetCommunity for UndoDelete {
#[tracing::instrument(skip(self, context))]
#[tracing::instrument(skip_all)]
async fn get_community(
&self,
context: &LemmyContext,

View file

@ -15,7 +15,7 @@ use lemmy_utils::LemmyError;
use lemmy_websocket::LemmyContext;
impl AcceptFollowCommunity {
#[tracing::instrument(skip(follow, context))]
#[tracing::instrument(skip_all)]
pub async fn send(
follow: FollowCommunity,
context: &LemmyContext,
@ -47,7 +47,7 @@ impl AcceptFollowCommunity {
impl ActivityHandler for AcceptFollowCommunity {
type DataType = LemmyContext;
#[tracing::instrument(skip(self, context))]
#[tracing::instrument(skip_all)]
async fn verify(
&self,
context: &Data<LemmyContext>,
@ -59,7 +59,7 @@ impl ActivityHandler for AcceptFollowCommunity {
Ok(())
}
#[tracing::instrument(skip(self, context))]
#[tracing::instrument(skip_all)]
async fn receive(
self,
context: &Data<LemmyContext>,

View file

@ -41,7 +41,7 @@ impl FollowCommunity {
})
}
#[tracing::instrument(skip(actor, community, context))]
#[tracing::instrument(skip_all)]
pub async fn send(
actor: &ApubPerson,
community: &ApubCommunity,
@ -67,7 +67,7 @@ impl FollowCommunity {
impl ActivityHandler for FollowCommunity {
type DataType = LemmyContext;
#[tracing::instrument(skip(self, context))]
#[tracing::instrument(skip_all)]
async fn verify(
&self,
context: &Data<LemmyContext>,
@ -80,7 +80,7 @@ impl ActivityHandler for FollowCommunity {
Ok(())
}
#[tracing::instrument(skip(self, context))]
#[tracing::instrument(skip_all)]
async fn receive(
self,
context: &Data<LemmyContext>,

View file

@ -19,7 +19,7 @@ use lemmy_utils::LemmyError;
use lemmy_websocket::LemmyContext;
impl UndoFollowCommunity {
#[tracing::instrument(skip(actor, community, context))]
#[tracing::instrument(skip_all)]
pub async fn send(
actor: &ApubPerson,
community: &ApubCommunity,
@ -45,7 +45,7 @@ impl UndoFollowCommunity {
impl ActivityHandler for UndoFollowCommunity {
type DataType = LemmyContext;
#[tracing::instrument(skip(self, context))]
#[tracing::instrument(skip_all)]
async fn verify(
&self,
context: &Data<LemmyContext>,
@ -58,7 +58,7 @@ impl ActivityHandler for UndoFollowCommunity {
Ok(())
}
#[tracing::instrument(skip(self, context))]
#[tracing::instrument(skip_all)]
async fn receive(
self,
context: &Data<LemmyContext>,

View file

@ -35,7 +35,7 @@ pub mod voting;
/// Checks that the specified Url actually identifies a Person (by fetching it), and that the person
/// doesn't have a site ban.
#[tracing::instrument(skip(person_id, context))]
#[tracing::instrument(skip_all)]
async fn verify_person(
person_id: &ObjectId<ApubPerson>,
context: &LemmyContext,
@ -53,7 +53,7 @@ async fn verify_person(
/// Fetches the person and community to verify their type, then checks if person is banned from site
/// or community.
#[tracing::instrument(skip(person_id, community, context))]
#[tracing::instrument(skip_all)]
pub(crate) async fn verify_person_in_community(
person_id: &ObjectId<ApubPerson>,
community: &ApubCommunity,
@ -88,7 +88,7 @@ fn verify_activity(id: &Url, actor: &Url, settings: &Settings) -> Result<(), Lem
/// Verify that the actor is a community mod. This check is only run if the community is local,
/// because in case of remote communities, admins can also perform mod actions. As admin status
/// is not federated, we cant verify their actions remotely.
#[tracing::instrument(skip(actor_id, community, context))]
#[tracing::instrument(skip_all)]
pub(crate) async fn verify_mod_action(
actor_id: &ObjectId<ApubPerson>,
community: &ApubCommunity,
@ -157,7 +157,7 @@ where
Url::parse(&id)
}
#[tracing::instrument(skip(context, activity, activity_id, actor, inboxes, sensitive))]
#[tracing::instrument(skip_all)]
async fn send_lemmy_activity<T: Serialize>(
context: &LemmyContext,
activity: &T,

View file

@ -47,7 +47,7 @@ impl CreateOrUpdatePost {
})
}
#[tracing::instrument(skip(post, actor, kind, context))]
#[tracing::instrument(skip_all)]
pub async fn send(
post: ApubPost,
actor: &ApubPerson,
@ -72,7 +72,7 @@ impl CreateOrUpdatePost {
impl ActivityHandler for CreateOrUpdatePost {
type DataType = LemmyContext;
#[tracing::instrument(skip(self, context))]
#[tracing::instrument(skip_all)]
async fn verify(
&self,
context: &Data<LemmyContext>,
@ -114,7 +114,7 @@ impl ActivityHandler for CreateOrUpdatePost {
Ok(())
}
#[tracing::instrument(skip(self, context))]
#[tracing::instrument(skip_all)]
async fn receive(
self,
context: &Data<LemmyContext>,
@ -133,7 +133,7 @@ impl ActivityHandler for CreateOrUpdatePost {
#[async_trait::async_trait(?Send)]
impl GetCommunity for CreateOrUpdatePost {
#[tracing::instrument(skip(self, context))]
#[tracing::instrument(skip_all)]
async fn get_community(
&self,
context: &LemmyContext,

View file

@ -18,7 +18,7 @@ use lemmy_utils::LemmyError;
use lemmy_websocket::{send::send_pm_ws_message, LemmyContext, UserOperationCrud};
impl CreateOrUpdatePrivateMessage {
#[tracing::instrument(skip(private_message, actor, kind, context))]
#[tracing::instrument(skip_all)]
pub async fn send(
private_message: ApubPrivateMessage,
actor: &ApubPerson,
@ -52,7 +52,7 @@ impl CreateOrUpdatePrivateMessage {
impl ActivityHandler for CreateOrUpdatePrivateMessage {
type DataType = LemmyContext;
#[tracing::instrument(skip(self, context))]
#[tracing::instrument(skip_all)]
async fn verify(
&self,
context: &Data<LemmyContext>,
@ -65,7 +65,7 @@ impl ActivityHandler for CreateOrUpdatePrivateMessage {
Ok(())
}
#[tracing::instrument(skip(self, context))]
#[tracing::instrument(skip_all)]
async fn receive(
self,
context: &Data<LemmyContext>,

View file

@ -37,7 +37,7 @@ impl DeletePrivateMessage {
})
}
#[tracing::instrument(skip(actor, pm, context))]
#[tracing::instrument(skip_all)]
pub async fn send(
actor: &ApubPerson,
pm: &ApubPrivateMessage,
@ -60,7 +60,7 @@ impl DeletePrivateMessage {
impl ActivityHandler for DeletePrivateMessage {
type DataType = LemmyContext;
#[tracing::instrument(skip(self, context))]
#[tracing::instrument(skip_all)]
async fn verify(
&self,
context: &Data<LemmyContext>,
@ -72,7 +72,7 @@ impl ActivityHandler for DeletePrivateMessage {
Ok(())
}
#[tracing::instrument(skip(self, context))]
#[tracing::instrument(skip_all)]
async fn receive(
self,
context: &Data<LemmyContext>,

View file

@ -22,7 +22,7 @@ use lemmy_utils::LemmyError;
use lemmy_websocket::{send::send_pm_ws_message, LemmyContext, UserOperationCrud};
impl UndoDeletePrivateMessage {
#[tracing::instrument(skip(actor, pm, context))]
#[tracing::instrument(skip_all)]
pub async fn send(
actor: &ApubPerson,
pm: &ApubPrivateMessage,
@ -56,7 +56,7 @@ impl UndoDeletePrivateMessage {
impl ActivityHandler for UndoDeletePrivateMessage {
type DataType = LemmyContext;
#[tracing::instrument(skip(self, context))]
#[tracing::instrument(skip_all)]
async fn verify(
&self,
context: &Data<LemmyContext>,
@ -70,7 +70,7 @@ impl ActivityHandler for UndoDeletePrivateMessage {
Ok(())
}
#[tracing::instrument(skip(self, context))]
#[tracing::instrument(skip_all)]
async fn receive(
self,
context: &Data<LemmyContext>,

View file

@ -21,7 +21,7 @@ use crate::{
pub mod undo_vote;
pub mod vote;
#[tracing::instrument(skip(vote_type, actor, comment, context))]
#[tracing::instrument(skip_all)]
async fn vote_comment(
vote_type: &VoteType,
actor: ApubPerson,
@ -46,7 +46,7 @@ async fn vote_comment(
Ok(())
}
#[tracing::instrument(skip(vote_type, actor, post, context))]
#[tracing::instrument(skip_all)]
async fn vote_post(
vote_type: &VoteType,
actor: ApubPerson,
@ -70,7 +70,7 @@ async fn vote_post(
Ok(())
}
#[tracing::instrument(skip(actor, comment, context))]
#[tracing::instrument(skip_all)]
async fn undo_vote_comment(
actor: ApubPerson,
comment: &ApubComment,
@ -87,7 +87,7 @@ async fn undo_vote_comment(
Ok(())
}
#[tracing::instrument(skip(actor, post, context))]
#[tracing::instrument(skip_all)]
async fn undo_vote_post(
actor: ApubPerson,
post: &ApubPost,

View file

@ -28,7 +28,7 @@ use lemmy_utils::LemmyError;
use lemmy_websocket::LemmyContext;
impl UndoVote {
#[tracing::instrument(skip(object, actor, community_id, kind, context))]
#[tracing::instrument(skip_all)]
pub async fn send(
object: &PostOrComment,
actor: &ApubPerson,
@ -65,7 +65,7 @@ impl UndoVote {
impl ActivityHandler for UndoVote {
type DataType = LemmyContext;
#[tracing::instrument(skip(self, context))]
#[tracing::instrument(skip_all)]
async fn verify(
&self,
context: &Data<LemmyContext>,
@ -80,7 +80,7 @@ impl ActivityHandler for UndoVote {
Ok(())
}
#[tracing::instrument(skip(self, context))]
#[tracing::instrument(skip_all)]
async fn receive(
self,
context: &Data<LemmyContext>,
@ -101,7 +101,7 @@ impl ActivityHandler for UndoVote {
#[async_trait::async_trait(?Send)]
impl GetCommunity for UndoVote {
#[tracing::instrument(skip(self, context))]
#[tracing::instrument(skip_all)]
async fn get_community(
&self,
context: &LemmyContext,

View file

@ -46,7 +46,7 @@ impl Vote {
})
}
#[tracing::instrument(skip(object, actor, community_id, kind, context))]
#[tracing::instrument(skip_all)]
pub async fn send(
object: &PostOrComment,
actor: &ApubPerson,
@ -71,7 +71,7 @@ impl Vote {
impl ActivityHandler for Vote {
type DataType = LemmyContext;
#[tracing::instrument(skip(self, context))]
#[tracing::instrument(skip_all)]
async fn verify(
&self,
context: &Data<LemmyContext>,
@ -84,7 +84,7 @@ impl ActivityHandler for Vote {
Ok(())
}
#[tracing::instrument(skip(self, context))]
#[tracing::instrument(skip_all)]
async fn receive(
self,
context: &Data<LemmyContext>,
@ -101,7 +101,7 @@ impl ActivityHandler for Vote {
#[async_trait::async_trait(?Send)]
impl GetCommunity for Vote {
#[tracing::instrument(skip(self, context))]
#[tracing::instrument(skip_all)]
async fn get_community(
&self,
context: &LemmyContext,

View file

@ -29,7 +29,7 @@ impl ApubObject for ApubCommunityModerators {
None
}
#[tracing::instrument(skip(_object_id, data))]
#[tracing::instrument(skip_all)]
async fn read_from_apub_id(
_object_id: Url,
data: &Self::DataType,
@ -47,12 +47,12 @@ impl ApubObject for ApubCommunityModerators {
}
}
#[tracing::instrument(skip(self, _data))]
#[tracing::instrument(skip_all)]
async fn delete(self, _data: &Self::DataType) -> Result<(), LemmyError> {
unimplemented!()
}
#[tracing::instrument(skip(self, data))]
#[tracing::instrument(skip_all)]
async fn into_apub(self, data: &Self::DataType) -> Result<Self::ApubType, LemmyError> {
let ordered_items = self
.0
@ -70,7 +70,7 @@ impl ApubObject for ApubCommunityModerators {
unimplemented!()
}
#[tracing::instrument(skip(group_moderators, expected_domain, _context))]
#[tracing::instrument(skip_all)]
async fn verify(
group_moderators: &GroupModerators,
expected_domain: &Url,
@ -81,7 +81,7 @@ impl ApubObject for ApubCommunityModerators {
Ok(())
}
#[tracing::instrument(skip(apub, data))]
#[tracing::instrument(skip_all)]
async fn from_apub(
apub: Self::ApubType,
data: &Self::DataType,

View file

@ -33,7 +33,7 @@ impl ApubObject for ApubCommunityOutbox {
None
}
#[tracing::instrument(skip(_object_id, data))]
#[tracing::instrument(skip_all)]
async fn read_from_apub_id(
_object_id: Url,
data: &Self::DataType,
@ -59,7 +59,7 @@ impl ApubObject for ApubCommunityOutbox {
Ok(())
}
#[tracing::instrument(skip(self, data))]
#[tracing::instrument(skip_all)]
async fn into_apub(self, data: &Self::DataType) -> Result<Self::ApubType, LemmyError> {
let mut ordered_items = vec![];
for post in self.0 {
@ -82,7 +82,7 @@ impl ApubObject for ApubCommunityOutbox {
unimplemented!()
}
#[tracing::instrument(skip(group_outbox, expected_domain, _context))]
#[tracing::instrument(skip_all)]
async fn verify(
group_outbox: &GroupOutbox,
expected_domain: &Url,
@ -93,7 +93,7 @@ impl ApubObject for ApubCommunityOutbox {
Ok(())
}
#[tracing::instrument(skip(apub, data))]
#[tracing::instrument(skip_all)]
async fn from_apub(
apub: Self::ApubType,
data: &Self::DataType,

View file

@ -33,7 +33,7 @@ impl ApubObject for PostOrComment {
}
// TODO: this can probably be implemented using a single sql query
#[tracing::instrument(skip(object_id, data))]
#[tracing::instrument(skip_all)]
async fn read_from_apub_id(
object_id: Url,
data: &Self::DataType,
@ -47,7 +47,7 @@ impl ApubObject for PostOrComment {
})
}
#[tracing::instrument(skip(self, data))]
#[tracing::instrument(skip_all)]
async fn delete(self, data: &Self::DataType) -> Result<(), LemmyError> {
match self {
PostOrComment::Post(p) => p.delete(data).await,
@ -63,7 +63,7 @@ impl ApubObject for PostOrComment {
unimplemented!()
}
#[tracing::instrument(skip(apub, expected_domain, data))]
#[tracing::instrument(skip_all)]
async fn verify(
apub: &Self::ApubType,
expected_domain: &Url,
@ -76,7 +76,7 @@ impl ApubObject for PostOrComment {
}
}
#[tracing::instrument(skip(apub, context))]
#[tracing::instrument(skip_all)]
async fn from_apub(
apub: PageOrNote,
context: &LemmyContext,

View file

@ -18,7 +18,7 @@ use url::Url;
/// http://lemmy_beta:8551/u/lemmy_alpha, or @lemmy_beta@lemmy_beta:8551
/// http://lemmy_gamma:8561/post/3
/// http://lemmy_delta:8571/comment/2
#[tracing::instrument(skip(query, context))]
#[tracing::instrument(skip_all)]
pub async fn search_by_apub_id(
query: &str,
context: &LemmyContext,
@ -105,7 +105,7 @@ impl ApubObject for SearchableObjects {
// a single query.
// we could skip this and always return an error, but then it would always fetch objects
// over http, and not be able to mark objects as deleted that were deleted by remote server.
#[tracing::instrument(skip(object_id, context))]
#[tracing::instrument(skip_all)]
async fn read_from_apub_id(
object_id: Url,
context: &LemmyContext,
@ -129,7 +129,7 @@ impl ApubObject for SearchableObjects {
Ok(None)
}
#[tracing::instrument(skip(self, data))]
#[tracing::instrument(skip_all)]
async fn delete(self, data: &Self::DataType) -> Result<(), LemmyError> {
match self {
SearchableObjects::Person(p) => p.delete(data).await,
@ -147,7 +147,7 @@ impl ApubObject for SearchableObjects {
unimplemented!()
}
#[tracing::instrument(skip(apub, expected_domain, data))]
#[tracing::instrument(skip_all)]
async fn verify(
apub: &Self::ApubType,
expected_domain: &Url,
@ -170,7 +170,7 @@ impl ApubObject for SearchableObjects {
}
}
#[tracing::instrument(skip(apub, context))]
#[tracing::instrument(skip_all)]
async fn from_apub(
apub: Self::ApubType,
context: &LemmyContext,

View file

@ -35,7 +35,7 @@ impl ApubObject for UserOrCommunity {
})
}
#[tracing::instrument(skip(object_id, data))]
#[tracing::instrument(skip_all)]
async fn read_from_apub_id(
object_id: Url,
data: &Self::DataType,
@ -49,7 +49,7 @@ impl ApubObject for UserOrCommunity {
})
}
#[tracing::instrument(skip(self, data))]
#[tracing::instrument(skip_all)]
async fn delete(self, data: &Self::DataType) -> Result<(), LemmyError> {
match self {
UserOrCommunity::User(p) => p.delete(data).await,
@ -65,7 +65,7 @@ impl ApubObject for UserOrCommunity {
unimplemented!()
}
#[tracing::instrument(skip(apub, expected_domain, data))]
#[tracing::instrument(skip_all)]
async fn verify(
apub: &Self::ApubType,
expected_domain: &Url,
@ -82,7 +82,7 @@ impl ApubObject for UserOrCommunity {
}
}
#[tracing::instrument(skip(apub, data))]
#[tracing::instrument(skip_all)]
async fn from_apub(
apub: Self::ApubType,
data: &Self::DataType,

View file

@ -33,7 +33,7 @@ pub struct WebfingerResponse {
///
/// TODO: later provide a method in ApubObject to generate the endpoint, so that we dont have to
/// pass in EndpointType
#[tracing::instrument(skip(identifier, endpoint_type, context))]
#[tracing::instrument(skip_all)]
pub async fn webfinger_resolve<Kind>(
identifier: &str,
endpoint_type: EndpointType,
@ -61,7 +61,7 @@ where
/// Turns a person id like `@name@example.com` into an apub ID, like `https://example.com/user/name`,
/// using webfinger.
#[tracing::instrument(skip(identifier, context))]
#[tracing::instrument(skip_all)]
pub(crate) async fn webfinger_resolve_actor<Kind>(
identifier: &str,
context: &LemmyContext,

View file

@ -17,7 +17,7 @@ pub(crate) struct CommentQuery {
}
/// Return the ActivityPub json representation of a local comment over HTTP.
#[tracing::instrument(skip(info, context))]
#[tracing::instrument(skip_all)]
pub(crate) async fn get_apub_comment(
info: Path<CommentQuery>,
context: web::Data<LemmyContext>,

View file

@ -36,7 +36,7 @@ pub(crate) struct CommunityQuery {
}
/// Return the ActivityPub json representation of a local community over HTTP.
#[tracing::instrument(skip(info, context))]
#[tracing::instrument(skip_all)]
pub(crate) async fn get_apub_community_http(
info: web::Path<CommunityQuery>,
context: web::Data<LemmyContext>,
@ -57,7 +57,7 @@ pub(crate) async fn get_apub_community_http(
}
/// Handler for all incoming receive to community inboxes.
#[tracing::instrument(skip(request, payload, _path, context))]
#[tracing::instrument(skip_all)]
pub async fn community_inbox(
request: HttpRequest,
payload: Payload,
@ -123,7 +123,7 @@ pub(crate) async fn get_apub_community_outbox(
Ok(create_apub_response(&outbox.into_apub(&outbox_data).await?))
}
#[tracing::instrument(skip(info, context))]
#[tracing::instrument(skip_all)]
pub(crate) async fn get_apub_community_moderators(
info: web::Path<CommunityQuery>,
context: web::Data<LemmyContext>,

View file

@ -38,7 +38,7 @@ mod person;
mod post;
pub mod routes;
#[tracing::instrument(skip(request, payload, context))]
#[tracing::instrument(skip_all)]
pub async fn shared_inbox(
request: HttpRequest,
payload: Payload,
@ -76,7 +76,7 @@ pub(crate) struct ActivityCommonFields {
}
// TODO: move most of this code to library
#[tracing::instrument(skip(request, activity, activity_data, context))]
#[tracing::instrument(skip_all)]
async fn receive_activity<'a, T>(
request: HttpRequest,
activity: T,
@ -151,7 +151,7 @@ pub struct ActivityQuery {
}
/// Return the ActivityPub json representation of a local activity over HTTP.
#[tracing::instrument(skip(info, context))]
#[tracing::instrument(skip_all)]
pub(crate) async fn get_activity(
info: web::Path<ActivityQuery>,
context: web::Data<LemmyContext>,

View file

@ -26,7 +26,7 @@ pub struct PersonQuery {
}
/// Return the ActivityPub json representation of a local person over HTTP.
#[tracing::instrument(skip(info, context))]
#[tracing::instrument(skip_all)]
pub(crate) async fn get_apub_person_http(
info: web::Path<PersonQuery>,
context: web::Data<LemmyContext>,
@ -48,7 +48,7 @@ pub(crate) async fn get_apub_person_http(
}
}
#[tracing::instrument(skip(request, payload, _path, context))]
#[tracing::instrument(skip_all)]
pub async fn person_inbox(
request: HttpRequest,
payload: Payload,
@ -71,7 +71,7 @@ pub(in crate::http) async fn receive_person_inbox(
receive_activity(request, activity, activity_data, context).await
}
#[tracing::instrument(skip(info, context))]
#[tracing::instrument(skip_all)]
pub(crate) async fn get_apub_person_outbox(
info: web::Path<PersonQuery>,
context: web::Data<LemmyContext>,

View file

@ -17,7 +17,7 @@ pub(crate) struct PostQuery {
}
/// Return the ActivityPub json representation of a local post over HTTP.
#[tracing::instrument(skip(info, context))]
#[tracing::instrument(skip_all)]
pub(crate) async fn get_apub_post(
info: web::Path<PostQuery>,
context: web::Data<LemmyContext>,

View file

@ -64,7 +64,7 @@ impl ApubObject for ApubComment {
None
}
#[tracing::instrument(skip(object_id, context))]
#[tracing::instrument(skip_all)]
async fn read_from_apub_id(
object_id: Url,
context: &LemmyContext,
@ -78,7 +78,7 @@ impl ApubObject for ApubComment {
)
}
#[tracing::instrument(skip(self, context))]
#[tracing::instrument(skip_all)]
async fn delete(self, context: &LemmyContext) -> Result<(), LemmyError> {
if !self.deleted {
blocking(context.pool(), move |conn| {
@ -89,7 +89,7 @@ impl ApubObject for ApubComment {
Ok(())
}
#[tracing::instrument(skip(self, context))]
#[tracing::instrument(skip_all)]
async fn into_apub(self, context: &LemmyContext) -> Result<Note, LemmyError> {
let creator_id = self.creator_id;
let creator = blocking(context.pool(), move |conn| Person::read(conn, creator_id)).await??;
@ -138,7 +138,7 @@ impl ApubObject for ApubComment {
Ok(Tombstone::new(self.ap_id.clone().into()))
}
#[tracing::instrument(skip(note, expected_domain, context))]
#[tracing::instrument(skip_all)]
async fn verify(
note: &Note,
expected_domain: &Url,
@ -171,7 +171,7 @@ impl ApubObject for ApubComment {
/// Converts a `Note` to `Comment`.
///
/// If the parent community, post and comment(s) are not known locally, these are also fetched.
#[tracing::instrument(skip(note, context))]
#[tracing::instrument(skip_all)]
async fn from_apub(
note: Note,
context: &LemmyContext,

View file

@ -55,7 +55,7 @@ impl ApubObject for ApubCommunity {
Some(self.last_refreshed_at)
}
#[tracing::instrument(skip(object_id, context))]
#[tracing::instrument(skip_all)]
async fn read_from_apub_id(
object_id: Url,
context: &LemmyContext,
@ -69,7 +69,7 @@ impl ApubObject for ApubCommunity {
)
}
#[tracing::instrument(skip(self, context))]
#[tracing::instrument(skip_all)]
async fn delete(self, context: &LemmyContext) -> Result<(), LemmyError> {
blocking(context.pool(), move |conn| {
Community::update_deleted(conn, self.id, true)
@ -78,7 +78,7 @@ impl ApubObject for ApubCommunity {
Ok(())
}
#[tracing::instrument(skip(self, _context))]
#[tracing::instrument(skip_all)]
async fn into_apub(self, _context: &LemmyContext) -> Result<Group, LemmyError> {
let source = self.description.clone().map(|bio| Source {
content: bio,
@ -118,7 +118,7 @@ impl ApubObject for ApubCommunity {
Ok(Tombstone::new(self.actor_id()))
}
#[tracing::instrument(skip(group, expected_domain, context))]
#[tracing::instrument(skip_all)]
async fn verify(
group: &Group,
expected_domain: &Url,
@ -129,7 +129,7 @@ impl ApubObject for ApubCommunity {
}
/// Converts a `Group` to `Community`, inserts it into the database and updates moderators.
#[tracing::instrument(skip(group, context))]
#[tracing::instrument(skip_all)]
async fn from_apub(
group: Group,
context: &LemmyContext,
@ -186,7 +186,7 @@ impl ActorType for ApubCommunity {
impl ApubCommunity {
/// For a given community, returns the inboxes of all followers.
#[tracing::instrument(skip(self, context))]
#[tracing::instrument(skip_all)]
pub(crate) async fn get_follower_inboxes(
&self,
context: &LemmyContext,

View file

@ -57,7 +57,7 @@ impl ApubObject for ApubPerson {
Some(self.last_refreshed_at)
}
#[tracing::instrument(skip(object_id, context))]
#[tracing::instrument(skip_all)]
async fn read_from_apub_id(
object_id: Url,
context: &LemmyContext,
@ -71,7 +71,7 @@ impl ApubObject for ApubPerson {
)
}
#[tracing::instrument(skip(self, context))]
#[tracing::instrument(skip_all)]
async fn delete(self, context: &LemmyContext) -> Result<(), LemmyError> {
blocking(context.pool(), move |conn| {
DbPerson::update_deleted(conn, self.id, true)
@ -80,7 +80,7 @@ impl ApubObject for ApubPerson {
Ok(())
}
#[tracing::instrument(skip(self, _pool))]
#[tracing::instrument(skip_all)]
async fn into_apub(self, _pool: &LemmyContext) -> Result<Person, LemmyError> {
let kind = if self.bot_account {
UserTypes::Service
@ -121,7 +121,7 @@ impl ApubObject for ApubPerson {
unimplemented!()
}
#[tracing::instrument(skip(person, expected_domain, context))]
#[tracing::instrument(skip_all)]
async fn verify(
person: &Person,
expected_domain: &Url,
@ -139,7 +139,7 @@ impl ApubObject for ApubPerson {
Ok(())
}
#[tracing::instrument(skip(person, context))]
#[tracing::instrument(skip_all)]
async fn from_apub(
person: Person,
context: &LemmyContext,

View file

@ -60,7 +60,7 @@ impl ApubObject for ApubPost {
None
}
#[tracing::instrument(skip(object_id, context))]
#[tracing::instrument(skip_all)]
async fn read_from_apub_id(
object_id: Url,
context: &LemmyContext,
@ -74,7 +74,7 @@ impl ApubObject for ApubPost {
)
}
#[tracing::instrument(skip(self, context))]
#[tracing::instrument(skip_all)]
async fn delete(self, context: &LemmyContext) -> Result<(), LemmyError> {
if !self.deleted {
blocking(context.pool(), move |conn| {
@ -86,7 +86,7 @@ impl ApubObject for ApubPost {
}
// Turn a Lemmy post into an ActivityPub page that can be sent out over the network.
#[tracing::instrument(skip(self, context))]
#[tracing::instrument(skip_all)]
async fn into_apub(self, context: &LemmyContext) -> Result<Page, LemmyError> {
let creator_id = self.creator_id;
let creator = blocking(context.pool(), move |conn| Person::read(conn, creator_id)).await??;
@ -128,7 +128,7 @@ impl ApubObject for ApubPost {
Ok(Tombstone::new(self.ap_id.clone().into()))
}
#[tracing::instrument(skip(page, expected_domain, context))]
#[tracing::instrument(skip_all)]
async fn verify(
page: &Page,
expected_domain: &Url,
@ -150,7 +150,7 @@ impl ApubObject for ApubPost {
Ok(())
}
#[tracing::instrument(skip(page, context))]
#[tracing::instrument(skip_all)]
async fn from_apub(
page: Page,
context: &LemmyContext,

View file

@ -52,7 +52,7 @@ impl ApubObject for ApubPrivateMessage {
None
}
#[tracing::instrument(skip(object_id, context))]
#[tracing::instrument(skip_all)]
async fn read_from_apub_id(
object_id: Url,
context: &LemmyContext,
@ -71,7 +71,7 @@ impl ApubObject for ApubPrivateMessage {
unimplemented!()
}
#[tracing::instrument(skip(self, context))]
#[tracing::instrument(skip_all)]
async fn into_apub(self, context: &LemmyContext) -> Result<ChatMessage, LemmyError> {
let creator_id = self.creator_id;
let creator = blocking(context.pool(), move |conn| Person::read(conn, creator_id)).await??;
@ -102,7 +102,7 @@ impl ApubObject for ApubPrivateMessage {
unimplemented!()
}
#[tracing::instrument(skip(note, expected_domain, context))]
#[tracing::instrument(skip_all)]
async fn verify(
note: &ChatMessage,
expected_domain: &Url,
@ -123,7 +123,7 @@ impl ApubObject for ApubPrivateMessage {
Ok(())
}
#[tracing::instrument(skip(note, context))]
#[tracing::instrument(skip_all)]
async fn from_apub(
note: ChatMessage,
context: &LemmyContext,

View file

@ -7,15 +7,13 @@ use lemmy_utils::LemmyError;
use tracing::subscriber::set_global_default;
use tracing_error::ErrorLayer;
use tracing_log::LogTracer;
use tracing_subscriber::{fmt::format::FmtSpan, layer::SubscriberExt, EnvFilter, Registry};
use tracing_subscriber::{layer::SubscriberExt, EnvFilter, Registry};
pub fn init_tracing() -> Result<(), LemmyError> {
LogTracer::init()?;
let env_filter = EnvFilter::try_from_default_env().unwrap_or_else(|_| EnvFilter::new("info"));
let format_layer = tracing_subscriber::fmt::layer()
.with_span_events(FmtSpan::CLOSE)
.pretty();
let format_layer = tracing_subscriber::fmt::layer().pretty();
let subscriber = Registry::default()
.with(env_filter)

View file

@ -123,6 +123,7 @@ async fn main() -> Result<(), LemmyError> {
);
let rate_limiter = rate_limiter.clone();
App::new()
.wrap(actix_web::middleware::Logger::default())
.wrap(TracingLogger::default())
.app_data(Data::new(context))
// The routes