aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Lib/Activity.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2022-02-28 10:16:19 +0000
committerMario <mario@mariovavti.com>2022-02-28 10:16:19 +0000
commit0cc6f66a26181319738db8150074f62b3684f97e (patch)
treeda50b9238b562ebb65b676e38e33a18b94dc9ac6 /Zotlabs/Lib/Activity.php
parent1893368aa51c1c703f760f9f15bacb1bf42c750d (diff)
downloadvolse-hubzilla-0cc6f66a26181319738db8150074f62b3684f97e.tar.gz
volse-hubzilla-0cc6f66a26181319738db8150074f62b3684f97e.tar.bz2
volse-hubzilla-0cc6f66a26181319738db8150074f62b3684f97e.zip
make gprobe deal with URLs, fix issue in get_actor_protocols and fix missing author issue if wall2wall comment arrives and author is not yet known
Diffstat (limited to 'Zotlabs/Lib/Activity.php')
-rw-r--r--Zotlabs/Lib/Activity.php18
1 files changed, 11 insertions, 7 deletions
diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php
index fe5ee0ec7..e959ac879 100644
--- a/Zotlabs/Lib/Activity.php
+++ b/Zotlabs/Lib/Activity.php
@@ -1618,6 +1618,7 @@ class Activity {
$ap_hubloc = null;
$hublocs = self::get_actor_hublocs($url);
+ $has_zot_hubloc = false;
if ($hublocs) {
foreach ($hublocs as $hub) {
@@ -1625,6 +1626,7 @@ class Activity {
$ap_hubloc = $hub;
}
if ($hub['hubloc_network'] === 'zot6') {
+ $has_zot_hubloc = true;
Libzot::update_cached_hubloc($hub);
}
}
@@ -1648,16 +1650,18 @@ class Activity {
return;
}
- $inbox = $person_obj['inbox'];
+ $inbox = $person_obj['inbox'] ?? null;
- // invalid identity
+ // invalid AP identity
if (!$inbox || strpos($inbox, z_root()) !== false) {
return;
}
// store the actor record in XConfig
- XConfig::Set($url, 'system', 'actor_record', $person_obj);
+
+ // we already store this in Activity::fetch()
+ // XConfig::Set($url, 'system', 'actor_record', $person_obj);
$name = $person_obj['name'];
if (!$name) {
@@ -1814,12 +1818,12 @@ class Activity {
// Adding zot discovery urls to the actor record will cause federation to fail with the 20-30 projects which don't accept arrays in the url field.
$actor_protocols = self::get_actor_protocols($person_obj);
- if (in_array('zot6', $actor_protocols)) {
+ if (!$has_zot_hubloc && in_array('zot6', $actor_protocols)) {
$zx = q("select * from hubloc where hubloc_id_url = '%s' and hubloc_network = 'zot6'",
dbesc($url)
);
- if (!$zx && $webfinger_addr) {
- Master::Summon(['Gprobe', bin2hex($webfinger_addr)]);
+ if (!$zx) {
+ Master::Summon(['Gprobe', bin2hex($url)]);
}
}
@@ -3796,7 +3800,7 @@ class Activity {
return $ret;
}
- foreach ($tag as $t) {
+ foreach ($actor['tag'] as $t) {
if ((isset($t['type']) && $t['type'] === 'PropertyValue') &&
(isset($t['name']) && $t['name'] === 'Protocol') &&
(isset($t['value']) && in_array($t['value'], ['zot6', 'activitypub', 'diaspora']))