aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Lib/Libzot.php
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2023-04-23 13:02:38 +0200
committerMario Vavti <mario@mariovavti.com>2023-04-23 13:02:38 +0200
commit81f33da4991ed2abaa2422dac2bcc5fe5a2eea74 (patch)
treea0b74b0b648734405cd4790f05e7b049df7746da /Zotlabs/Lib/Libzot.php
parent80d70e64f5b0126af261d8f62eb69339fb0949b5 (diff)
downloadvolse-hubzilla-81f33da4991ed2abaa2422dac2bcc5fe5a2eea74.tar.gz
volse-hubzilla-81f33da4991ed2abaa2422dac2bcc5fe5a2eea74.tar.bz2
volse-hubzilla-81f33da4991ed2abaa2422dac2bcc5fe5a2eea74.zip
improved fetch_conversation()
Diffstat (limited to 'Zotlabs/Lib/Libzot.php')
-rw-r--r--Zotlabs/Lib/Libzot.php31
1 files changed, 16 insertions, 15 deletions
diff --git a/Zotlabs/Lib/Libzot.php b/Zotlabs/Lib/Libzot.php
index 2feddd378..99b9e0f75 100644
--- a/Zotlabs/Lib/Libzot.php
+++ b/Zotlabs/Lib/Libzot.php
@@ -2013,18 +2013,12 @@ class Libzot {
continue;
}
- $r = q("select hubloc_hash, hubloc_network from hubloc where hubloc_id_url = '%s' order by hubloc_id desc",
- dbesc($AS->actor['id'])
- );
-
+ $r = Activity::get_actor_hublocs($AS->actor['id']);
$r = self::zot_record_preferred($r);
-
if (!$r) {
$y = import_author_xchan(['url' => $AS->actor['id']]);
if ($y) {
- $r = q("select hubloc_hash, hubloc_network from hubloc where hubloc_id_url = '%s'",
- dbesc($AS->actor['id'])
- );
+ $r = Activity::get_actor_hublocs($AS->actor['id']);
$r = self::zot_record_preferred($r);
}
if (!$r) {
@@ -2034,22 +2028,29 @@ class Libzot {
}
if (isset($AS->obj['actor']['id']) && $AS->obj['actor']['id'] !== $AS->actor['id']) {
- $y = import_author_xchan(['url' => $AS->obj['actor']['id']]);
- if (!$y) {
- logger('FOF Activity: no object actor');
- continue;
+ $ro = Activity::get_actor_hublocs($AS->obj['actor']['id']);
+ $ro = self::zot_record_preferred($ro);
+ if (!$ro) {
+ $y = import_author_xchan(['url' => $AS->obj['actor']['id']]);
+ if ($y) {
+ $ro = Activity::get_actor_hublocs($AS->obj['actor']['id']);
+ $ro = self::zot_record_preferred($ro);
+ }
+ if (!$ro) {
+ logger('FOF Activity: no obj actor');
+ continue;
+ }
}
}
$arr = Activity::decode_note($AS);
if (!$arr) {
+ logger('FOF Activity: could not decode');
continue;
}
- if ($r) {
- $arr['author_xchan'] = $r['hubloc_hash'];
- }
+ $arr['author_xchan'] = $r['hubloc_hash'];
if ($signer) {
$arr['owner_xchan'] = $signer[0]['hubloc_hash'];