2024-12-15 22:25:28 +01:00
|
|
|
<?php
|
|
|
|
/**
|
2024-12-16 17:36:23 +01:00
|
|
|
* Interface for defining Methods needed for the Event Sources feature.
|
2024-12-15 22:25:28 +01:00
|
|
|
*
|
2024-12-16 17:36:23 +01:00
|
|
|
* The Event Sources feature is about following other ActivityPub actors and
|
|
|
|
* importing their events. That means treating them as cache and listing them.
|
|
|
|
* Events should be deleted some time after they have ended.
|
2024-12-15 22:25:28 +01:00
|
|
|
*
|
|
|
|
* @package Event_Bridge_For_ActivityPub
|
|
|
|
* @since 1.0.0
|
|
|
|
* @license AGPL-3.0-or-later
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace Event_Bridge_For_ActivityPub\Integrations;
|
|
|
|
|
|
|
|
use Event_Bridge_For_ActivityPub\ActivityPub\Transmogrifier\Base as Transmogrifier;
|
|
|
|
|
|
|
|
// Exit if accessed directly.
|
|
|
|
defined( 'ABSPATH' ) || exit; // @codeCoverageIgnore
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Interface for an event plugin integration that supports the Event Sources feature.
|
|
|
|
*
|
|
|
|
* @since 1.0.0
|
|
|
|
*/
|
|
|
|
interface Feature_Event_Sources {
|
|
|
|
/**
|
|
|
|
* Returns the plugin file relative to the plugins dir.
|
|
|
|
*
|
|
|
|
* @return Transmogrifier
|
|
|
|
*/
|
|
|
|
public static function get_transmogrifier(): Transmogrifier;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Retrieves a list of post IDs for cached remote events that have ended.
|
|
|
|
*
|
|
|
|
* Filters the events to include only those that ended before the specified timestamp.
|
|
|
|
*
|
2024-12-22 21:55:08 +01:00
|
|
|
* @param int $ends_before_time Unix timestamp. Only events ending before this time will be included.
|
2024-12-15 22:25:28 +01:00
|
|
|
*
|
|
|
|
* @return int[] List of post IDs for events that match the criteria.
|
|
|
|
*/
|
2024-12-22 21:55:08 +01:00
|
|
|
public static function get_cached_remote_events( $ends_before_time ): array;
|
2024-12-15 22:25:28 +01:00
|
|
|
}
|