<?php
+/**
+ * @file mod/randprof.php
+ */
+use Friendica\App;
+use Friendica\Model\Contact;
+use Friendica\Model\GContact;
+function randprof_init(App $a)
+{
+ $x = GContact::getRandomUrl();
-function randprof_init(&$a) {
- require_once('include/Contact.php');
- $x = random_profile();
- if($x)
- goaway($x);
- goaway($a->get_baseurl() . '/profile');
+ if ($x) {
+ $link = Contact::magicLink($x);
+ $a->redirect($link);
+ }
+
+ $a->internalRedirect('profile');
}