aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Lib/Activity.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2019-09-23 10:10:56 +0200
committerMario <mario@mariovavti.com>2019-09-23 10:10:56 +0200
commitd1fd69337fa87ec10264919ffcb0bbe57f8873d2 (patch)
tree62bac44e09c7bdd617a8f6b6a427fd7fc8bacc24 /Zotlabs/Lib/Activity.php
parentc385b808073fbe9e4422dc0af4c58149e5d6e9d5 (diff)
parent3fc218111adecf59df695e1f6e4f63f361b3dd34 (diff)
downloadvolse-hubzilla-d1fd69337fa87ec10264919ffcb0bbe57f8873d2.tar.gz
volse-hubzilla-d1fd69337fa87ec10264919ffcb0bbe57f8873d2.tar.bz2
volse-hubzilla-d1fd69337fa87ec10264919ffcb0bbe57f8873d2.zip
Merge branch 'encode-comment-policy' into 'dev'
Encode comment policy into AS(Z6) packets. See merge request hubzilla/core!1729
Diffstat (limited to 'Zotlabs/Lib/Activity.php')
-rw-r--r--Zotlabs/Lib/Activity.php12
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']) {