Implement Like::to_activity07()
This commit is contained in:
parent
6b8d90d8b6
commit
4ea29d29a0
@ -51,6 +51,20 @@ impl Like {
|
|||||||
Ok(act)
|
Ok(act)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn to_activity07(&self, conn: &Connection) -> Result<Like07> {
|
||||||
|
let mut act = Like07::new(
|
||||||
|
User::get(conn, self.user_id)?.ap_url.parse::<IriString>()?,
|
||||||
|
Post::get(conn, self.post_id)?.ap_url.parse::<IriString>()?,
|
||||||
|
);
|
||||||
|
act.set_many_tos(vec![PUBLIC_VISIBILITY.parse::<IriString>()?]);
|
||||||
|
act.set_many_ccs(vec![User::get(conn, self.user_id)?
|
||||||
|
.followers_endpoint
|
||||||
|
.parse::<IriString>()?]);
|
||||||
|
act.set_id(self.ap_url.parse::<IriString>()?);
|
||||||
|
|
||||||
|
Ok(act)
|
||||||
|
}
|
||||||
|
|
||||||
pub fn notify(&self, conn: &Connection) -> Result<()> {
|
pub fn notify(&self, conn: &Connection) -> Result<()> {
|
||||||
let post = Post::get(conn, self.post_id)?;
|
let post = Post::get(conn, self.post_id)?;
|
||||||
for author in post.get_authors(conn)? {
|
for author in post.get_authors(conn)? {
|
||||||
|
Loading…
Reference in New Issue
Block a user