X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModule%2FRandomProfile.php;h=b61ca7d59ea2d8295ed9255288dfca8a769d1cac;hb=3bca4fe2a64671d09e08346456cdfa6c12f996e9;hp=3ecaa54b7607bc51f32099997380cd47defc64bc;hpb=7a13582c67383a1c74d8926df0c6dfacad2ed3fc;p=friendica.git diff --git a/src/Module/RandomProfile.php b/src/Module/RandomProfile.php index 3ecaa54b76..b61ca7d59e 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() + 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 ''; } }