aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2022-03-23 19:01:42 +0000
committerMario <mario@mariovavti.com>2022-03-23 19:01:42 +0000
commit62ac0ff21ecf8292e55722cdcdce08fa8bbdb87d (patch)
tree7b175f97a5e0f3281bfb783d6055ad61e62289f3
parenta41c7caa182117b2b7b820550cc20dff8be2c0f0 (diff)
downloadvolse-hubzilla-62ac0ff21ecf8292e55722cdcdce08fa8bbdb87d.tar.gz
volse-hubzilla-62ac0ff21ecf8292e55722cdcdce08fa8bbdb87d.tar.bz2
volse-hubzilla-62ac0ff21ecf8292e55722cdcdce08fa8bbdb87d.zip
streamline comment policy with downstream
-rw-r--r--Zotlabs/Lib/Libzot.php18
-rw-r--r--include/items.php20
2 files changed, 5 insertions, 33 deletions
diff --git a/Zotlabs/Lib/Libzot.php b/Zotlabs/Lib/Libzot.php
index 3003aa516..2ed18d10b 100644
--- a/Zotlabs/Lib/Libzot.php
+++ b/Zotlabs/Lib/Libzot.php
@@ -1294,22 +1294,12 @@ class Libzot {
if ($AS->data['hubloc']) {
$arr['item_verified'] = true;
+ }
- if (!array_key_exists('comment_policy', $arr)) {
- // set comment policy depending on source hub. Unknown or osada is ActivityPub.
- // Anything else we'll say is zot - which could have a range of project names
- $s = q("select site_project from site where site_url = '%s' limit 1",
- dbesc($r[0]['hubloc_url'])
- );
-
- if ((!$s) || (in_array($s[0]['site_project'], ['', 'osada']))) {
- $arr['comment_policy'] = 'authenticated';
- }
- else {
- $arr['comment_policy'] = 'contacts';
- }
- }
+ if (!array_key_exists('comment_policy', $arr)) {
+ $arr['comment_policy'] = 'authenticated';
}
+
if ($AS->meta['signed_data']) {
IConfig::Set($arr, 'activitypub', 'signed_data', $AS->meta['signed_data'], false);
}
diff --git a/include/items.php b/include/items.php
index 10a5a3385..8a2faa623 100644
--- a/include/items.php
+++ b/include/items.php
@@ -1073,21 +1073,6 @@ function encode_item($item,$mirror = false,$zap_compat = false) {
$x['type'] = 'activity';
$x['encoding'] = 'zot';
- $r = q("select channel_id from channel where channel_id = %d limit 1",
- intval($item['uid'])
- );
-
- if($r)
- $comment_scope = PermissionLimits::Get($item['uid'],'post_comments');
- else
- $comment_scope = 0;
-
- $scope = $item['public_policy'];
- if(! $scope)
- $scope = 'public';
-
- $c_scope = map_scope($comment_scope);
-
$key = get_config('system','prvkey');
// If we're trying to backup an item so that it's recoverable or for export/imprt,
@@ -1180,10 +1165,7 @@ function encode_item($item,$mirror = false,$zap_compat = false) {
$x['public_scope'] = $scope;
- if($item['item_nocomment'])
- $x['comment_scope'] = 'none';
- else
- $x['comment_scope'] = $c_scope;
+ $x['comment_scope'] = $item['comment_policy'];
if(! empty($item['term']))
$x['tags'] = encode_item_terms($item['term'],$mirror);