diff --git a/src/activity_pub/inbox.rs b/src/activity_pub/inbox.rs index 6b2c624a..1b45b442 100644 --- a/src/activity_pub/inbox.rs +++ b/src/activity_pub/inbox.rs @@ -114,8 +114,8 @@ pub trait Inbox { "Create" => { let act: Create = serde_json::from_value(act.clone())?; match act.object["type"].as_str().unwrap() { - "Article" => self.new_article(conn, act.object_object().unwrap()), - "Note" => self.new_comment(conn, act.object_object().unwrap(), act.actor_object::()?.object_props.id_string()?), + "Article" => self.new_article(conn, act.object_object()?), + "Note" => self.new_comment(conn, act.object_object()?, act.actor_object::()?.object_props.id_string()?), _ => Err(InboxError::InvalidType)? } }, diff --git a/src/models/users.rs b/src/models/users.rs index 79c37ad9..55b3f181 100644 --- a/src/models/users.rs +++ b/src/models/users.rs @@ -439,7 +439,7 @@ impl WithInbox for User { impl Inbox for User { fn received(&self, conn: &PgConnection, act: serde_json::Value) { if let Err(err) = self.save(conn, act.clone()) { - println!("Inbox error:\n{}\n{}", err.cause(), err.backtrace()); + println!("Inbox error:\n{}\n{}\n\nActivity was: {}", err.cause(), err.backtrace(), act.to_string()); } // Notifications