From 2e2b6eacd7db07f8809d7717003cfa8160218a1b Mon Sep 17 00:00:00 2001 From: Dessalines Date: Fri, 2 Oct 2020 10:15:26 -0500 Subject: [PATCH] Fixing pretty print again. --- lemmy_apub/src/community.rs | 1 + lemmy_apub/src/inbox/shared_inbox.rs | 2 +- lemmy_db/src/activity.rs | 7 ++----- 3 files changed, 4 insertions(+), 6 deletions(-) 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)?, -- 2.44.1