Porównaj commity

..

5 Commity

Autor SHA1 Wiadomość Data
Michael 69fc2c04e4 Issue 13812: Public groups with manual request approval 2024-04-08 07:58:45 +00:00
Tobias Diekershoff 02d8cc2f71
Merge pull request #14076 from annando/follow-vcard
Don't display the "follow/unfollow" vcard-link on pages meant for follow/unfollow
2024-04-08 07:35:16 +02:00
Tobias Diekershoff 0a88d5a94a
Merge pull request #14082 from annando/issue-14055
Issue 14055: Set link to group server for group posts
2024-04-08 07:31:53 +02:00
Michael 8b75aab4ad Don't display the "follow/unfollow" vcard-link on pages meant for follow/unfollow 2024-04-07 21:30:39 +00:00
Michael a2da42640c Issue 14055: Set link to group server for group posts 2024-04-07 15:46:55 +00:00
5 zmienionych plików z 13 dodań i 5 usunięć

Wyświetl plik

@ -43,9 +43,10 @@ class VCard
* @template widget/vcard.tpl
* @param array $contact
* @param bool $hide_mention
* @param bool $hide_follow
* @return string
*/
public static function getHTML(array $contact, bool $hide_mention = false): string
public static function getHTML(array $contact, bool $hide_mention = false, bool $hide_follow = false): string
{
if (!isset($contact['network']) || !isset($contact['id'])) {
Logger::warning('Incomplete contact', ['contact' => $contact ?? []]);
@ -87,7 +88,7 @@ class VCard
}
}
if (empty($contact['self']) && Protocol::supportsFollow($contact['network'])) {
if (!$hide_follow && empty($contact['self']) && Protocol::supportsFollow($contact['network'])) {
if (in_array($rel, [Contact::SHARING, Contact::FRIEND])) {
$unfollow_link = 'contact/unfollow?url=' . urlencode($contact_url) . '&auto=1';
} elseif (!$pending) {

Wyświetl plik

@ -3990,6 +3990,13 @@ class Item
$plink = $item['uri'];
}
if (($item['post-reason'] == self::PR_ANNOUNCEMENT) && ($item['owner-contact-type'] == Contact::TYPE_COMMUNITY) && ($item['owner-network'] == Protocol::DFRN)) {
$contact = Contact::getById($item['owner-id'], ['baseurl']);
if (!empty($contact['baseurl'])) {
$plink = $contact['baseurl'] . '/display/' . $item['guid'];
}
}
if (DI::userSession()->getLocalUserId()) {
$ret = [
'href' => "display/" . $item['guid'],

Wyświetl plik

@ -186,7 +186,7 @@ class Follow extends BaseModule
$this->page['aside'] = '';
if (!in_array($protocol, [Protocol::PHANTOM, Protocol::MAIL])) {
$this->page['aside'] = VCard::getHTML($contact);
$this->page['aside'] = VCard::getHTML($contact, false, true);
$output .= Renderer::replaceMacros(Renderer::getMarkupTemplate('section_title.tpl'),
['$title' => $this->t('Posts and Replies')]

Wyświetl plik

@ -133,7 +133,7 @@ class Unfollow extends \Friendica\BaseModule
'$keywords_label' => ''
]);
$this->page['aside'] = Widget\VCard::getHTML(Contact::getByURL($contact['url'], false));
$this->page['aside'] = Widget\VCard::getHTML(Contact::getByURL($contact['url'], false), false, true);
$o .= Renderer::replaceMacros(Renderer::getMarkupTemplate('section_title.tpl'), ['$title' => $this->t('Posts and Replies')]);

Wyświetl plik

@ -118,7 +118,7 @@ class RemoteFollow extends BaseModule
protected function content(array $request = []): string
{
$this->page['aside'] = Widget\VCard::getHTML($this->owner);
$this->page['aside'] = Widget\VCard::getHTML($this->owner, false, true);
$target_addr = $this->owner['addr'];
$target_url = $this->owner['url'];