Proper Undo Like
This commit is contained in:
parent
be1aadcd4c
commit
5196edafa0
@ -44,15 +44,13 @@ case "Like":
|
||||
Fave::removeEntry($actor_profile, ActivityPubPlugin::get_local_notice_from_url($data->object->object->id));
|
||||
// Notice disfavorited successfully.
|
||||
ActivityPubReturn::answer(
|
||||
Activitypub_undo::undo_to_array(
|
||||
Activitypub_like::like_to_array(
|
||||
Activitypub_notice::notice_to_array(
|
||||
$actor_profile->getUrl(),
|
||||
$data->object->object
|
||||
)
|
||||
)
|
||||
Activitypub_undo::undo_to_array(
|
||||
Activitypub_like::like_to_array(
|
||||
$actor_profile->getUrl(),
|
||||
$data->object->object
|
||||
)
|
||||
)
|
||||
);
|
||||
);
|
||||
} catch (Exception $e) {
|
||||
ActivityPubReturn::error($e->getMessage(), 403);
|
||||
}
|
||||
|
@ -44,8 +44,8 @@ class Activitypub_like extends Managed_DataObject
|
||||
* Generates an ActivityPub representation of a Like
|
||||
*
|
||||
* @author Diogo Cordeiro <diogo@fc.up.pt>
|
||||
* @param string $actor
|
||||
* @param array $object
|
||||
* @param string $actor Actor URI
|
||||
* @param string $object Notice URI
|
||||
* @return pretty array to be used in a response
|
||||
*/
|
||||
public static function like_to_array($actor, $object)
|
||||
|
@ -184,7 +184,7 @@ class Activitypub_postman
|
||||
$data = Activitypub_undo::undo_to_array(
|
||||
Activitypub_like::like_to_array(
|
||||
ActivityPubPlugin::actor_uri($this->actor),
|
||||
Activitypub_notice::notice_to_array($notice)
|
||||
$notice->getUrl()
|
||||
)
|
||||
);
|
||||
$data = json_encode($data);
|
||||
|
Reference in New Issue
Block a user