]> git.mxchange.org Git - friendica.git/blobdiff - src/Object/Post.php
No implicit mention for top level Diaspora comments
[friendica.git] / src / Object / Post.php
index 34f46f7978480bb641afa567272cb5bb6aa54679..156b602e90575b5e8c1eb07a2d4ce29cf85871a0 100644 (file)
@@ -307,17 +307,15 @@ class Post
 
                if ($this->isToplevel()) {
                        if(local_user()) {
-                               $thread = PostModel::selectFirstThreadForUser(local_user(), ['ignored'], ['iid' => $item['id']]);
-                               if (DBA::isResult($thread)) {
-                                       $ignore = [
-                                               'do'        => DI::l10n()->t("ignore thread"),
-                                               'undo'      => DI::l10n()->t("unignore thread"),
-                                               'toggle'    => DI::l10n()->t("toggle ignore status"),
-                                               'classdo'   => $thread['ignored'] ? "hidden" : "",
-                                               'classundo' => $thread['ignored'] ? "" : "hidden",
-                                               'ignored'   => DI::l10n()->t('ignored'),
-                                       ];
-                               }
+                               $ignored = PostModel\ThreadUser::getIgnored($item['uri-id'], local_user());
+                               $ignore = [
+                                       'do'        => DI::l10n()->t("ignore thread"),
+                                       'undo'      => DI::l10n()->t("unignore thread"),
+                                       'toggle'    => DI::l10n()->t("toggle ignore status"),
+                                       'classdo'   => $ignored ? "hidden" : "",
+                                       'classundo' => $ignored ? "" : "hidden",
+                                       'ignored'   => DI::l10n()->t('ignored'),
+                               ];
 
                                if ($conv->getProfileOwner() == local_user() && ($item['uid'] != 0)) {
                                        if ($origin) {
@@ -883,13 +881,13 @@ class Post
                        return '';
                }
 
-               $item = PostModel::selectFirst(['author-addr', 'uri-id'], ['id' => $this->getId()]);
+               $item = PostModel::selectFirst(['author-addr', 'uri-id', 'network', 'gravity'], ['id' => $this->getId()]);
                if (!DBA::isResult($item) || empty($item['author-addr'])) {
                        // Should not happen
                        return '';
                }
 
-               if ($item['author-addr'] != $owner['addr']) {
+               if (($item['author-addr'] != $owner['addr']) && (($item['gravity'] != GRAVITY_PARENT) || !in_array($item['network'], [Protocol::DIASPORA]))) {
                        $text = '@' . $item['author-addr'] . ' ';
                } else {
                        $text = '';