mirror of
https://github.com/friendica/friendica
synced 2025-04-25 07:10:11 +00:00
Add custom emojis Mastodon API endpoint
This commit is contained in:
parent
1ac9107e5f
commit
bd910342df
7 changed files with 114 additions and 30 deletions
|
@ -7,16 +7,50 @@ use Friendica\BaseEntity;
|
|||
/**
|
||||
* Class Emoji
|
||||
*
|
||||
* @see https://docs.joinmastodon.org/api/entities/#emoji
|
||||
* @see https://docs.joinmastodon.org/entities/emoji/
|
||||
*/
|
||||
class Emoji extends BaseEntity
|
||||
{
|
||||
//Required attributes
|
||||
/** @var string */
|
||||
protected $shortcode;
|
||||
/** @var string (URL) */
|
||||
/** @var string (URL)*/
|
||||
protected $static_url;
|
||||
/** @var string (URL) */
|
||||
/** @var string (URL)*/
|
||||
protected $url;
|
||||
/** @var bool */
|
||||
protected $visible_in_picker;
|
||||
/**
|
||||
* Unsupported
|
||||
* @var bool
|
||||
*/
|
||||
protected $visible_in_picker = true;
|
||||
|
||||
// Optional attributes
|
||||
/**
|
||||
* Unsupported
|
||||
* @var string
|
||||
*/
|
||||
//protected $category;
|
||||
|
||||
public function __construct(string $shortcode, string $url)
|
||||
{
|
||||
$this->shortcode = $shortcode;
|
||||
$this->url = $url;
|
||||
$this->static_url = $url;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Emoji $prototype
|
||||
* @param string $shortcode
|
||||
* @param string $url
|
||||
* @return Emoji
|
||||
*/
|
||||
public static function createFromPrototype(Emoji $prototype, string $shortcode, string $url)
|
||||
{
|
||||
$emoji = clone $prototype;
|
||||
$emoji->shortcode = $shortcode;
|
||||
$emoji->url = $url;
|
||||
$emoji->static_url = $url;
|
||||
|
||||
return $emoji;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue