aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs
diff options
context:
space:
mode:
Diffstat (limited to 'Zotlabs')
-rw-r--r--Zotlabs/Lib/Activity.php23
-rw-r--r--Zotlabs/Lib/ActivityStreams.php1
-rw-r--r--Zotlabs/Module/Hcard.php38
3 files changed, 42 insertions, 20 deletions
diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php
index 17d14d44a..df994cd79 100644
--- a/Zotlabs/Lib/Activity.php
+++ b/Zotlabs/Lib/Activity.php
@@ -529,6 +529,7 @@ class Activity {
$top_level = (($i['mid'] === $i['parent_mid']) ? true : false);
if ($public) {
+
$ret['to'] = [ACTIVITY_PUBLIC_INBOX];
$ret['cc'] = [z_root() . '/followers/' . substr($i['author']['xchan_addr'], 0, strpos($i['author']['xchan_addr'], '@'))];
}
@@ -2644,6 +2645,7 @@ class Activity {
}
$ap_rawmsg = '';
+ $diaspora_rawmsg = '';
$raw_arr = [];
$raw_arr = json_decode($act->raw, true);
@@ -2658,7 +2660,13 @@ class Activity {
isset($a['value'])
) {
$ap_rawmsg = $a['value'];
- break;
+ }
+ if (
+ isset($a['type']) && $a['type'] === 'PropertyValue' &&
+ isset($a['name']) && $a['name'] === 'zot.diaspora.fields' &&
+ isset($a['value'])
+ ) {
+ $diaspora_rawmsg = $a['value'];
}
}
}
@@ -2682,6 +2690,15 @@ class Activity {
}
// end old style
+ if (!$ap_rawmsg && array_key_exists('signed', $raw_arr)) {
+ //zap
+ unset($act->data['signer']);
+ unset($act->data['signed_data']);
+ unset($act->data['hubloc']);
+
+ $ap_rawmsg = json_encode($act->data, JSON_UNESCAPED_SLASHES);
+ }
+
if ($ap_rawmsg) {
set_iconfig($s, 'activitypub', 'rawmsg', $ap_rawmsg, 1);
}
@@ -2689,6 +2706,10 @@ class Activity {
set_iconfig($s, 'activitypub', 'rawmsg', $act->raw, 1);
}
+ if ($diaspora_rawmsg) {
+ set_iconfig($s, 'diaspora', 'fields', $diaspora_rawmsg, 1);
+ }
+
set_iconfig($s, 'activitypub', 'recips', $act->raw_recips);
$hookinfo = [
diff --git a/Zotlabs/Lib/ActivityStreams.php b/Zotlabs/Lib/ActivityStreams.php
index 52f888b95..ffb034bf4 100644
--- a/Zotlabs/Lib/ActivityStreams.php
+++ b/Zotlabs/Lib/ActivityStreams.php
@@ -56,6 +56,7 @@ class ActivityStreams {
if (is_array($this->data) && array_key_exists('signed', $this->data)) {
$ret = JSalmon::verify($this->data);
$tmp = JSalmon::unpack($this->data['data']);
+
if ($ret && $ret['success']) {
if ($ret['signer']) {
$saved = json_encode($this->data, JSON_UNESCAPED_SLASHES);
diff --git a/Zotlabs/Module/Hcard.php b/Zotlabs/Module/Hcard.php
index 912c84fd2..1cc26c199 100644
--- a/Zotlabs/Module/Hcard.php
+++ b/Zotlabs/Module/Hcard.php
@@ -5,7 +5,7 @@ namespace Zotlabs\Module;
class Hcard extends \Zotlabs\Web\Controller {
function init() {
-
+
if(argc() > 1)
$which = argv(1);
else {
@@ -13,12 +13,12 @@ class Hcard extends \Zotlabs\Web\Controller {
\App::$error = 404;
return;
}
-
+
logger('hcard_request: ' . $which, LOGGER_DEBUG);
$profile = '';
$channel = \App::get_channel();
-
+
if((local_channel()) && (argc() > 2) && (argv(2) === 'view')) {
$which = $channel['channel_address'];
$profile = argv(1);
@@ -30,22 +30,22 @@ class Hcard extends \Zotlabs\Web\Controller {
$profile = '';
$profile = $r[0]['profile_guid'];
}
-
- head_add_link( [
- 'rel' => 'alternate',
+
+ head_add_link( [
+ 'rel' => 'alternate',
'type' => 'application/atom+xml',
'title' => t('Posts and comments'),
'href' => z_root() . '/feed/' . $which
]);
- head_add_link( [
- 'rel' => 'alternate',
+ head_add_link( [
+ 'rel' => 'alternate',
'type' => 'application/atom+xml',
'title' => t('Only posts'),
'href' => z_root() . '/feed/' . $which . '?f=&top=1'
]);
-
+
if(! $profile) {
$x = q("select channel_id as profile_uid from channel where channel_address = '%s' limit 1",
dbesc(argv(1))
@@ -54,20 +54,20 @@ class Hcard extends \Zotlabs\Web\Controller {
\App::$profile = $x[0];
}
}
-
+
profile_load($which,$profile);
-
-
+
+
}
-
-
+
+
function get() {
- $x = new \Zotlabs\Widget\Profile();
+ $x = new \Zotlabs\Widget\Fullprofile();
return $x->widget(array());
-
+
}
-
-
-
+
+
+
}