updated plugin ActivityPub version 8.3.0
This commit is contained in:
@ -9,6 +9,8 @@
|
||||
|
||||
namespace Activitypub\Activity;
|
||||
|
||||
use Activitypub\Activity\Extended_Object\Place;
|
||||
|
||||
/**
|
||||
* Base_Object is an implementation of one of the
|
||||
* Activity Streams Core Types.
|
||||
@ -21,48 +23,96 @@ namespace Activitypub\Activity;
|
||||
*
|
||||
* @see https://www.w3.org/TR/activitystreams-core/#object
|
||||
*
|
||||
* @method string|null get_actor() Gets one or more entities that performed or are expected to perform the activity.
|
||||
* @method string|null get_attributed_to() Gets the entity attributed as the original author.
|
||||
* @method array|null get_attachment() Gets the attachment property of the object.
|
||||
* @method array|null get_cc() Gets the secondary recipients of the object.
|
||||
* @method string|null get_content() Gets the content property of the object.
|
||||
* @method array|null get_icon() Gets the icon property of the object.
|
||||
* @method string|null get_id() Gets the object's unique global identifier.
|
||||
* @method array|null get_image() Gets the image property of the object.
|
||||
* @method array|string|null get_in_reply_to() Gets the objects this object is in reply to.
|
||||
* @method string|null get_name() Gets the natural language name of the object.
|
||||
* @method Base_Object|string|null get_object() Gets the direct object of the activity.
|
||||
* @method string|null get_published() Gets the date and time the object was published in ISO 8601 format.
|
||||
* @method string|null get_summary() Gets the natural language summary of the object.
|
||||
* @method array|null get_tag() Gets the tag property of the object.
|
||||
* @method array|string|null get_to() Gets the primary recipients of the object.
|
||||
* @method string get_type() Gets the type of the object.
|
||||
* @method string|null get_updated() Gets the date and time the object was updated in ISO 8601 format.
|
||||
* @method string|null get_url() Gets the URL of the object.
|
||||
* @method array|string|null get_attachment() Gets the attachment property of the object.
|
||||
* @method array|string|null get_attributed_to() Gets the entity attributed as the original author.
|
||||
* @method string|null get_audience() Gets the total population of entities for which the object can be considered relevant.
|
||||
* @method string[]|string|null get_bcc() Gets the private secondary audience of the object.
|
||||
* @method string[]|string|null get_bto() Gets the private primary audience of the object.
|
||||
* @method string[]|string|null get_cc() Gets the secondary recipients of the object.
|
||||
* @method string|null get_content() Gets the content property of the object.
|
||||
* @method string[]|null get_content_map() Gets the content map property of the object.
|
||||
* @method string|null get_context() Gets the context within which the object exists.
|
||||
* @method array|null get_dcterms() Gets the Dublin Core terms property of the object.
|
||||
* @method string|null get_duration() Gets the duration property of time-bound resources.
|
||||
* @method string|null get_end_time() Gets the date and time describing the ending time of the object.
|
||||
* @method string|null get_generator() Gets the entity that generated the object.
|
||||
* @method string[]|null get_icon() Gets the icon property of the object.
|
||||
* @method string|null get_id() Gets the object's unique global identifier.
|
||||
* @method string[]|null get_image() Gets the image property of the object.
|
||||
* @method string[]|string|null get_in_reply_to() Gets the objects this object is in reply to.
|
||||
* @method array|null get_interaction_policy() Gets the interaction policy property of the object.
|
||||
* @method array|null get_likes() Gets the collection of likes for this object.
|
||||
* @method array|string|null|Place get_location() Gets the physical or logical locations associated with the object.
|
||||
* @method string|null get_media_type() Gets the MIME media type of the content property.
|
||||
* @method string|null get_name() Gets the natural language name of the object.
|
||||
* @method string[]|null get_name_map() Gets the name map property of the object.
|
||||
* @method string|null get_preview() Gets the entity that provides a preview of this object.
|
||||
* @method string|null get_published() Gets the date and time the object was published in ISO 8601 format.
|
||||
* @method string|null get_quote() Gets the quote property of the object (FEP-044f).
|
||||
* @method string|null get_quote_url() Gets the quoteUrl property of the object.
|
||||
* @method string|null get_quote_uri() Gets the quoteUri property of the object.
|
||||
* @method string|null get__misskey_quote() Gets the _misskey_quote property of the object.
|
||||
* @method string|array|null get_replies() Gets the collection of responses to this object.
|
||||
* @method bool|null get_sensitive() Gets the sensitive property of the object.
|
||||
* @method array|null get_shares() Gets the collection of shares for this object.
|
||||
* @method array|null get_source() Gets the source property indicating content markup derivation.
|
||||
* @method string|null get_start_time() Gets the date and time describing the starting time of the object.
|
||||
* @method string|null get_summary() Gets the natural language summary of the object.
|
||||
* @method string[]|null get_summary_map() Gets the summary map property of the object.
|
||||
* @method array[]|null get_tag() Gets the tag property of the object.
|
||||
* @method string[]|string|null get_to() Gets the primary recipients of the object.
|
||||
* @method string get_type() Gets the type of the object.
|
||||
* @method string|null get_updated() Gets the date and time the object was updated in ISO 8601 format.
|
||||
* @method string|null get_url() Gets the URL of the object.
|
||||
* @method string|null get_former_type() Gets the former type of a Tombstone object.
|
||||
* @method string|null get_deleted() Gets the date and time the object was deleted in ISO 8601 format.
|
||||
*
|
||||
* @method string|array add_cc( string|array $cc ) Adds one or more entities to the secondary audience of the object.
|
||||
* @method string|array add_to( string|array $to ) Adds one or more entities to the primary audience of the object.
|
||||
* @method string|string[] add_cc( string|array $cc ) Adds one or more entities to the secondary audience of the object.
|
||||
* @method string|string[] add_to( string|array $to ) Adds one or more entities to the primary audience of the object.
|
||||
*
|
||||
* @method Base_Object set_actor( string|array $actor ) Sets one or more entities that performed the activity.
|
||||
* @method Base_Object set_attachment( array $attachment ) Sets the attachment property of the object.
|
||||
* @method Base_Object set_attributed_to( string $attributed_to ) Sets the entity attributed as the original author.
|
||||
* @method Base_Object set_cc( array|string $cc ) Sets the secondary recipients of the object.
|
||||
* @method Base_Object set_content( string $content ) Sets the content property of the object.
|
||||
* @method Base_Object set_content_map( array $content_map ) Sets the content property of the object.
|
||||
* @method Base_Object set_icon( array $icon ) Sets the icon property of the object.
|
||||
* @method Base_Object set_id( string $id ) Sets the object's unique global identifier.
|
||||
* @method Base_Object set_image( array $image ) Sets the image property of the object.
|
||||
* @method Base_Object set_name( string $name ) Sets the natural language name of the object.
|
||||
* @method Base_Object set_origin( string $origin ) Sets the origin property of the object.
|
||||
* @method Base_Object set_published( string $published ) Sets the date and time the object was published in ISO 8601 format.
|
||||
* @method Base_Object set_sensitive( bool $sensitive ) Sets the sensitive property of the object.
|
||||
* @method Base_Object set_summary( string $summary ) Sets the natural language summary of the object.
|
||||
* @method Base_Object set_summary_map( array|null $summary_map ) Sets the summary property of the object.
|
||||
* @method Base_Object set_target( string $target ) Sets the target property of the object.
|
||||
* @method Base_Object set_to( array|string $to ) Sets the primary recipients of the object.
|
||||
* @method Base_Object set_type( string $type ) Sets the type of the object.
|
||||
* @method Base_Object set_updated( string $updated ) Sets the date and time the object was updated in ISO 8601 format.
|
||||
* @method Base_Object set_url( string $url ) Sets the URL of the object.
|
||||
* @method Base_Object set_attachment( array $attachment ) Sets the attachment property of the object.
|
||||
* @method Base_Object set_attributed_to( string $attributed_to ) Sets the entity attributed as the original author.
|
||||
* @method Base_Object set_audience( string $audience ) Sets the total population of entities for which the object can be considered relevant.
|
||||
* @method Base_Object set_bcc( array|string $bcc ) Sets the private secondary audience of the object.
|
||||
* @method Base_Object set_bto( array|string $bto ) Sets the private primary audience of the object.
|
||||
* @method Base_Object set_cc( array|string $cc ) Sets the secondary recipients of the object.
|
||||
* @method Base_Object set_content( string $content ) Sets the content property of the object.
|
||||
* @method Base_Object set_content_map( array $content_map ) Sets the content property of the object.
|
||||
* @method Base_Object set_context( string $context ) Sets the context within which the object exists.
|
||||
* @method Base_Object set_dcterms( array $dcterms ) Sets the Dublin Core terms property of the object.
|
||||
* @method Base_Object set_duration( string $duration ) Sets the duration property of time-bound resources.
|
||||
* @method Base_Object set_end_time( string $end_time ) Sets the date and time describing the ending time of the object.
|
||||
* @method Base_Object set_generator( string $generator ) Sets the entity that generated the object.
|
||||
* @method Base_Object set_icon( array $icon ) Sets the icon property of the object.
|
||||
* @method Base_Object set_id( string $id ) Sets the object's unique global identifier.
|
||||
* @method Base_Object set_image( array $image ) Sets the image property of the object.
|
||||
* @method Base_Object set_in_reply_to( string|string[] $in_reply_to ) Sets the is in reply to property of the object.
|
||||
* @method Base_Object set_interaction_policy( array|null $policy ) Sets the interaction policy property of the object.
|
||||
* @method Base_Object set_likes( array $likes ) Sets the collection of likes for this object.
|
||||
* @method Base_Object set_location( array|string|Place $location ) Sets the physical or logical locations associated with the object.
|
||||
* @method Base_Object set_media_type( string $media_type ) Sets the MIME media type of the content property.
|
||||
* @method Base_Object set_name( string $name ) Sets the natural language name of the object.
|
||||
* @method Base_Object set_name_map( array|null $name_map ) Sets the name map property of the object.
|
||||
* @method Base_Object set_preview( string $preview ) Sets the entity that provides a preview of this object.
|
||||
* @method Base_Object set_published( string|null $published ) Sets the date and time the object was published in ISO 8601 format.
|
||||
* @method Base_Object set_quote( string $quote ) Sets the quote property of the object (FEP-044f).
|
||||
* @method Base_Object set_quote_url( string $quote_url ) Sets the quoteUrl property of the object.
|
||||
* @method Base_Object set_quote_uri( string $quote_uri ) Sets the quoteUri property of the object.
|
||||
* @method Base_Object set__misskey_quote( mixed $misskey_quote ) Sets the _misskey_quote property of the object.
|
||||
* @method Base_Object set_replies( string|array $replies ) Sets the collection of responses to this object.
|
||||
* @method Base_Object set_sensitive( bool|null $sensitive ) Sets the sensitive property of the object.
|
||||
* @method Base_Object set_shares( array $shares ) Sets the collection of shares for this object.
|
||||
* @method Base_Object set_source( array $source ) Sets the source property indicating content markup derivation.
|
||||
* @method Base_Object set_start_time( string $start_time ) Sets the date and time describing the starting time of the object.
|
||||
* @method Base_Object set_summary( string $summary ) Sets the natural language summary of the object.
|
||||
* @method Base_Object set_summary_map( array|null $summary_map ) Sets the summary property of the object.
|
||||
* @method Base_Object set_tag( array|null $tag ) Sets the tag property of the object.
|
||||
* @method Base_Object set_to( string|string[] $to ) Sets the primary recipients of the object.
|
||||
* @method Base_Object set_type( string $type ) Sets the type of the object.
|
||||
* @method Base_Object set_updated( string $updated ) Sets the date and time the object was updated in ISO 8601 format.
|
||||
* @method Base_Object set_url( string $url ) Sets the URL of the object.
|
||||
* @method Base_Object set_former_type( string $former_type ) Sets the former type of a Tombstone object.
|
||||
* @method Base_Object set_deleted( string $deleted ) Sets the date and time the object was deleted in ISO 8601 format.
|
||||
*/
|
||||
class Base_Object extends Generic_Object {
|
||||
/**
|
||||
@ -73,8 +123,45 @@ class Base_Object extends Generic_Object {
|
||||
const JSON_LD_CONTEXT = array(
|
||||
'https://www.w3.org/ns/activitystreams',
|
||||
array(
|
||||
'Hashtag' => 'as:Hashtag',
|
||||
'sensitive' => 'as:sensitive',
|
||||
'Hashtag' => 'as:Hashtag',
|
||||
'sensitive' => 'as:sensitive',
|
||||
'dcterms' => 'http://purl.org/dc/terms/',
|
||||
'gts' => 'https://gotosocial.org/ns#',
|
||||
'schema' => 'http://schema.org/',
|
||||
'exifData' => 'schema:exifData',
|
||||
'PropertyValue' => 'schema:PropertyValue',
|
||||
'interactionPolicy' => array(
|
||||
'@id' => 'gts:interactionPolicy',
|
||||
'@type' => '@id',
|
||||
),
|
||||
'canQuote' => array(
|
||||
'@id' => 'gts:canQuote',
|
||||
'@type' => '@id',
|
||||
),
|
||||
'canReply' => array(
|
||||
'@id' => 'gts:canReply',
|
||||
'@type' => '@id',
|
||||
),
|
||||
'canLike' => array(
|
||||
'@id' => 'gts:canLike',
|
||||
'@type' => '@id',
|
||||
),
|
||||
'canAnnounce' => array(
|
||||
'@id' => 'gts:canAnnounce',
|
||||
'@type' => '@id',
|
||||
),
|
||||
'automaticApproval' => array(
|
||||
'@id' => 'gts:automaticApproval',
|
||||
'@type' => '@id',
|
||||
),
|
||||
'manualApproval' => array(
|
||||
'@id' => 'gts:manualApproval',
|
||||
'@type' => '@id',
|
||||
),
|
||||
'always' => array(
|
||||
'@id' => 'gts:always',
|
||||
'@type' => '@id',
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
@ -132,7 +219,7 @@ class Base_Object extends Generic_Object {
|
||||
|
||||
/**
|
||||
* One or more entities that represent the total population of
|
||||
* entities for which the object can considered to be relevant.
|
||||
* entities for which the object can be considered to be relevant.
|
||||
*
|
||||
* @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-audience
|
||||
*
|
||||
@ -180,6 +267,25 @@ class Base_Object extends Generic_Object {
|
||||
*/
|
||||
protected $content_map;
|
||||
|
||||
/**
|
||||
* The date and time at which the object was deleted.
|
||||
*
|
||||
* @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-deleted
|
||||
*
|
||||
* @var string|null
|
||||
*/
|
||||
protected $deleted;
|
||||
|
||||
/**
|
||||
* The former type of the object. Used in Tombstone objects to
|
||||
* indicate the type of the object prior to deletion.
|
||||
*
|
||||
* @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-formertype
|
||||
*
|
||||
* @var string|null
|
||||
*/
|
||||
protected $former_type;
|
||||
|
||||
/**
|
||||
* A simple, human-readable, plain-text name for the object.
|
||||
* HTML markup MUST NOT be included.
|
||||
@ -258,7 +364,7 @@ class Base_Object extends Generic_Object {
|
||||
*
|
||||
* @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-location
|
||||
*
|
||||
* @var string|null
|
||||
* @var string|null|Place
|
||||
*/
|
||||
protected $location;
|
||||
|
||||
@ -395,9 +501,9 @@ class Base_Object extends Generic_Object {
|
||||
|
||||
/**
|
||||
* When the object describes a time-bound resource, such as an audio
|
||||
* or video, a meeting, etc, the duration property indicates the
|
||||
* or video, a meeting, etc., the duration property indicates the
|
||||
* object's approximate duration.
|
||||
* The value MUST be expressed as an xsd:duration as defined by
|
||||
* The value MUST be expressed as a xsd:duration as defined by
|
||||
* xmlschema11-2, section 3.3.6 (e.g. a period of 5 seconds is
|
||||
* represented as "PT5S").
|
||||
*
|
||||
@ -414,7 +520,7 @@ class Base_Object extends Generic_Object {
|
||||
*
|
||||
* @see https://www.w3.org/TR/activitypub/#source-property
|
||||
*
|
||||
* @var array
|
||||
* @var array|null
|
||||
*/
|
||||
protected $source;
|
||||
|
||||
@ -434,7 +540,7 @@ class Base_Object extends Generic_Object {
|
||||
*
|
||||
* @see https://www.w3.org/TR/activitypub/#likes
|
||||
*
|
||||
* @var array
|
||||
* @var array|null
|
||||
*/
|
||||
protected $likes;
|
||||
|
||||
@ -444,7 +550,7 @@ class Base_Object extends Generic_Object {
|
||||
*
|
||||
* @see https://www.w3.org/TR/activitypub/#shares
|
||||
*
|
||||
* @var array
|
||||
* @var array|null
|
||||
*/
|
||||
protected $shares;
|
||||
|
||||
@ -455,10 +561,70 @@ class Base_Object extends Generic_Object {
|
||||
*
|
||||
* @see https://docs.joinmastodon.org/spec/activitypub/#sensitive
|
||||
*
|
||||
* @var boolean
|
||||
* @var boolean|null
|
||||
*/
|
||||
protected $sensitive;
|
||||
|
||||
/**
|
||||
* The dcterms namespace.
|
||||
*
|
||||
* @see https://codeberg.org/fediverse/fep/src/branch/main/fep/b2b8/fep-b2b8.md#sensitive
|
||||
* @see https://www.dublincore.org/specifications/dublin-core/dcmi-terms/
|
||||
*
|
||||
* @var array|null
|
||||
*/
|
||||
protected $dcterms;
|
||||
|
||||
/**
|
||||
* Interaction policy is an attempt to limit the harmful effects of unwanted replies and
|
||||
* other interactions on a user's posts (e.g., "reply guys").
|
||||
*
|
||||
* It is also used by Mastodon to limit the ability to quote posts.
|
||||
*
|
||||
* @see https://docs.gotosocial.org/en/latest/federation/interaction_policy/
|
||||
* @see https://blog.joinmastodon.org/2025/09/introducing-quote-posts/
|
||||
*
|
||||
* @var array|null
|
||||
*/
|
||||
protected $interaction_policy;
|
||||
|
||||
/**
|
||||
* Fediverse Enhancement Proposal 044f: Quote Property
|
||||
*
|
||||
* @see https://codeberg.org/fediverse/fep/src/branch/main/fep/044f/fep-044f.md
|
||||
* @see https://w3id.org/fep/044f#quote
|
||||
*
|
||||
* @var string|null
|
||||
*/
|
||||
protected $quote;
|
||||
|
||||
/**
|
||||
* ActivityStreams quoteUrl property.
|
||||
*
|
||||
* @see https://www.w3.org/ns/activitystreams#quoteUrl
|
||||
*
|
||||
* @var string|null
|
||||
*/
|
||||
protected $quote_url;
|
||||
|
||||
/**
|
||||
* Fedibird-specific quoteUri property.
|
||||
*
|
||||
* @see https://fedibird.com/ns#quoteUri
|
||||
*
|
||||
* @var string|null
|
||||
*/
|
||||
protected $quote_uri;
|
||||
|
||||
/**
|
||||
* Misskey-specific quote property.
|
||||
*
|
||||
* @see https://misskey-hub.net/ns/#_misskey_quote
|
||||
*
|
||||
* @var string|null
|
||||
*/
|
||||
protected $_misskey_quote; // phpcs:ignore PSR2.Classes.PropertyDeclaration.Underscore
|
||||
|
||||
/**
|
||||
* Generic getter.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user