]> git.mxchange.org Git - friendica.git/blobdiff - mod/follow.php
Merge pull request #10300 from annando/issue-10264
[friendica.git] / mod / follow.php
index d47cec76de735472f9f6e66dc3353d17066c889c..ed8e3aa5fee881bd470d308be901fa3adb613809 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2020, Friendica
+ * @copyright Copyright (C) 2010-2021, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -28,6 +28,7 @@ use Friendica\Model\Profile;
 use Friendica\Model\Item;
 use Friendica\Network\Probe;
 use Friendica\Database\DBA;
+use Friendica\Model\Post;
 use Friendica\Model\User;
 use Friendica\Util\Strings;
 
@@ -121,6 +122,10 @@ function follow_content(App $a)
                $request = $contact['request'];
                $tpl = Renderer::getMarkupTemplate('dfrn_request.tpl');
        } else {
+               if (!empty($_REQUEST['auto'])) {
+                       follow_process($a, $contact['url']);
+               }
+       
                $request = DI::baseUrl() . '/follow';
                $tpl = Renderer::getMarkupTemplate('auto_request.tpl');
        }
@@ -137,10 +142,6 @@ function follow_content(App $a)
        // Makes the connection request for friendica contacts easier
        $_SESSION['fastlane'] = $contact['url'];
 
-       if (!empty($_REQUEST['auto'])) {
-               follow_process($a, $contact['url']);
-       }
-
        $o = Renderer::replaceMacros($tpl, [
                '$header'        => DI::l10n()->t('Connect/Follow'),
                '$pls_answer'    => DI::l10n()->t('Please answer the following:'),
@@ -213,7 +214,7 @@ function follow_remote_item($url)
        }
 
        if (!empty($item_id)) {
-               $item = Item::selectFirst(['guid'], ['id' => $item_id]);
+               $item = Post::selectFirst(['guid'], ['id' => $item_id]);
                if (DBA::isResult($item)) {
                        DI::baseUrl()->redirect('display/' . $item['guid']);
                }