Fix Comment::create_activity07()

This commit is contained in:
Kitaiti Makoto 2022-04-24 01:37:30 +09:00
parent 9969e844ca
commit 713ffb9506
1 changed files with 8 additions and 4 deletions

View File

@ -211,8 +211,7 @@ impl Comment {
let author = User::get(conn, self.author_id)?; let author = User::get(conn, self.author_id)?;
let note = self.to_activity07(conn)?; let note = self.to_activity07(conn)?;
let to = note.to().ok_or(Error::MissingApProperty)?.clone(); let note_clone = note.clone();
let cc = note.cc().ok_or(Error::MissingApProperty)?.clone();
let mut act = Create07::new( let mut act = Create07::new(
author.into_id().parse::<IriString>()?, author.into_id().parse::<IriString>()?,
@ -225,8 +224,13 @@ impl Comment {
) )
.parse::<IriString>()?, .parse::<IriString>()?,
); );
act.set_many_tos(to); act.set_many_tos(
act.set_many_ccs(cc); 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) Ok(act)
} }