aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Lib/ActivityStreams.php
diff options
context:
space:
mode:
Diffstat (limited to 'Zotlabs/Lib/ActivityStreams.php')
-rw-r--r--Zotlabs/Lib/ActivityStreams.php18
1 files changed, 11 insertions, 7 deletions
diff --git a/Zotlabs/Lib/ActivityStreams.php b/Zotlabs/Lib/ActivityStreams.php
index 323b0e273..275f6eff4 100644
--- a/Zotlabs/Lib/ActivityStreams.php
+++ b/Zotlabs/Lib/ActivityStreams.php
@@ -11,6 +11,7 @@ class ActivityStreams {
public $raw = null;
public $data = null;
+ public $meta = null;
public $valid = false;
public $deleted = false;
public $id = '';
@@ -36,6 +37,9 @@ class ActivityStreams {
*/
function __construct($string) {
+ if(!$string)
+ return;
+
$this->raw = $string;
if (is_array($string)) {
@@ -57,10 +61,10 @@ class ActivityStreams {
if ($ret['signer']) {
$saved = json_encode($this->data, JSON_UNESCAPED_SLASHES);
$this->data = $tmp;
- $this->data['signer'] = $ret['signer'];
- $this->data['signed_data'] = $saved;
+ $this->meta['signer'] = $ret['signer'];
+ $this->meta['signed_data'] = $saved;
if ($ret['hubloc']) {
- $this->data['hubloc'] = $ret['hubloc'];
+ $this->meta['hubloc'] = $ret['hubloc'];
}
}
}
@@ -88,7 +92,7 @@ class ActivityStreams {
$this->ldsig = $this->get_compound_property('signature');
if ($this->ldsig) {
- $this->signer = $this->get_compound_property('creator', $this->ldsig);
+ $this->signer = $this->get_actor('creator', $this->ldsig);
if ($this->signer && is_array($this->signer) && array_key_exists('publicKey', $this->signer) && is_array($this->signer['publicKey']) && $this->signer['publicKey']['publicKeyPem']) {
$this->sigok = LDSignatures::verify($this->data, $this->signer['publicKey']['publicKeyPem']);
}
@@ -344,10 +348,10 @@ class ActivityStreams {
if ($ret['signer']) {
$saved = json_encode($x, JSON_UNESCAPED_SLASHES);
$x = $tmp;
- $x['signer'] = $ret['signer'];
- $x['signed_data'] = $saved;
+ $x['meta']['signer'] = $ret['signer'];
+ $x['meta']['signed_data'] = $saved;
if ($ret['hubloc']) {
- $x['hubloc'] = $ret['hubloc'];
+ $x['meta']['hubloc'] = $ret['hubloc'];
}
}
}