From b883b9c983773f51965680af813dd7e930823460 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Fri, 6 Oct 2017 21:30:44 +0200 Subject: enable anonymous comments also in /display --- Zotlabs/Lib/ThreadItem.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs/Lib') diff --git a/Zotlabs/Lib/ThreadItem.php b/Zotlabs/Lib/ThreadItem.php index d916ce2c1..67a507025 100644 --- a/Zotlabs/Lib/ThreadItem.php +++ b/Zotlabs/Lib/ThreadItem.php @@ -758,7 +758,7 @@ class ThreadItem { '$cipher' => $conv->get_cipher(), '$sourceapp' => \App::$sourcename, '$observer' => get_observer_hash(), - '$anoncomments' => (($conv->get_mode() === 'channel' && perm_is_allowed($conv->get_profile_owner(),'','post_comments')) ? true : false), + '$anoncomments' => ((($conv->get_mode() === 'channel' || $conv->get_mode() === 'display') && perm_is_allowed($conv->get_profile_owner(),'','post_comments')) ? true : false), '$anonname' => [ 'anonname', t('Your full name (required)') ], '$anonmail' => [ 'anonmail', t('Your email address (required)') ], '$anonurl' => [ 'anonurl', t('Your website URL (optional)') ] -- cgit v1.2.3 From 9bd30eb8bf0299e62a975f4f8ba0a868e5789417 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Fri, 6 Oct 2017 21:32:06 +0200 Subject: to find out if a comment is to be moderated we need to look at the actual comment not at its parent --- Zotlabs/Lib/Enotify.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'Zotlabs/Lib') diff --git a/Zotlabs/Lib/Enotify.php b/Zotlabs/Lib/Enotify.php index 9f3347d19..6513bcda7 100644 --- a/Zotlabs/Lib/Enotify.php +++ b/Zotlabs/Lib/Enotify.php @@ -97,6 +97,7 @@ class Enotify { $title = $i['title']; $body = $i['body']; $private = (($i['item_private']) || intval($i['item_obscured'])); + $moderated = (($i['item_blocked'] == ITEM_MODERATED) ? true : false); } else { $title = $params['item']['title']; @@ -170,8 +171,6 @@ class Enotify { xchan_query($p); - $moderated = (($p[0]['item_blocked'] == ITEM_MODERATED) ? true : false); - $item_post_type = item_post_type($p[0]); // $private = $p[0]['item_private']; $parent_id = $p[0]['id']; -- cgit v1.2.3 From e7c8012794ffe6ac746223a9d67fa338f7360c57 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Fri, 6 Oct 2017 22:25:53 +0200 Subject: no need to move $modrated check up --- Zotlabs/Lib/Enotify.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Zotlabs/Lib') diff --git a/Zotlabs/Lib/Enotify.php b/Zotlabs/Lib/Enotify.php index 6513bcda7..e82c11a35 100644 --- a/Zotlabs/Lib/Enotify.php +++ b/Zotlabs/Lib/Enotify.php @@ -97,7 +97,6 @@ class Enotify { $title = $i['title']; $body = $i['body']; $private = (($i['item_private']) || intval($i['item_obscured'])); - $moderated = (($i['item_blocked'] == ITEM_MODERATED) ? true : false); } else { $title = $params['item']['title']; @@ -131,7 +130,9 @@ class Enotify { if ($params['type'] == NOTIFY_COMMENT) { // logger("notification: params = " . print_r($params, true), LOGGER_DEBUG); - $itemlink = $params['link']; + $moderated = (($params['item']['item_blocked'] == ITEM_MODERATED) ? true : false); + + $itemlink = $params['link']; // ignore like/unlike activity on posts - they probably require a separate notification preference -- cgit v1.2.3