]> git.mxchange.org Git - friendica.git/blobdiff - src/Object/Post.php
Merge pull request #7242 from nupplaphil/bugs/6917-php_warning
[friendica.git] / src / Object / Post.php
index e24607a7878c96d21ea0c24be1654f3837e7eb4f..a8577dd8bedda9ad7e62db6425b28341f71e99f7 100644 (file)
@@ -83,7 +83,7 @@ class Post extends BaseObject
                $author = ['uid' => 0, 'id' => $this->getDataValue('author-id'),
                        'network' => $this->getDataValue('author-network'),
                        'url' => $this->getDataValue('author-link')];
-               $this->redirect_url = Contact::magicLinkbyContact($author);
+               $this->redirect_url = Contact::magicLinkByContact($author);
                if (!$this->isToplevel()) {
                        $this->threaded = true;
                }
@@ -224,7 +224,7 @@ class Post extends BaseObject
                        'network' => $item['author-network'], 'url' => $item['author-link']];
 
                if (local_user() || remote_user()) {
-                       $profile_link = Contact::magicLinkbyContact($author);
+                       $profile_link = Contact::magicLinkByContact($author);
                } else {
                        $profile_link = $item['author-link'];
                }
@@ -238,7 +238,7 @@ class Post extends BaseObject
                $location = ((strlen($locate['html'])) ? $locate['html'] : render_location_dummy($locate));
 
                // process action responses - e.g. like/dislike/attend/agree/whatever
-               $response_verbs = ['like', 'dislike'];
+               $response_verbs = ['like', 'dislike', 'announce'];
 
                $isevent = false;
                $attend = [];
@@ -366,6 +366,7 @@ class Post extends BaseObject
                        'tags'            => $tags['tags'],
                        'hashtags'        => $tags['hashtags'],
                        'mentions'        => $tags['mentions'],
+                       'implicit_mentions' => $tags['implicit_mentions'],
                        'txt_cats'        => L10n::t('Categories:'),
                        'txt_folders'     => L10n::t('Filed under:'),
                        'has_cats'        => ((count($categories)) ? 'true' : ''),
@@ -804,11 +805,10 @@ class Post extends BaseObject
                        $text = '';
                }
 
-               $terms = Term::tagArrayFromItemId($this->getId(), TERM_MENTION);
-
+               $terms = Term::tagArrayFromItemId($this->getId(), [Term::MENTION, Term::IMPLICIT_MENTION]);
                foreach ($terms as $term) {
                        $profile = Contact::getDetailsByURL($term['url']);
-                       if (!empty($profile['addr']) && !empty($profile['contact-type']) && ($profile['contact-type'] != Contact::TYPE_COMMUNITY) &&
+                       if (!empty($profile['addr']) && (defaults($profile, 'contact-type', Contact::TYPE_UNKNOWN) != Contact::TYPE_COMMUNITY) &&
                                ($profile['addr'] != $owner['addr']) && !strstr($text, $profile['addr'])) {
                                $text .= '@' . $profile['addr'] . ' ';
                        }
@@ -948,7 +948,7 @@ class Post extends BaseObject
                                                $owner = ['uid' => 0, 'id' => $this->getDataValue('owner-id'),
                                                        'network' => $this->getDataValue('owner-network'),
                                                        'url' => $this->getDataValue('owner-link')];
-                                               $this->owner_url = Contact::magicLinkbyContact($owner);
+                                               $this->owner_url = Contact::magicLinkByContact($owner);
                                        }
                                }
                        }