diff options
author | Mario Vavti <mario@mariovavti.com> | 2023-04-23 13:02:38 +0200 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2023-04-23 13:02:38 +0200 |
commit | 81f33da4991ed2abaa2422dac2bcc5fe5a2eea74 (patch) | |
tree | a0b74b0b648734405cd4790f05e7b049df7746da | |
parent | 80d70e64f5b0126af261d8f62eb69339fb0949b5 (diff) | |
download | volse-hubzilla-81f33da4991ed2abaa2422dac2bcc5fe5a2eea74.tar.gz volse-hubzilla-81f33da4991ed2abaa2422dac2bcc5fe5a2eea74.tar.bz2 volse-hubzilla-81f33da4991ed2abaa2422dac2bcc5fe5a2eea74.zip |
improved fetch_conversation()
-rw-r--r-- | Zotlabs/Lib/Activity.php | 6 | ||||
-rw-r--r-- | Zotlabs/Lib/Libzot.php | 31 |
2 files changed, 19 insertions, 18 deletions
diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php index cbefd6fd7..d596b47a0 100644 --- a/Zotlabs/Lib/Activity.php +++ b/Zotlabs/Lib/Activity.php @@ -3991,18 +3991,18 @@ class Activity { switch ($options) { case 'activitypub': - $hublocs = q("select * from hubloc left join xchan on hubloc_hash = xchan_hash where hubloc_hash = '%s' and hubloc_deleted = 0 ", + $hublocs = q("select * from hubloc left join xchan on hubloc_hash = xchan_hash where hubloc_hash = '%s' and hubloc_deleted = 0 order by hubloc_id desc", dbesc($url) ); break; case 'zot6': - $hublocs = q("select * from hubloc left join xchan on hubloc_hash = xchan_hash where hubloc_id_url = '%s' and hubloc_deleted = 0 ", + $hublocs = q("select * from hubloc left join xchan on hubloc_hash = xchan_hash where hubloc_id_url = '%s' and hubloc_deleted = 0 order by hubloc_id desc", dbesc($url) ); break; case 'all': default: - $hublocs = q("select * from hubloc left join xchan on hubloc_hash = xchan_hash where ( hubloc_id_url = '%s' OR hubloc_hash = '%s' ) and hubloc_deleted = 0 ", + $hublocs = q("select * from hubloc left join xchan on hubloc_hash = xchan_hash where ( hubloc_id_url = '%s' OR hubloc_hash = '%s' ) and hubloc_deleted = 0 order by hubloc_id desc", dbesc($url), dbesc($url) ); 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']; |