From: Dessalines Date: Fri, 2 Oct 2020 14:21:14 +0000 (-0500) Subject: Adding pretty print for activities. X-Git-Url: http://these/git/%22https:/nerdica.net/photo/contact/80/maint-mode.css?a=commitdiff_plain;h=eef0a5c7e83636d5d0579d3f0a41b5a22fc18b06;p=lemmy.git Adding pretty print for activities. --- diff --git a/lemmy_apub/src/lib.rs b/lemmy_apub/src/lib.rs index 1f6e75e4..555bdccc 100644 --- a/lemmy_apub/src/lib.rs +++ b/lemmy_apub/src/lib.rs @@ -102,8 +102,9 @@ fn check_is_apub_id_valid(apub_id: &Url) -> Result<(), LemmyError> { let mut allowed_instances = Settings::get().get_allowed_instances(); let blocked_instances = Settings::get().get_blocked_instances(); - - if !allowed_instances.is_empty() { + if allowed_instances.is_empty() && blocked_instances.is_empty() { + Ok(()) + } else if !allowed_instances.is_empty() { // need to allow this explicitly because apub activities might contain objects from our local // instance. split is needed to remove the port in our federation test setup. allowed_instances.push(local_instance); diff --git a/lemmy_db/src/activity.rs b/lemmy_db/src/activity.rs index c3f0ab67..af2a1ec8 100644 --- a/lemmy_db/src/activity.rs +++ b/lemmy_db/src/activity.rs @@ -62,7 +62,11 @@ pub fn do_insert_activity( where T: Serialize + Debug, { - debug!("inserting activity for user {}, data {:?}", user_id, &data); + debug!( + "inserting activity for user {}, data {:?}", + user_id, + serde_json::to_string_pretty(&data).unwrap() + ); let activity_form = ActivityForm { user_id, data: serde_json::to_value(&data)?,