Adding pretty print for activities.

This commit is contained in:
Dessalines 2020-10-02 09:21:14 -05:00
parent f5b511ccce
commit eef0a5c7e8
2 changed files with 8 additions and 3 deletions

View file

@ -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 mut allowed_instances = Settings::get().get_allowed_instances();
let blocked_instances = Settings::get().get_blocked_instances(); let blocked_instances = Settings::get().get_blocked_instances();
if allowed_instances.is_empty() && blocked_instances.is_empty() {
if !allowed_instances.is_empty() { Ok(())
} else if !allowed_instances.is_empty() {
// need to allow this explicitly because apub activities might contain objects from our local // 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. // instance. split is needed to remove the port in our federation test setup.
allowed_instances.push(local_instance); allowed_instances.push(local_instance);

View file

@ -62,7 +62,11 @@ pub fn do_insert_activity<T>(
where where
T: Serialize + Debug, 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 { let activity_form = ActivityForm {
user_id, user_id,
data: serde_json::to_value(&data)?, data: serde_json::to_value(&data)?,