Set "object" property value to note ID in Like() and Announce() activities

This commit is contained in:
silverpill 2021-12-12 22:36:20 +00:00
parent 816cae6b78
commit fc153a3156

View file

@ -250,18 +250,12 @@ pub fn create_activity_like(
actor_profile: &DbActorProfile, actor_profile: &DbActorProfile,
object_id: &str, object_id: &str,
) -> Activity { ) -> Activity {
let object = Object {
context: Some(json!(AP_CONTEXT)),
id: object_id.to_string(),
object_type: NOTE.to_string(),
..Default::default()
};
let activity = create_activity( let activity = create_activity(
instance_url, instance_url,
&actor_profile.username, &actor_profile.username,
LIKE, LIKE,
None, None,
object, object_id,
vec![AP_PUBLIC.to_string()], vec![AP_PUBLIC.to_string()],
); );
activity activity
@ -273,18 +267,12 @@ pub fn create_activity_announce(
post: &Post, post: &Post,
) -> Activity { ) -> Activity {
let object_id = post.get_object_id(instance_url); let object_id = post.get_object_id(instance_url);
let object = Object {
context: Some(json!(AP_CONTEXT)),
id: object_id,
object_type: NOTE.to_string(),
..Default::default()
};
let activity = create_activity( let activity = create_activity(
instance_url, instance_url,
&actor_profile.username, &actor_profile.username,
ANNOUNCE, ANNOUNCE,
None, None,
object, object_id,
vec![AP_PUBLIC.to_string()], vec![AP_PUBLIC.to_string()],
); );
activity activity