From 713ffb950602eeffc47fe72bc3f07903ce5c46ab Mon Sep 17 00:00:00 2001 From: Kitaiti Makoto Date: Sun, 24 Apr 2022 01:37:30 +0900 Subject: [PATCH] Fix Comment::create_activity07() --- plume-models/src/comments.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/plume-models/src/comments.rs b/plume-models/src/comments.rs index a0f62f81..37f800c3 100644 --- a/plume-models/src/comments.rs +++ b/plume-models/src/comments.rs @@ -211,8 +211,7 @@ impl Comment { let author = User::get(conn, self.author_id)?; let note = self.to_activity07(conn)?; - let to = note.to().ok_or(Error::MissingApProperty)?.clone(); - let cc = note.cc().ok_or(Error::MissingApProperty)?.clone(); + let note_clone = note.clone(); let mut act = Create07::new( author.into_id().parse::()?, @@ -225,8 +224,13 @@ impl Comment { ) .parse::()?, ); - act.set_many_tos(to); - act.set_many_ccs(cc); + act.set_many_tos( + note_clone + .to() + .iter() + .flat_map(|tos| tos.iter().map(|to| to.to_owned())), + ); + act.set_many_ccs(vec![self.get_author(conn)?.followers_endpoint]); Ok(act) }