2021-04-02 17:20:02 +00:00
|
|
|
<?php
|
|
|
|
|
2021-06-08 09:52:11 +00:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
2021-04-02 17:20:02 +00:00
|
|
|
/**
|
2021-05-19 16:35:13 +00:00
|
|
|
* Activity objects are specializations of the base Object type that provide information about actions that have either
|
|
|
|
* already occurred, are in the process of occurring, or may occur in the future.
|
2021-04-02 17:20:02 +00:00
|
|
|
*
|
2022-02-19 16:06:11 +00:00
|
|
|
* @copyright 2021 Ad Aures
|
2021-04-02 17:20:02 +00:00
|
|
|
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
|
|
|
* @link https://castopod.org/
|
|
|
|
*/
|
|
|
|
|
2021-08-23 11:05:16 +00:00
|
|
|
namespace Modules\Fediverse\Activities;
|
2021-04-02 17:20:02 +00:00
|
|
|
|
2021-08-23 11:05:16 +00:00
|
|
|
use Modules\Fediverse\Core\Activity;
|
|
|
|
use Modules\Fediverse\Entities\Post;
|
2021-04-02 17:20:02 +00:00
|
|
|
|
|
|
|
class AnnounceActivity extends Activity
|
|
|
|
{
|
2021-05-18 17:16:36 +00:00
|
|
|
protected string $type = 'Announce';
|
2021-04-02 17:20:02 +00:00
|
|
|
|
2021-08-13 11:07:29 +00:00
|
|
|
public function __construct(Post $reblogPost)
|
2021-04-02 17:20:02 +00:00
|
|
|
{
|
2021-08-13 11:07:29 +00:00
|
|
|
$this->actor = $reblogPost->actor->uri;
|
|
|
|
$this->object = $reblogPost->reblog_of_post->uri;
|
2021-04-02 17:20:02 +00:00
|
|
|
|
2021-08-13 11:07:29 +00:00
|
|
|
$this->published = $reblogPost->published_at->format(DATE_W3C);
|
2021-04-02 17:20:02 +00:00
|
|
|
|
2021-08-13 11:07:29 +00:00
|
|
|
$this->cc = [$reblogPost->actor->uri, $reblogPost->actor->followers_url];
|
2021-04-02 17:20:02 +00:00
|
|
|
}
|
|
|
|
}
|