Issue 5158: Ignore all threads, even public ones (#5588)

* Issue 5158: Ignore all threads, even public ones

* Remove some notice

* Now it really should work

* Using "defaults"
This commit is contained in:
Michael Vogel 2018-08-08 22:32:11 +02:00 committed by Hypolite Petovan
parent 50e1512014
commit 276abfaba6
7 changed files with 61 additions and 44 deletions

View file

@ -252,6 +252,18 @@ class Post extends BaseObject
$tagger = '';
if ($this->isToplevel()) {
$thread = Item::selectFirstThreadForUser(local_user(), ['ignored'], ['iid' => $item['id']]);
if (DBA::isResult($thread)) {
$ignore = [
'do' => L10n::t("ignore thread"),
'undo' => L10n::t("unignore thread"),
'toggle' => L10n::t("toggle ignore status"),
'classdo' => $thread['ignored'] ? "hidden" : "",
'classundo' => $thread['ignored'] ? "" : "hidden",
'ignored' => L10n::t('ignored'),
];
}
if ($conv->getProfileOwner() == local_user() && ($item['uid'] != 0)) {
$isstarred = (($item['starred']) ? "starred" : "unstarred");
@ -264,18 +276,6 @@ class Post extends BaseObject
'starred' => L10n::t('starred'),
];
$thread = DBA::selectFirst('thread', ['ignored'], ['uid' => $item['uid'], 'iid' => $item['id']]);
if (DBA::isResult($thread)) {
$ignore = [
'do' => L10n::t("ignore thread"),
'undo' => L10n::t("unignore thread"),
'toggle' => L10n::t("toggle ignore status"),
'classdo' => $thread['ignored'] ? "hidden" : "",
'classundo' => $thread['ignored'] ? "" : "hidden",
'ignored' => L10n::t('ignored'),
];
}
if (Feature::isEnabled($conv->getProfileOwner(), 'commtag')) {
$tagger = [
'add' => L10n::t("add tag"),