aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Lib/Activity.php
diff options
context:
space:
mode:
authorDM42.Net Zap Dev <zapdev@dm42.net>2019-09-21 13:30:42 -0400
committerDM42.Net Zap Dev <zapdev@dm42.net>2019-09-21 13:30:42 -0400
commit6fe4ac241d0dc7710be496a215fc96741856f38a (patch)
treead53d8f64830ef22624f9bad7edad19e89666a7e /Zotlabs/Lib/Activity.php
parentc385b808073fbe9e4422dc0af4c58149e5d6e9d5 (diff)
downloadvolse-hubzilla-6fe4ac241d0dc7710be496a215fc96741856f38a.tar.gz
volse-hubzilla-6fe4ac241d0dc7710be496a215fc96741856f38a.tar.bz2
volse-hubzilla-6fe4ac241d0dc7710be496a215fc96741856f38a.zip
encode/decode comment_policy for Z6
Diffstat (limited to 'Zotlabs/Lib/Activity.php')
-rw-r--r--Zotlabs/Lib/Activity.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php
index ed29bfe6d..6126194bb 100644
--- a/Zotlabs/Lib/Activity.php
+++ b/Zotlabs/Lib/Activity.php
@@ -339,10 +339,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']) {