aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2025-02-28 20:28:49 +0000
committerMario <mario@mariovavti.com>2025-02-28 20:28:49 +0000
commit84d63b3b67887881e0341ca067b75b0c433db45c (patch)
treec52d21cfcf1368cf552101ce55e8bd0280f88ca6 /Zotlabs
parent65156a0e4d5c13cdc32a256daafc952222abe323 (diff)
downloadvolse-hubzilla-84d63b3b67887881e0341ca067b75b0c433db45c.tar.gz
volse-hubzilla-84d63b3b67887881e0341ca067b75b0c433db45c.tar.bz2
volse-hubzilla-84d63b3b67887881e0341ca067b75b0c433db45c.zip
fix $owner_hash not set correctly when editing and some whitespace fixes
Diffstat (limited to 'Zotlabs')
-rw-r--r--Zotlabs/Module/Item.php40
1 files changed, 20 insertions, 20 deletions
diff --git a/Zotlabs/Module/Item.php b/Zotlabs/Module/Item.php
index 443f22ad1..cd024b083 100644
--- a/Zotlabs/Module/Item.php
+++ b/Zotlabs/Module/Item.php
@@ -383,6 +383,7 @@ class Item extends Controller {
$r = q("select * from xchan where xchan_hash = '%s' limit 1",
dbesc($channel['channel_hash'])
);
+
if ($r && count($r)) {
$owner_xchan = $r[0];
}
@@ -486,6 +487,7 @@ class Item extends Controller {
$thr_parent = $orig_post['thr_parent'];
$parent_mid = $orig_post['parent_mid'];
$plink = $orig_post['plink'];
+ $owner_hash = $orig_post['owner_xchan'];
}
else {
if (!$walltowall) {
@@ -821,28 +823,26 @@ class Item extends Controller {
$mid = $mid ?? z_root() . '/item/' . $uuid;
- // Set the conversation target.
- if (empty($owner_hash)) {
- $owner_hash = $owner_xchan['xchan_hash'];
- }
-
- if ($owner_hash === $channel['channel_hash']) {
- $attributedTo = z_root() . '/channel/' . $channel['channel_address'];
-
- $conversation = isset($parent_item) ? $parent_item['mid'] : $mid;
- $datarray['target'] = [
- 'id' => str_replace('/item/', '/conversation/', $conversation),
- 'type' => 'Collection',
- 'attributedTo' => $attributedTo,
- ];
- $datarray['tgt_type'] = 'Collection';
- }
- elseif (!empty($parent_item['target'])) {
- $datarray['target'] = $parent_item['target'];
- $datarray['tgt_type'] = $parent_item['tgt_type'];
- }
+ if (empty($owner_hash)) {
+ $owner_hash = $owner_xchan['xchan_hash'];
+ }
+ // Set the conversation target.
+ if ($owner_hash === $channel['channel_hash']) {
+ $attributedTo = z_root() . '/channel/' . $channel['channel_address'];
+ $conversation = isset($parent_item) ? $parent_item['mid'] : $mid;
+ $datarray['target'] = [
+ 'id' => str_replace('/item/', '/conversation/', $conversation),
+ 'type' => 'Collection',
+ 'attributedTo' => $attributedTo,
+ ];
+ $datarray['tgt_type'] = 'Collection';
+ }
+ elseif (!empty($parent_item['target'])) {
+ $datarray['target'] = $parent_item['target'];
+ $datarray['tgt_type'] = $parent_item['tgt_type'];
+ }
if ($is_poll) {
$poll = [