mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-10-01 01:36:12 -04:00
Adding pretty print for activities.
This commit is contained in:
parent
f5b511ccce
commit
eef0a5c7e8
@ -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);
|
||||||
|
@ -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)?,
|
||||||
|
Loading…
Reference in New Issue
Block a user