X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModule%2FRandomProfile.php;h=163fec60fbb6da1f8b06d5be5ea45d58f3e99b38;hb=312c01a517369c0b3e1ef818081a780c0d445f93;hp=3ecaa54b7607bc51f32099997380cd47defc64bc;hpb=596e95917e6e8fe929a0a2f9d81c59fa181566df;p=friendica.git diff --git a/src/Module/RandomProfile.php b/src/Module/RandomProfile.php index 3ecaa54b76..163fec60fb 100644 --- a/src/Module/RandomProfile.php +++ b/src/Module/RandomProfile.php @@ -1,27 +1,46 @@ . + * + */ 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() + public static function content(array $parameters = []) { - $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'); } }