Found some more follow-links
This commit is contained in:
parent
b5d01337d9
commit
87291e30a4
6 changed files with 8 additions and 11 deletions
|
@ -401,7 +401,7 @@ class Item
|
||||||
|
|
||||||
if ((($cid == 0) || ($rel == Contact::FOLLOWER)) &&
|
if ((($cid == 0) || ($rel == Contact::FOLLOWER)) &&
|
||||||
in_array($item['network'], Protocol::FEDERATED)) {
|
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 {
|
} else {
|
||||||
$menu = [$this->l10n->t('View Profile') => $item['author-link']];
|
$menu = [$this->l10n->t('View Profile') => $item['author-link']];
|
||||||
|
|
|
@ -85,7 +85,7 @@ class VCard
|
||||||
if (in_array($rel, [Contact::SHARING, Contact::FRIEND])) {
|
if (in_array($rel, [Contact::SHARING, Contact::FRIEND])) {
|
||||||
$unfollow_link = 'contact/unfollow?url=' . urlencode($contact['url']) . '&auto=1';
|
$unfollow_link = 'contact/unfollow?url=' . urlencode($contact['url']) . '&auto=1';
|
||||||
} elseif (!$pending) {
|
} elseif (!$pending) {
|
||||||
$follow_link = 'follow?url=' . urlencode($contact['url']) . '&auto=1';
|
$follow_link = 'contact/follow?url=' . urlencode($contact['url']) . '&auto=1';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1178,7 +1178,7 @@ class Contact
|
||||||
if ($contact['uid'] && in_array($contact['rel'], [self::SHARING, self::FRIEND])) {
|
if ($contact['uid'] && in_array($contact['rel'], [self::SHARING, self::FRIEND])) {
|
||||||
$unfollow_link = 'contact/unfollow?url=' . urlencode($contact['url']) . '&auto=1';
|
$unfollow_link = 'contact/unfollow?url=' . urlencode($contact['url']) . '&auto=1';
|
||||||
} elseif(!$contact['pending']) {
|
} elseif(!$contact['pending']) {
|
||||||
$follow_link = 'follow?url=' . urlencode($contact['url']) . '&auto=1';
|
$follow_link = 'contact/follow?url=' . urlencode($contact['url']) . '&auto=1';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -48,20 +48,17 @@ class Follow extends BaseModule
|
||||||
protected $session;
|
protected $session;
|
||||||
/** @var SystemMessages */
|
/** @var SystemMessages */
|
||||||
protected $sysMessages;
|
protected $sysMessages;
|
||||||
/** @var App */
|
|
||||||
protected $app;
|
|
||||||
/** @var IManageConfigValues */
|
/** @var IManageConfigValues */
|
||||||
protected $config;
|
protected $config;
|
||||||
/** @var App\Page */
|
/** @var App\Page */
|
||||||
protected $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);
|
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
||||||
|
|
||||||
$this->session = $session;
|
$this->session = $session;
|
||||||
$this->sysMessages = $sysMessages;
|
$this->sysMessages = $sysMessages;
|
||||||
$this->app = $app;
|
|
||||||
$this->config = $config;
|
$this->config = $config;
|
||||||
$this->page = $page;
|
$this->page = $page;
|
||||||
}
|
}
|
||||||
|
@ -202,9 +199,9 @@ class Follow extends BaseModule
|
||||||
|
|
||||||
protected function process(string $url)
|
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']) {
|
if (!$result['success']) {
|
||||||
// Possibly it is a remote item and not an account
|
// Possibly it is a remote item and not an account
|
||||||
|
|
|
@ -154,7 +154,7 @@ function vier_community_info()
|
||||||
foreach ($contacts as $contact) {
|
foreach ($contacts as $contact) {
|
||||||
$entry = Renderer::replaceMacros($tpl, [
|
$entry = Renderer::replaceMacros($tpl, [
|
||||||
'$id' => $contact['id'],
|
'$id' => $contact['id'],
|
||||||
'$profile_link' => 'follow/?url='.urlencode($contact['url']),
|
'$profile_link' => 'contact/follow/?url='.urlencode($contact['url']),
|
||||||
'$photo' => Contact::getMicro($contact),
|
'$photo' => Contact::getMicro($contact),
|
||||||
'$alt_text' => $contact['name'],
|
'$alt_text' => $contact['name'],
|
||||||
]);
|
]);
|
||||||
|
|
Loading…
Reference in a new issue