X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FObject%2FPost.php;h=847135d3621bf10945d71a652e694c4b9faa4a8f;hb=f40c57fc204ff47a3cf9f7eab75e8a635566275c;hp=3ac5c77ee9545a46674bc4dacd88242688e541ef;hpb=8d84f33f15447e30e61d1266e378bbf6b092b4be;p=friendica.git diff --git a/src/Object/Post.php b/src/Object/Post.php index 3ac5c77ee9..847135d362 100644 --- a/src/Object/Post.php +++ b/src/Object/Post.php @@ -775,19 +775,30 @@ class Post extends BaseObject */ private function getDefaultText() { + if (!local_user()) { + return; + } + + $a = self::getApp(); + $item = Item::selectFirst(['author-addr'], ['id' => $this->getId()]); if (!DBA::isResult($item) || empty($item['author-addr'])) { // Should not happen return ''; } - $text = '@' . $item['author-addr'] . ' '; + if ($item['author-addr'] != $a->profile['addr']) { + $text = '@' . $item['author-addr'] . ' '; + } else { + $text = ''; + } $terms = Term::tagArrayFromItemId($this->getId(), TERM_MENTION); foreach ($terms as $term) { $profile = Contact::getDetailsByURL($term['url']); - if (!empty($profile['addr']) && !strstr($text, $profile['addr'])) { + if (!empty($profile['addr']) && ($profile['contact-type'] != Contact::TYPE_COMMUNITY) && + ($profile['addr'] != $a->profile['addr']) && !strstr($text, $profile['addr'])) { $text .= '@' . $profile['addr'] . ' '; } }