]> git.mxchange.org Git - friendica.git/blobdiff - src/Content/Item.php
set ! and @ on mentioning in hover-card
[friendica.git] / src / Content / Item.php
index f2b4d9600b7cc3e732aa981d57960555c18d0407..9e50602df6f3e579839a8451195b809fd9345d91 100644 (file)
@@ -432,10 +432,12 @@ class Item
                                $this->l10n->t('Network Posts') => $posts_link,
                                $this->l10n->t('View Contact') => $contact_url,
                                $this->l10n->t('Send PM') => $pm_url,
+                               $this->l10n->t('Mention') => $mention_url,
+                               $this->l10n->t('Post to group') => $mention_url,
                                $this->l10n->t('Block') => $block_link,
                                $this->l10n->t('Ignore') => $ignore_link,
                                $this->l10n->t('Collapse') => $collapse_link,
-                               $this->l10n->t("Ignore %s's server", $item['author-name']) => $ignoreserver_link,
+                               $this->l10n->t("Ignore %s server", $authorBaseUri->getHost()) => $ignoreserver_link,
                        ];
 
                        if (!empty($item['language'])) {
@@ -638,7 +640,7 @@ class Item
                        $body = $item['body'];
                }
 
-               if (empty($item['quote-uri-id'])) {
+               if (empty($item['quote-uri-id']) || ($item['quote-uri-id'] == $item['uri-id'])) {
                        return $body;
                }
 
@@ -729,7 +731,7 @@ class Item
         */
        public function getSharedPost(array $item, array $fields = []): array
        {
-               if (!empty($item['quote-uri-id'])) {
+               if (!empty($item['quote-uri-id']) && ($item['quote-uri-id'] != $item['uri-id'])) {
                        $shared = Post::selectFirst($fields, ['uri-id' => $item['quote-uri-id'], 'uid' => [0, $item['uid'] ?? 0]]);
                        if (is_array($shared)) {
                                return [
@@ -770,7 +772,7 @@ class Item
                        return $attributes;
                }
 
-               if (!empty($item['quote-uri-id'])) {
+               if (!empty($item['quote-uri-id']) && ($item['quote-uri-id'] != $item['uri-id'])) {
                        $shared = Post::selectFirst(['author-name', 'author-link', 'author-avatar', 'plink', 'created', 'guid', 'uri', 'body'], ['uri-id' => $item['quote-uri-id']]);
                        if (!empty($shared)) {
                                return [