From: Dessalines Date: Fri, 2 Oct 2020 15:15:26 +0000 (-0500) Subject: Fixing pretty print again. X-Git-Url: http://these/git/%24%7B%60data:application/static/%7B%60https:/readmes/README.ru.md?a=commitdiff_plain;h=2e2b6eacd7db07f8809d7717003cfa8160218a1b;p=lemmy.git Fixing pretty print again. --- diff --git a/lemmy_apub/src/community.rs b/lemmy_apub/src/community.rs index 44f5e6e1..c2b4571f 100644 --- a/lemmy_apub/src/community.rs +++ b/lemmy_apub/src/community.rs @@ -259,6 +259,7 @@ impl ActorType for Community { .await??; let inboxes = inboxes .into_iter() + .filter(|i| !i.user_local) .map(|u| -> Result { let url = Url::parse(&u.user_actor_id)?; let domain = url.domain().context(location_info!())?; diff --git a/lemmy_apub/src/inbox/shared_inbox.rs b/lemmy_apub/src/inbox/shared_inbox.rs index b9077ebe..677ceadf 100644 --- a/lemmy_apub/src/inbox/shared_inbox.rs +++ b/lemmy_apub/src/inbox/shared_inbox.rs @@ -60,7 +60,7 @@ pub async fn shared_inbox( ) -> Result { let activity = input.into_inner(); - let json = serde_json::to_string(&activity)?; + let json = serde_json::to_string_pretty(&activity)?; debug!("Shared inbox received activity: {}", json); // TODO: if we already received an activity with identical ID, then ignore this (same in other inboxes) diff --git a/lemmy_db/src/activity.rs b/lemmy_db/src/activity.rs index af2a1ec8..18b6ef00 100644 --- a/lemmy_db/src/activity.rs +++ b/lemmy_db/src/activity.rs @@ -62,11 +62,8 @@ pub fn do_insert_activity( where T: Serialize + Debug, { - debug!( - "inserting activity for user {}, data {:?}", - user_id, - serde_json::to_string_pretty(&data).unwrap() - ); + debug!("inserting activity for user {}: ", user_id); + debug!("{}", serde_json::to_string_pretty(&serde_json::to_value(&data)?)?); let activity_form = ActivityForm { user_id, data: serde_json::to_value(&data)?,