2021-04-02 19:20:02 +02:00
|
|
|
<?php
|
|
|
|
|
2021-06-08 11:52:11 +02:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
2021-04-02 19:20:02 +02:00
|
|
|
/**
|
|
|
|
* @copyright 2021 Podlibre
|
|
|
|
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
|
|
|
* @link https://castopod.org/
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace App\Libraries;
|
|
|
|
|
2021-08-13 13:07:29 +02:00
|
|
|
use App\Entities\Post;
|
2021-08-27 12:58:22 +02:00
|
|
|
use Modules\Fediverse\Objects\NoteObject as FediverseNoteObject;
|
2021-05-12 16:00:25 +02:00
|
|
|
|
2021-08-27 12:58:22 +02:00
|
|
|
class NoteObject extends FediverseNoteObject
|
2021-04-02 19:20:02 +02:00
|
|
|
{
|
2021-06-08 11:52:11 +02:00
|
|
|
/**
|
2021-08-13 13:07:29 +02:00
|
|
|
* @param Post $post
|
2021-06-08 11:52:11 +02:00
|
|
|
*/
|
2021-08-23 13:05:16 +02:00
|
|
|
public function __construct($post)
|
2021-04-02 19:20:02 +02:00
|
|
|
{
|
2021-08-13 13:07:29 +02:00
|
|
|
parent::__construct($post);
|
2021-04-02 19:20:02 +02:00
|
|
|
|
2021-08-13 13:07:29 +02:00
|
|
|
if ($post->episode_id) {
|
2021-04-02 19:20:02 +02:00
|
|
|
$this->content =
|
|
|
|
'<a href="' .
|
2021-08-13 13:07:29 +02:00
|
|
|
$post->episode->link .
|
2021-04-02 19:20:02 +02:00
|
|
|
'" target="_blank" rel="noopener noreferrer">' .
|
2021-08-13 13:07:29 +02:00
|
|
|
$post->episode->title .
|
2021-04-02 19:20:02 +02:00
|
|
|
'</a><br/>' .
|
2021-08-13 13:07:29 +02:00
|
|
|
$post->message_html;
|
2021-04-02 19:20:02 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|