diff options
Diffstat (limited to 'Zotlabs/Lib/Activity.php')
-rw-r--r-- | Zotlabs/Lib/Activity.php | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php index ed29bfe6d..771c6875b 100644 --- a/Zotlabs/Lib/Activity.php +++ b/Zotlabs/Lib/Activity.php @@ -2,6 +2,7 @@ namespace Zotlabs\Lib; +use Zotlabs\Access\PermissionLimits; use Zotlabs\Daemon\Master; use Zotlabs\Web\HTTPSig; @@ -339,10 +340,21 @@ class Activity { } } + if (intval($i['item_wall']) && $i['mid'] === $i['parent_mid']) { + $ret['commentPolicy'] = map_scope(PermissionLimits::Get($i['uid'],'post_comments')); + } + if (intval($i['item_private']) === 2) { $ret['directMessage'] = true; } + if (array_key_exists('comments_closed',$i) && $i['comments_closed'] !== EMPTY_STR && $i['comments_closed'] !== NULL_DATE) { + if($ret['commentPolicy']) { + $ret['commentPolicy'] .= ' '; + } + $ret['commentPolicy'] .= 'until=' . datetime_convert('UTC','UTC',$i['comments_closed'],ATOM_TIME); + } + $ret['attributedTo'] = $i['author']['xchan_url']; if($i['id'] != $i['parent']) { |