aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Lib
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2024-01-22 09:09:41 +0000
committerMario <mario@mariovavti.com>2024-01-22 09:09:41 +0000
commitb0664f7349c60183f0cb9597bd02b741d3c165c8 (patch)
tree4fa48e0c3b2761e0dc6d132f45a236ee838061c1 /Zotlabs/Lib
parent9cfd1c231843214351c81273622e848af4db7a45 (diff)
downloadvolse-hubzilla-b0664f7349c60183f0cb9597bd02b741d3c165c8.tar.gz
volse-hubzilla-b0664f7349c60183f0cb9597bd02b741d3c165c8.tar.bz2
volse-hubzilla-b0664f7349c60183f0cb9597bd02b741d3c165c8.zip
store the original announce actor (the one that pushed the item into our stream first) in source_xchan instead of owner_xchan. this way we will preserve the real owner for the thread and not have conflicts when dealing with deletes of comments or likes
Diffstat (limited to 'Zotlabs/Lib')
-rw-r--r--Zotlabs/Lib/Activity.php8
-rw-r--r--Zotlabs/Lib/ThreadItem.php6
2 files changed, 9 insertions, 5 deletions
diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php
index 2bf8543b2..1f36177bd 100644
--- a/Zotlabs/Lib/Activity.php
+++ b/Zotlabs/Lib/Activity.php
@@ -3368,12 +3368,10 @@ class Activity {
}
if ($announce_init) {
- // If the fetch was initiated by an announce activity
- // do not set item fetched. This way the owner will be set to the
- // observer -> the announce actor
- unset($item['item_fetched']);
+ // Store the sender of the initial announce
+ $item['source_xchan'] = $observer_hash;
$item['verb'] = 'Announce';
- $item['parent_mid'] = $item['mid'];
+ $item['parent_mid'] = $item['thr_parent'] = $item['mid'];
$item['item_thread_top'] = 1;
}
diff --git a/Zotlabs/Lib/ThreadItem.php b/Zotlabs/Lib/ThreadItem.php
index e7d6e33f8..77f26c386 100644
--- a/Zotlabs/Lib/ThreadItem.php
+++ b/Zotlabs/Lib/ThreadItem.php
@@ -907,6 +907,12 @@ class ThreadItem {
$this->owner_name = $this->data['owner']['xchan_name'];
$this->wall_to_wall = true;
}
+ elseif($this->is_toplevel() && $this->get_data_value('verb') === 'Announce' && isset($this->data['source'])) {
+ $this->owner_url = chanlink_hash($this->data['source']['xchan_hash']);
+ $this->owner_photo = $this->data['source']['xchan_photo_s'];
+ $this->owner_name = $this->data['source']['xchan_name'];
+ $this->wall_to_wall = true;
+ }
}
private function is_wall_to_wall() {