aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Lib/Activity.php
diff options
context:
space:
mode:
Diffstat (limited to 'Zotlabs/Lib/Activity.php')
-rw-r--r--Zotlabs/Lib/Activity.php20
1 files changed, 17 insertions, 3 deletions
diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php
index 08e5ffaca..5f222754b 100644
--- a/Zotlabs/Lib/Activity.php
+++ b/Zotlabs/Lib/Activity.php
@@ -104,6 +104,7 @@ class Activity {
}
else {
logger('fetch failed: ' . $url);
+ logger($x['body']);
}
return null;
}
@@ -1018,6 +1019,7 @@ class Activity {
if(! $extended) {
return $p['xchan_url'];
}
+
$ret = [];
$c = ((array_key_exists('channel_id',$p)) ? $p : channelx_by_hash($p['xchan_hash']));
@@ -1063,10 +1065,16 @@ class Activity {
]
];
+ $ret['publicKey'] = [
+ 'id' => $p['xchan_url'],
+ 'owner' => $p['xchan_url'],
+ 'publicKeyPem' => $p['xchan_pubkey']
+ ];
+
$arr = [ 'xchan' => $p, 'encoded' => $ret ];
call_hooks('encode_person', $arr);
- $ret = $arr['encoded'];
+ $ret = $arr['encoded'];
return $ret;
}
@@ -1485,6 +1493,14 @@ class Activity {
if(! is_array($person_obj))
return;
+ $inbox = $person_obj['inbox'];
+
+ // invalid identity
+
+ if (! $inbox || strpos($inbox,z_root()) !== false) {
+ return;
+ }
+
$name = $person_obj['name'];
if(! $name)
$name = $person_obj['preferredUsername'];
@@ -1532,8 +1548,6 @@ class Activity {
$profile = $url;
}
- $inbox = $person_obj['inbox'];
-
$collections = [];
if($inbox) {