]> git.mxchange.org Git - friendica.git/commitdiff
Found some more follow-links
authorPhilipp <admin@philipp.info>
Mon, 31 Oct 2022 18:10:30 +0000 (19:10 +0100)
committerPhilipp <admin@philipp.info>
Mon, 31 Oct 2022 19:58:34 +0000 (20:58 +0100)
src/Content/Item.php
src/Content/Widget/VCard.php
src/Model/Contact.php
src/Module/Contact/Follow.php
static/routes.config.php
view/theme/vier/theme.php

index 3d6443fe3fc2c625d890754717bb1fd0ee2ca845..c867582b94697ad3756dadb6e0250b428ed38074 100644 (file)
@@ -401,7 +401,7 @@ class Item
 
                        if ((($cid == 0) || ($rel == Contact::FOLLOWER)) &&
                                in_array($item['network'], Protocol::FEDERATED)) {
-                               $menu[$this->l10n->t('Connect/Follow')] = 'follow?url=' . urlencode($item['author-link']) . '&auto=1';
+                               $menu[$this->l10n->t('Connect/Follow')] = 'contact/follow?url=' . urlencode($item['author-link']) . '&auto=1';
                        }
                } else {
                        $menu = [$this->l10n->t('View Profile') => $item['author-link']];
index 1edbf63c8c17e9af3a7e7b4eeb73d0d120a7594d..adb77319c08a9638c36144084b5f00e48e1730ef 100644 (file)
@@ -85,7 +85,7 @@ class VCard
                                if (in_array($rel, [Contact::SHARING, Contact::FRIEND])) {
                                        $unfollow_link = 'contact/unfollow?url=' . urlencode($contact['url']) . '&auto=1';
                                } elseif (!$pending) {
-                                       $follow_link = 'follow?url=' . urlencode($contact['url']) . '&auto=1';
+                                       $follow_link = 'contact/follow?url=' . urlencode($contact['url']) . '&auto=1';
                                }
                        }
 
index 0ae7003f05df1666d7b8bf2506db484bf952d31c..7c83e035119faa0eb41f77a6bbc9512ffa5495c4 100644 (file)
@@ -1178,7 +1178,7 @@ class Contact
                        if ($contact['uid'] && in_array($contact['rel'], [self::SHARING, self::FRIEND])) {
                                $unfollow_link = 'contact/unfollow?url=' . urlencode($contact['url']) . '&auto=1';
                        } elseif(!$contact['pending']) {
-                               $follow_link = 'follow?url=' . urlencode($contact['url']) . '&auto=1';
+                               $follow_link = 'contact/follow?url=' . urlencode($contact['url']) . '&auto=1';
                        }
                }
 
index fe523f491e9190ad5f2321b89bafeec217cd55e2..0e1e129e920cdea1c3aa283efa52f60d6be59e04 100644 (file)
@@ -48,20 +48,17 @@ class Follow extends BaseModule
        protected $session;
        /** @var SystemMessages */
        protected $sysMessages;
-       /** @var App */
-       protected $app;
        /** @var IManageConfigValues */
        protected $config;
        /** @var App\Page */
        protected $page;
 
-       public function __construct(L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IHandleUserSessions $session, SystemMessages $sysMessages, App $app, IManageConfigValues $config, App\Page $page, array $server, array $parameters = [])
+       public function __construct(L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IHandleUserSessions $session, SystemMessages $sysMessages, IManageConfigValues $config, App\Page $page, array $server, array $parameters = [])
        {
                parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
 
                $this->session     = $session;
                $this->sysMessages = $sysMessages;
-               $this->app         = $app;
                $this->config      = $config;
                $this->page        = $page;
        }
@@ -202,9 +199,9 @@ class Follow extends BaseModule
 
        protected function process(string $url)
        {
-               $returnPath = 'follow?url=' . urlencode($url);
+               $returnPath = 'contact/follow?url=' . urlencode($url);
 
-               $result = Contact::createFromProbeForUser($this->app->getLoggedInUserId(), $url);
+               $result = Contact::createFromProbeForUser($this->session->getLocalUserId(), $url);
 
                if (!$result['success']) {
                        // Possibly it is a remote item and not an account
index d21e9efae5b11822ce4a490abffe3f98a1cceec1..2b7f5b98da46237982e19757f77db42aa11cdd3a 100644 (file)
@@ -387,7 +387,7 @@ return [
                '/hidden'                     => [Module\Contact::class,           [R::GET]],
                '/ignored'                    => [Module\Contact::class,           [R::GET]],
                '/hovercard'                  => [Module\Contact\Hovercard::class, [R::GET]],
-               '/follow[/{url}]'                 => [Module\Contact\Follow::class,    [R::GET, R::POST]],
+               '/follow[/{url}]'             => [Module\Contact\Follow::class,    [R::GET, R::POST]],
                '/unfollow'                   => [Module\Contact\Unfollow::class,  [R::GET, R::POST]],
        ],
 
index 2d313cb29edf46b52da1581733c518698842c084..bb647bc638accb7b011fcfe72019143ff1a736ba 100644 (file)
@@ -154,7 +154,7 @@ function vier_community_info()
                        foreach ($contacts as $contact) {
                                $entry = Renderer::replaceMacros($tpl, [
                                        '$id' => $contact['id'],
-                                       '$profile_link' => 'follow/?url='.urlencode($contact['url']),
+                                       '$profile_link' => 'contact/follow/?url='.urlencode($contact['url']),
                                        '$photo' => Contact::getMicro($contact),
                                        '$alt_text' => $contact['name'],
                                ]);