diff --git a/plume-models/src/reshares.rs b/plume-models/src/reshares.rs index 05c5cc56..f2e8ee80 100644 --- a/plume-models/src/reshares.rs +++ b/plume-models/src/reshares.rs @@ -76,6 +76,21 @@ impl Reshare { Ok(act) } + pub fn to_activity07(&self, conn: &Connection) -> Result { + let mut act = Announce07::new( + User::get(conn, self.user_id)?.ap_url.parse::()?, + Post::get(conn, self.post_id)?.ap_url.parse::()?, + ); + act.set_id(self.ap_url.parse::()?); + act.set_many_tos(vec![PUBLIC_VISIBILITY.parse::()?]); + act.set_many_ccs(vec![self + .get_user(conn)? + .followers_endpoint + .parse::()?]); + + Ok(act) + } + pub fn notify(&self, conn: &Connection) -> Result<()> { let post = self.get_post(conn)?; for author in post.get_authors(conn)? {