aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Lib/Activity.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2023-03-09 18:31:43 +0000
committerMario <mario@mariovavti.com>2023-03-09 18:31:43 +0000
commit198751783623cdcd65701314a81e9c3b75b5dd2e (patch)
tree9fa9a0788a4a948f173a20d5348451ee2a68eb20 /Zotlabs/Lib/Activity.php
parent203d9d651f799710cc38824312b29ba341f1ea0f (diff)
downloadvolse-hubzilla-198751783623cdcd65701314a81e9c3b75b5dd2e.tar.gz
volse-hubzilla-198751783623cdcd65701314a81e9c3b75b5dd2e.tar.bz2
volse-hubzilla-198751783623cdcd65701314a81e9c3b75b5dd2e.zip
only set owner to observer if the item is not fetched otherwise the comment author could end up as owner
Diffstat (limited to 'Zotlabs/Lib/Activity.php')
-rw-r--r--Zotlabs/Lib/Activity.php12
1 files changed, 8 insertions, 4 deletions
diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php
index 817d2851d..171c0150e 100644
--- a/Zotlabs/Lib/Activity.php
+++ b/Zotlabs/Lib/Activity.php
@@ -2855,8 +2855,11 @@ class Activity {
$is_child_node = true;
}
+ if (empty($item['item_fetched'])) {
+ $item['owner_xchan'] = $observer_hash;
+ }
+
$allowed = false;
- $item['owner_xchan'] = $observer_hash;
// TODO: not implemented
// $permit_mentions = intval(PConfig::Get($channel['channel_id'], 'system','permit_all_mentions') && i_am_mentioned($channel,$item));
@@ -2932,7 +2935,7 @@ class Activity {
// The $item['item_fetched'] flag is set in fetch_and_store_parents().
// In this case we should check against author permissions because sender is not owner.
- if (perm_is_allowed($channel['channel_id'], ((isset($item['item_fetched']) && $item['item_fetched']) ? $item['author_xchan'] : $observer_hash), 'send_stream') || $is_sys_channel) {
+ if (perm_is_allowed($channel['channel_id'], ((!empty($item['item_fetched'])) ? $item['author_xchan'] : $observer_hash), 'send_stream') || $is_sys_channel) {
$allowed = true;
}
// TODO: not implemented
@@ -3241,7 +3244,7 @@ class Activity {
$item = $hookinfo['item'];
if ($item) {
- $item['item_fetched'] = 1;
+ $item['item_fetched'] = true;
if (intval($channel['channel_system']) && intval($item['item_private'])) {
$p = [];
@@ -3355,7 +3358,7 @@ class Activity {
return false;
}
- */
+
static public function fetch_and_store_replies($channel, $arr) {
logger('fetching replies');
@@ -3412,6 +3415,7 @@ class Activity {
}
}
+*/
/* this is deprecated and not used anymore
static function announce_note($channel, $observer_hash, $act) {