diff --git a/includes/class-activity-dispatcher.php b/includes/class-activity-dispatcher.php index 422240d..ee435a7 100644 --- a/includes/class-activity-dispatcher.php +++ b/includes/class-activity-dispatcher.php @@ -5,6 +5,8 @@ use Activitypub\Model\Post; use Activitypub\Model\Activity; use Activitypub\Collection\Followers; +use function Activitypub\safe_remote_post; + /** * ActivityPub Activity_Dispatcher Class * @@ -37,7 +39,7 @@ class Activity_Dispatcher { /** * Send "update" activities. * - * @param Activitypub\Model\Post $activitypub_post + * @param Activitypub\Model\Post $activitypub_post The ActivityPub Post. */ public static function send_update_activity( Post $activitypub_post ) { self::send_activity( $activitypub_post, 'Update' ); @@ -46,23 +48,23 @@ class Activity_Dispatcher { /** * Send "delete" activities. * - * @param Activitypub\Model\Post $activitypub_post + * @param Activitypub\Model\Post $activitypub_post The ActivityPub Post. */ public static function send_delete_activity( Post $activitypub_post ) { self::send_activity( $activitypub_post, 'Delete' ); } /** - * Undocumented function + * Send Activities to followers and mentioned users. * - * @param Activitypub\Model\Post $activitypub_post - * @param [type] $activity_type + * @param Activitypub\Model\Post $activitypub_post The ActivityPub Post. + * @param string $activity_type The Activity-Type. * * @return void */ public static function send_activity( Post $activitypub_post, $activity_type ) { // check if a migration is needed before sending new posts - \Activitypub\Migration::maybe_migrate(); + Migration::maybe_migrate(); // get latest version of post $user_id = $activitypub_post->get_post_author(); @@ -79,7 +81,7 @@ class Activity_Dispatcher { foreach ( $inboxes as $inbox ) { $activity = $activitypub_activity->to_json(); - \Activitypub\safe_remote_post( $inbox, $activity, $user_id ); + safe_remote_post( $inbox, $activity, $user_id ); } } } diff --git a/includes/debug.php b/includes/debug.php index a5683f4..d42b2a9 100644 --- a/includes/debug.php +++ b/includes/debug.php @@ -6,7 +6,8 @@ namespace Activitypub; * * @param array $r Array of HTTP request args. * @param string $url The request URL. - * @return array $args Array or string of HTTP request arguments. + * + * @return array Array or string of HTTP request arguments. */ function allow_localhost( $r, $url ) { $r['reject_unsafe_urls'] = false; diff --git a/includes/functions.php b/includes/functions.php index bd04e6c..19a3512 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -43,9 +43,9 @@ function safe_remote_get( $url, $user_id ) { /** * Returns a users WebFinger "resource" * - * @param int $user_id + * @param int $user_id The User-ID. * - * @return string The user-resource + * @return string The User-Resource. */ function get_webfinger_resource( $user_id ) { return Webfinger::get_user_resource( $user_id ); @@ -123,29 +123,24 @@ function get_remote_metadata_by_actor( $actor ) { return $metadata; } -function get_identifier_settings( $user_id ) { - ?> -
- - | -
-
|
-
---|