X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModule%2FRandomProfile.php;h=1821211203dd53359ff2c0694f5efdb5abc1779c;hb=e1863951986ba5be173758324a00652bc5af870c;hp=8edc43bf0cf7e07d30d136d2a0c9b99993850309;hpb=bd62d548db39b617d087aabb536435004adf0470;p=friendica.git diff --git a/src/Module/RandomProfile.php b/src/Module/RandomProfile.php index 8edc43bf0c..1821211203 100644 --- a/src/Module/RandomProfile.php +++ b/src/Module/RandomProfile.php @@ -1,27 +1,48 @@ . + * + */ namespace Friendica\Module; use Friendica\BaseModule; +use Friendica\DI; use Friendica\Model\Contact; -use Friendica\Model\GContact; /** * Redirects to a random Friendica profile this node knows about */ class RandomProfile extends BaseModule { - public static function content($parameters) + protected function content(array $request = []): string { - $a = self::getApp(); + $a = DI::app(); - $contactUrl = GContact::getRandomUrl(); + $contact = Contact::getRandomContact(); - if ($contactUrl) { - $link = Contact::magicLink($contactUrl); + if (!empty($contact)) { + $link = Contact::magicLinkByContact($contact); $a->redirect($link); } - $a->internalRedirect('profile'); + DI::baseUrl()->redirect('profile'); + + return ''; } }