aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2023-05-15 08:03:27 +0000
committerMario <mario@mariovavti.com>2023-05-15 08:03:27 +0000
commitb50da2d8b783745d2dde3e82c5809effafd9b7d5 (patch)
tree0e40082173670f3aa0f4d6f5b7793c2cf79247a7
parent29e8e6d95c469c08cff7cd615319d1059f57e22e (diff)
downloadvolse-hubzilla-b50da2d8b783745d2dde3e82c5809effafd9b7d5.tar.gz
volse-hubzilla-b50da2d8b783745d2dde3e82c5809effafd9b7d5.tar.bz2
volse-hubzilla-b50da2d8b783745d2dde3e82c5809effafd9b7d5.zip
fix parent_mid and thr_parent not set correctly for response activities
-rw-r--r--Zotlabs/Daemon/Zotconvo.php7
-rw-r--r--Zotlabs/Lib/Activity.php16
-rw-r--r--Zotlabs/Lib/ActivityStreams.php1
3 files changed, 18 insertions, 6 deletions
diff --git a/Zotlabs/Daemon/Zotconvo.php b/Zotlabs/Daemon/Zotconvo.php
index 3d6162473..16e7f113f 100644
--- a/Zotlabs/Daemon/Zotconvo.php
+++ b/Zotlabs/Daemon/Zotconvo.php
@@ -14,11 +14,12 @@ class Zotconvo {
return;
}
- $channel_id = intval($argv[1]);
$mid = $argv[2];
+ if (!$mid) {
+ return;
+ }
- $channel = channelx_by_n($channel_id);
-
+ $channel = channelx_by_n(intval($argv[1]));
if (!$channel) {
return;
}
diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php
index bb3695341..fcf3fb172 100644
--- a/Zotlabs/Lib/Activity.php
+++ b/Zotlabs/Lib/Activity.php
@@ -2304,9 +2304,18 @@ class Activity {
$response_activity = true;
$s['mid'] = $act->id;
- $s['uuid'] = (($act->data['diaspora:guid']) ?: uuid_from_url($s['mid']));
+ $s['uuid'] = ((!empty($act->data['diaspora:guid'])) ? $act->data['diaspora:guid'] : uuid_from_url($s['mid']));
- $s['parent_mid'] = $act->objprop('id') ?: $act->obj;
+ if ($act->objprop('inReplyTo')) {
+ $s['parent_mid'] = $act->objprop('inReplyTo');
+ }
+
+ $s['thr_parent'] = $act->objprop('id') ?: $act->obj;
+
+ if (empty($s['parent_mid']) || empty($s['thr_parent'])) {
+ logger('response activity without parent_mid or thr_parent');
+ return;
+ }
// over-ride the object timestamp with the activity
@@ -2844,7 +2853,6 @@ class Activity {
];
call_hooks('decode_note', $hookinfo);
-
return $hookinfo['s'];
}
@@ -3092,6 +3100,7 @@ class Activity {
return;
}
+/*
if ($parent[0]['parent_mid'] !== $item['parent_mid']) {
$item['thr_parent'] = $item['parent_mid'];
}
@@ -3099,6 +3108,7 @@ class Activity {
$item['thr_parent'] = $parent[0]['parent_mid'];
}
$item['parent_mid'] = $parent[0]['parent_mid'];
+*/
/*
*
diff --git a/Zotlabs/Lib/ActivityStreams.php b/Zotlabs/Lib/ActivityStreams.php
index 9e460ff75..f07f99ac3 100644
--- a/Zotlabs/Lib/ActivityStreams.php
+++ b/Zotlabs/Lib/ActivityStreams.php
@@ -126,6 +126,7 @@ class ActivityStreams {
if ((!$this->parent_id) && is_array($this->obj) && isset($this->obj['inReplyTo'])) {
$this->parent_id = $this->obj['inReplyTo'];
}
+
if ((!$this->parent_id) && is_array($this->obj) && isset($this->obj['id'])) {
$this->parent_id = $this->obj['id'];
}