mirror of
https://git.joinplu.me/Plume/Plume.git
synced 2024-11-22 19:41:03 +00:00
Implement Reshare::to_ativity07()
This commit is contained in:
parent
10acbdd41f
commit
d78a57ce47
1 changed files with 15 additions and 0 deletions
|
@ -76,6 +76,21 @@ impl Reshare {
|
|||
Ok(act)
|
||||
}
|
||||
|
||||
pub fn to_activity07(&self, conn: &Connection) -> Result<Announce07> {
|
||||
let mut act = Announce07::new(
|
||||
User::get(conn, self.user_id)?.ap_url.parse::<IriString>()?,
|
||||
Post::get(conn, self.post_id)?.ap_url.parse::<IriString>()?,
|
||||
);
|
||||
act.set_id(self.ap_url.parse::<IriString>()?);
|
||||
act.set_many_tos(vec![PUBLIC_VISIBILITY.parse::<IriString>()?]);
|
||||
act.set_many_ccs(vec![self
|
||||
.get_user(conn)?
|
||||
.followers_endpoint
|
||||
.parse::<IriString>()?]);
|
||||
|
||||
Ok(act)
|
||||
}
|
||||
|
||||
pub fn notify(&self, conn: &Connection) -> Result<()> {
|
||||
let post = self.get_post(conn)?;
|
||||
for author in post.get_authors(conn)? {
|
||||
|
|
Loading…
Reference in a new issue