Fix for the automatic mentioning
authorMichael <heluecht@pirati.ca>
Sun, 10 Mar 2019 05:41:40 +0000 (05:41 +0000)
committerMichael <heluecht@pirati.ca>
Sun, 10 Mar 2019 05:41:40 +0000 (05:41 +0000)
src/Object/Post.php

index 807c2d2..a4e3aed 100644 (file)
@@ -806,10 +806,9 @@ class Post extends BaseObject
                }
 
                $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_COMMUNITY) &&
                                ($profile['addr'] != $owner['addr']) && !strstr($text, $profile['addr'])) {
                                $text .= '@' . $profile['addr'] . ' ';
                        }