[POSTING] Make it possible for plugins to change the placeholder string

This commit is contained in:
Diogo Peralta Cordeiro 2021-07-22 13:02:09 +01:00 committed by Hugo Sales
parent 72dcff22f7
commit 488e700fab
No known key found for this signature in database
GPG Key ID: 7D0C7EAFC9D835A0

View File

@ -70,7 +70,8 @@ END;
} }
$placeholder_string = ['How are you feeling?', 'Have something to share?', 'How was your day?']; $placeholder_string = ['How are you feeling?', 'Have something to share?', 'How was your day?'];
$rand_key = array_rand($placeholder_string); Event::handle('PostingPlaceHolderString', [&$placeholder_string]);
$rand_key = array_rand($placeholder_string);
$request = $vars['request']; $request = $vars['request'];
$form = Form::create([ $form = Form::create([
@ -104,7 +105,7 @@ END;
*/ */
public static function storeNote(int $actor_id, ?string $content, array $attachments, bool $is_local, ?int $reply_to = null, ?int $repeat_of = null) public static function storeNote(int $actor_id, ?string $content, array $attachments, bool $is_local, ?int $reply_to = null, ?int $repeat_of = null)
{ {
$note = Note::create([ $note = Note::create([
'gsactor_id' => $actor_id, 'gsactor_id' => $actor_id,
'content' => $content, 'content' => $content,
'is_local' => $is_local, 'is_local' => $is_local,