]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Contact/Follow.php
Merge pull request #12707 from MrPetovan/bug/contact-page
[friendica.git] / src / Module / Contact / Follow.php
index c274769402abe0ce509faa2da0fa8fabab266f82..57e9ff634ab148efe12de562283a934230d43c0b 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2010-2022, the Friendica project
+ * @copyright Copyright (C) 2010-2023, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -88,7 +88,9 @@ class Follow extends BaseModule
                }
 
                $uid = $this->session->getLocalUserId();
-               $url = Probe::cleanURI(trim($request['url'] ?? ''));
+
+               // uri is used by the /authorize_interaction Mastodon route
+               $url = Probe::cleanURI(trim($request['uri'] ?? $request['url'] ?? ''));
 
                // Issue 6874: Allow remote following from Peertube
                if (strpos($url, 'acct:') === 0) {
@@ -103,11 +105,10 @@ class Follow extends BaseModule
 
                // Don't try to add a pending contact
                $userContact = Contact::selectFirst(['pending'], [
-                       "`uid` = ? AND ((`rel` != ?) OR (`network` = ?)) AND (`nurl` = ? OR `alias` = ? OR `alias` = ?) AND `network` != ?",
+                       "`uid` = ? AND ((`rel` != ?) OR (`network` = ?)) AND (`nurl` = ? OR `alias` = ? OR `alias` = ?)",
                        $uid, Contact::FOLLOWER, Protocol::DFRN,
                        Strings::normaliseLink($url),
-                       Strings::normaliseLink($url), $url,
-                       Protocol::STATUSNET]);
+                       Strings::normaliseLink($url), $url]);
 
                if (!empty($userContact['pending'])) {
                        $this->sysMessages->addNotice($this->t('You already added this contact.'));
@@ -187,7 +188,7 @@ class Follow extends BaseModule
                        $this->page['aside'] = VCard::getHTML($contact);
 
                        $output .= Renderer::replaceMacros(Renderer::getMarkupTemplate('section_title.tpl'),
-                               ['$title' => $this->t('Status Messages and Posts')]
+                               ['$title' => $this->t('Posts and Replies')]
                        );
 
                        // Show last public posts