diff options
author | Mario <mario@mariovavti.com> | 2022-10-12 09:47:47 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2022-10-12 09:47:47 +0000 |
commit | a83d2efe84c40b5440e96e1f55c6bce1f7d50232 (patch) | |
tree | 95ca98fd8daa7db77a47f975d006cc882e7817b8 /Zotlabs | |
parent | d3856caf81c96b1ea2615a375122ca85e91a6fb3 (diff) | |
download | volse-hubzilla-a83d2efe84c40b5440e96e1f55c6bce1f7d50232.tar.gz volse-hubzilla-a83d2efe84c40b5440e96e1f55c6bce1f7d50232.tar.bz2 volse-hubzilla-a83d2efe84c40b5440e96e1f55c6bce1f7d50232.zip |
remove dead code and deal with conv privacy mismatches in Activity::store()
Diffstat (limited to 'Zotlabs')
-rw-r--r-- | Zotlabs/Lib/Activity.php | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php index 4ff13bc04..8afdb723a 100644 --- a/Zotlabs/Lib/Activity.php +++ b/Zotlabs/Lib/Activity.php @@ -2995,18 +2995,6 @@ class Activity { set_iconfig($item, 'activitypub', 'recips', $act->raw_recips); - // TODO: inheritPrivacy should probably be set in encode activity. Zap does not do so yet - check what this is about - if (!(isset($act->data['inheritPrivacy']) && $act->data['inheritPrivacy'])) { - if ($item['item_private']) { - $item['item_restrict'] = $item['item_restrict'] & 1; - if ($is_child_node) { - $item['allow_cid'] = '<' . $channel['channel_hash'] . '>'; - $item['allow_gid'] = $item['deny_cid'] = $item['deny_gid'] = ''; - } - logger('restricted'); - } - } - if (intval($act->sigok)) { $item['item_verified'] = 1; } @@ -3054,7 +3042,24 @@ class Activity { $item['thr_parent'] = $parent[0]['parent_mid']; } $item['parent_mid'] = $parent[0]['parent_mid']; - //$item['item_private'] = $parent[0]['item_private']; + + /* + * + * Check for conversation privacy mismatches + * We can only do this if we have a channel and we have fetched the parent + * + */ + + // public conversation, but this comment went rogue and was published privately + // hide it from everybody except the channel owner + + if (intval($parent[0]['item_private']) === 0) { + if (intval($item['item_private'])) { + $item['item_restrict'] = $item['item_restrict'] | 1; + $item['allow_cid'] = '<' . $channel['channel_hash'] . '>'; + $item['allow_gid'] = $item['deny_cid'] = $item['deny_gid'] = ''; + } + } } |