mirror of
https://github.com/flarum/framework.git
synced 2024-11-22 12:48:28 +08:00
fix(mentions): post reply mention missing notification on approval (#3738)
* Add PostWasApproved event * Apply fixes from StyleCI * fix: phpstan error Signed-off-by: Sami Mazouz <sychocouldy@gmail.com> --------- Signed-off-by: Sami Mazouz <sychocouldy@gmail.com> Co-authored-by: Sami Mazouz <sychocouldy@gmail.com> Co-authored-by: StyleCI Bot <bot@styleci.io>
This commit is contained in:
parent
a3a39caa44
commit
33e2bd1a77
|
@ -15,6 +15,7 @@ use Flarum\Api\Serializer\BasicUserSerializer;
|
|||
use Flarum\Api\Serializer\CurrentUserSerializer;
|
||||
use Flarum\Api\Serializer\GroupSerializer;
|
||||
use Flarum\Api\Serializer\PostSerializer;
|
||||
use Flarum\Approval\Event\PostWasApproved;
|
||||
use Flarum\Extend;
|
||||
use Flarum\Group\Group;
|
||||
use Flarum\Post\Event\Deleted;
|
||||
|
@ -106,6 +107,7 @@ return [
|
|||
->listen(Posted::class, Listener\UpdateMentionsMetadataWhenVisible::class)
|
||||
->listen(Restored::class, Listener\UpdateMentionsMetadataWhenVisible::class)
|
||||
->listen(Revised::class, Listener\UpdateMentionsMetadataWhenVisible::class)
|
||||
->listen(PostWasApproved::class, Listener\UpdateMentionsMetadataWhenVisible::class)
|
||||
->listen(Hidden::class, Listener\UpdateMentionsMetadataWhenInvisible::class)
|
||||
->listen(Deleted::class, Listener\UpdateMentionsMetadataWhenInvisible::class),
|
||||
|
||||
|
|
|
@ -9,10 +9,12 @@
|
|||
|
||||
namespace Flarum\Mentions\Listener;
|
||||
|
||||
use Flarum\Approval\Event\PostWasApproved;
|
||||
use Flarum\Mentions\Notification\GroupMentionedBlueprint;
|
||||
use Flarum\Mentions\Notification\PostMentionedBlueprint;
|
||||
use Flarum\Mentions\Notification\UserMentionedBlueprint;
|
||||
use Flarum\Notification\NotificationSyncer;
|
||||
use Flarum\Post\CommentPost;
|
||||
use Flarum\Post\Event\Posted;
|
||||
use Flarum\Post\Event\Restored;
|
||||
use Flarum\Post\Event\Revised;
|
||||
|
@ -36,10 +38,14 @@ class UpdateMentionsMetadataWhenVisible
|
|||
}
|
||||
|
||||
/**
|
||||
* @param Posted|Restored|Revised $event
|
||||
* @param Posted|Restored|Revised|PostWasApproved $event
|
||||
*/
|
||||
public function handle($event)
|
||||
{
|
||||
if (! $event->post instanceof CommentPost) {
|
||||
return;
|
||||
}
|
||||
|
||||
$content = $event->post->parsed_content;
|
||||
|
||||
$this->syncUserMentions(
|
||||
|
|
Loading…
Reference in New Issue
Block a user