mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-19 23:35:12 +00:00
support pixelfed Story activities
This commit is contained in:
parent
213a22c31a
commit
b710c9127a
2 changed files with 11 additions and 4 deletions
|
@ -1360,7 +1360,7 @@ class Activity
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if ($activitypub && $has_images && $activity['type'] === 'Note') {
|
if ($activitypub && $has_images && in_array($activity['type'], ['Note', 'Story']) {
|
||||||
foreach ($images as $match) {
|
foreach ($images as $match) {
|
||||||
$img = [];
|
$img = [];
|
||||||
// handle Friendica/Hubzilla style img links with [img=$url]$alttext[/img]
|
// handle Friendica/Hubzilla style img links with [img=$url]$alttext[/img]
|
||||||
|
@ -2976,6 +2976,13 @@ class Activity
|
||||||
} elseif ($act->objprop('expires')) {
|
} elseif ($act->objprop('expires')) {
|
||||||
$item['expires'] = datetime_convert('UTC', 'UTC', $act->obj['expires']);
|
$item['expires'] = datetime_convert('UTC', 'UTC', $act->obj['expires']);
|
||||||
}
|
}
|
||||||
|
// pixelfed stories
|
||||||
|
if (array_key_exists('expiresAt', $act->data) && $act->data['expiresAt']) {
|
||||||
|
$item['expires'] = datetime_convert('UTC', 'UTC', $act->data['expiresAt']);
|
||||||
|
} elseif ($act->objprop('expiresAt')) {
|
||||||
|
$item['expires'] = datetime_convert('UTC', 'UTC', $act->obj['expiresAt']);
|
||||||
|
}
|
||||||
|
|
||||||
if ($item['expires'] > NULL_DATE && $item['expires'] < datetime_convert()) {
|
if ($item['expires'] > NULL_DATE && $item['expires'] < datetime_convert()) {
|
||||||
// We shouldn't even be seeing this activity.
|
// We shouldn't even be seeing this activity.
|
||||||
return false;
|
return false;
|
||||||
|
@ -3332,7 +3339,7 @@ class Activity
|
||||||
// Objects that might have media attachments which aren't already provided in the content element.
|
// Objects that might have media attachments which aren't already provided in the content element.
|
||||||
// We'll check specific media objects separately.
|
// We'll check specific media objects separately.
|
||||||
|
|
||||||
if (in_array($act->objprop('type',''), ['Article', 'Document', 'Event', 'Note', 'Page', 'Place', 'Question'])
|
if (in_array($act->objprop('type',''), ['Article', 'Document', 'Event', 'Note', 'Story', 'Page', 'Place', 'Question'])
|
||||||
&& isset($item['attach']) && $item['attach']) {
|
&& isset($item['attach']) && $item['attach']) {
|
||||||
$item = self::bb_attach($item);
|
$item = self::bb_attach($item);
|
||||||
}
|
}
|
||||||
|
@ -3523,7 +3530,7 @@ class Activity
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (in_array($act->objprop('type'), ['Note', 'Article', 'Page'])) {
|
if (in_array($act->objprop('type'), ['Note', 'Story', 'Article', 'Page'])) {
|
||||||
$ptr = null;
|
$ptr = null;
|
||||||
|
|
||||||
if (array_key_exists('url', $act->obj)) {
|
if (array_key_exists('url', $act->obj)) {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
Federation
|
Federation
|
||||||
==========
|
==========
|
||||||
|
|
||||||
The ActivityPub implementation in this project strives to be compliant to the core spec where possible, while offering a range of services and features which normally aren't provided by ActivityPub projects.
|
The ActivityPub implementation in this software strives to be compliant to the core spec where possible, while offering a range of services and features which normally aren't provided by ActivityPub projects.
|
||||||
|
|
||||||
Supported activities:
|
Supported activities:
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue