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.php36
1 files changed, 27 insertions, 9 deletions
diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php
index 9178dac39..90d7af8e8 100644
--- a/Zotlabs/Lib/Activity.php
+++ b/Zotlabs/Lib/Activity.php
@@ -2116,6 +2116,13 @@ class Activity {
$s['expires'] = datetime_convert('UTC', 'UTC', $act->obj['expires']);
}
+ if ($act->objprop('location')) {
+ $s['location'] = ((isset($act->objprop('location')['name'])) ? html2plain(purify_html($act->objprop('location')['name'])) : '');
+ if (isset($act->objprop('location')['latitude'], $act->objprop('location')['longitude'])) {
+ $s['coord'] = floatval($act->objprop('location')['latitude']) . ' ' . floatval($act->objprop('location')['longitude']);
+ }
+ }
+
if (in_array($act->type, ['Invite', 'Create']) && $act->objprop('type') === 'Event') {
$s['mid'] = $s['parent_mid'] = $act->id;
}
@@ -3047,13 +3054,6 @@ class Activity {
}
$a = new ActivityStreams($n);
- if ($a->type === 'Announce' && is_array($a->obj)
- && array_key_exists('object', $a->obj) && array_key_exists('actor', $a->obj)) {
- // This is a relayed/forwarded Activity (as opposed to a shared/boosted object)
- // Reparse the encapsulated Activity and use that instead
- logger('relayed activity', LOGGER_DEBUG);
- $a = new ActivityStreams($a->obj);
- }
logger($a->debug(), LOGGER_DATA);
@@ -3062,6 +3062,24 @@ class Activity {
break;
}
+ if (in_array($a->type, ['Add', 'Remove'])
+ && is_array($a->obj)
+ && array_key_exists('object', $a->obj)
+ && array_key_exists('actor', $a->obj)
+ && !empty($a->tgt)) {
+
+ logger('unsupported collection operation', LOGGER_DEBUG);
+ return;
+ }
+
+ if ($a->type === 'Announce' && is_array($a->obj)
+ && array_key_exists('object', $a->obj) && array_key_exists('actor', $a->obj)) {
+ // This is a relayed/forwarded Activity (as opposed to a shared/boosted object)
+ // Reparse the encapsulated Activity and use that instead
+ logger('relayed activity', LOGGER_DEBUG);
+ $a = new ActivityStreams($a->obj);
+ }
+
$item = Activity::decode_note($a);
if (!$item) {
@@ -3271,7 +3289,7 @@ class Activity {
return $content;
}
- if ($act['type'] === 'Event') {
+ if (isset($act['type']) && $act['type'] === 'Event') {
$adjust = false;
$event = [];
$event['event_hash'] = $act['id'];
@@ -3464,7 +3482,7 @@ class Activity {
$ret[$collection] = $actor_record[$collection];
}
}
- if (array_path_exists('endpoints/sharedInbox', $actor_record) && $actor_record['endpoints']['sharedInbox']) {
+ if (!empty($actor_record['endpoints']['sharedInbox'])) {
$ret['sharedInbox'] = $actor_record['endpoints']['sharedInbox'];
}