]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/Contact.php
Remove uneeded variable.
[friendica.git] / src / Model / Contact.php
index 798c9cd20929d9bc996045c90d3ff30ac9a10961..5ae99552235fae196192adf784edd6eb6873296a 100644 (file)
@@ -13,6 +13,7 @@ use Friendica\Core\L10n;
 use Friendica\Core\Logger;
 use Friendica\Core\Protocol;
 use Friendica\Core\System;
+use Friendica\Core\Session;
 use Friendica\Core\Worker;
 use Friendica\Database\DBA;
 use Friendica\Network\Probe;
@@ -1193,7 +1194,7 @@ class Contact extends BaseObject
                $sparkle = false;
                if (($contact['network'] === Protocol::DFRN) && !$contact['self'] && empty($contact['pending'])) {
                        $sparkle = true;
-                       $profile_link = System::baseUrl() . '/redir/' . $contact['id'] . '?url=' . $contact['url'];
+                       $profile_link = System::baseUrl() . '/redir/' . $contact['id'];
                } else {
                        $profile_link = $contact['url'];
                }
@@ -1213,7 +1214,7 @@ class Contact extends BaseObject
                }
 
                if (($contact['network'] == Protocol::DFRN) && !$contact['self'] && empty($contact['pending'])) {
-                       $poke_link = System::baseUrl() . '/poke/?f=&c=' . $contact['id'];
+                       $poke_link = System::baseUrl() . '/poke/?c=' . $contact['id'];
                }
 
                $contact_url = System::baseUrl() . '/contact/' . $contact['id'];
@@ -1480,7 +1481,7 @@ class Contact extends BaseObject
                        $data = Probe::uri($url, "", $uid);
                        // Ensure that there is a gserver entry
                        if (!empty($data['baseurl']) && ($data['network'] != Protocol::PHANTOM)) {
-                               PortableContact::checkServer($data['baseurl']);
+                               GServer::check($data['baseurl']);
                        }
                }
 
@@ -2679,7 +2680,7 @@ class Contact extends BaseObject
         */
        public static function magicLink($contact_url, $url = '')
        {
-               if (!local_user() && !remote_user()) {
+               if (!Session::isAuthenticated()) {
                        return $url ?: $contact_url; // Equivalent to: ($url != '') ? $url : $contact_url;
                }
 
@@ -2725,7 +2726,7 @@ class Contact extends BaseObject
        {
                $destination = $url ?: $contact['url']; // Equivalent to ($url != '') ? $url : $contact['url'];
 
-               if ((!local_user() && !remote_user()) || ($contact['network'] != Protocol::DFRN)) {
+               if (!Session::isAuthenticated() || ($contact['network'] != Protocol::DFRN)) {
                        return $destination;
                }
 
@@ -2744,7 +2745,7 @@ class Contact extends BaseObject
 
                $redirect = 'redir/' . $contact['id'];
 
-               if ($url != '') {
+               if (($url != '') && !Strings::compareLink($contact['url'], $url)) {
                        $redirect .= '?url=' . $url;
                }