updated plugin ActivityPub version 9.1.0

This commit is contained in:
2026-07-28 15:03:10 +00:00
committed by Gitium
parent bf428f0e45
commit ff806e1811
217 changed files with 6098 additions and 3025 deletions

View File

@ -301,10 +301,10 @@ class Event extends Base_Object {
* @return Event
*/
public function set_timezone( $timezone ) {
if ( in_array( $timezone, timezone_identifiers_list(), true ) ) {
if ( \in_array( $timezone, \timezone_identifiers_list(), true ) ) {
$this->timezone = $timezone;
} else {
$this->timezone = wp_timezone_string();
$this->timezone = \wp_timezone_string();
}
return $this;
@ -318,11 +318,11 @@ class Event extends Base_Object {
* @return Event
*/
public function set_replies_moderation_option( $type ) {
if ( in_array( $type, self::REPLIES_MODERATION_OPTION_TYPES, true ) ) {
if ( \in_array( $type, self::REPLIES_MODERATION_OPTION_TYPES, true ) ) {
$this->replies_moderation_option = $type;
$this->comments_enabled = ( 'allow_all' === $type ) ? true : false;
} else {
_doing_it_wrong(
\_doing_it_wrong(
__METHOD__,
'The replies moderation option must be either allow_all or closed.',
'<version_placeholder>'
@ -340,11 +340,11 @@ class Event extends Base_Object {
* @return Event
*/
public function set_comments_enabled( $comments_enabled ) {
if ( is_bool( $comments_enabled ) ) {
if ( \is_bool( $comments_enabled ) ) {
$this->comments_enabled = $comments_enabled;
$this->replies_moderation_option = $comments_enabled ? 'allow_all' : 'closed';
} else {
_doing_it_wrong(
\_doing_it_wrong(
__METHOD__,
'The commentsEnabled must be boolean.',
'<version_placeholder>'
@ -362,10 +362,10 @@ class Event extends Base_Object {
* @return Event
*/
public function set_status( $status ) {
if ( in_array( $status, self::ICAL_EVENT_STATUS_TYPES, true ) ) {
if ( \in_array( $status, self::ICAL_EVENT_STATUS_TYPES, true ) ) {
$this->status = $status;
} else {
_doing_it_wrong(
\_doing_it_wrong(
__METHOD__,
'The status of the event must be a VEVENT iCal status.',
'<version_placeholder>'
@ -387,7 +387,7 @@ class Event extends Base_Object {
*/
public function set_category( $category, $mobilizon_compatibility = true ) {
if ( $mobilizon_compatibility ) {
$this->category = in_array( $category, self::DEFAULT_EVENT_CATEGORIES, true ) ? $category : 'MEETING';
$this->category = \in_array( $category, self::DEFAULT_EVENT_CATEGORIES, true ) ? $category : 'MEETING';
} else {
$this->category = $category;
}
@ -405,7 +405,7 @@ class Event extends Base_Object {
* @return Event
*/
public function set_external_participation_url( $url ) {
if ( preg_match( '/^https?:\/\/.*/i', $url ) ) {
if ( \preg_match( '/^https?:\/\/.*/i', $url ) ) {
$this->external_participation_url = $url;
$this->join_mode = 'external';
}

View File

@ -0,0 +1,74 @@
<?php
/**
* Feature_Authorization is an implementation of the FeatureAuthorization activity type,
* as defined in FEP-7aa9 (https://w3id.org/fep/7aa9).
*
* This class represents a FeatureAuthorization activity for ActivityPub implementations.
*
* @package Activitypub
*/
namespace Activitypub\Activity\Extended_Object;
use Activitypub\Activity\Base_Object;
/**
* Class representing a FeatureAuthorization activity.
*
* @see https://w3id.org/fep/7aa9
*
* @since 9.0.0
*
* @method Base_Object|string|array|null get_interacting_object() Gets the interacting object property of the object.
* @method Base_Object|string|array|null get_interaction_target() Gets the interaction target property of the object.
*
* @method Feature_Authorization set_interacting_object( string|array|Base_Object|null $data ) Sets the interacting object property of the object.
* @method Feature_Authorization set_interaction_target( string|array|Base_Object|null $data ) Sets the interaction target property of the object.
*/
class Feature_Authorization extends Base_Object {
/**
* The JSON-LD context for the object.
*
* Intentionally minimal: stamps are always served standalone at their own
* URL, so we ship only the vocabulary the stamp document itself uses.
* Mirrors the Quote_Authorization (FEP-044f) approach.
*
* @var array
*/
const JSON_LD_CONTEXT = array(
'https://www.w3.org/ns/activitystreams',
array(
'FeatureAuthorization' => 'https://w3id.org/fep/7aa9#FeatureAuthorization',
'gts' => 'https://gotosocial.org/ns#',
'interactingObject' => array(
'@id' => 'gts:interactingObject',
'@type' => '@id',
),
'interactionTarget' => array(
'@id' => 'gts:interactionTarget',
'@type' => '@id',
),
),
);
/**
* The type of the object.
*
* @var string
*/
protected $type = 'FeatureAuthorization';
/**
* The object that is being interacted with.
*
* @var Base_Object|string|array|null
*/
protected $interacting_object;
/**
* The target of the interaction.
*
* @var Base_Object|string|array|null
*/
protected $interaction_target;
}

View File

@ -106,10 +106,10 @@ class Place extends Base_Object {
* @param array|string $address The address of the place.
*/
public function set_address( $address ) {
if ( is_string( $address ) || is_array( $address ) ) {
if ( \is_string( $address ) || \is_array( $address ) ) {
$this->address = $address;
} else {
_doing_it_wrong(
\_doing_it_wrong(
__METHOD__,
'The address must be either a string or an array like schema.org/PostalAddress.',
'<version_placeholder>'