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