I've already written this somewhere else, but get almost no attention, and this is quite important, at least for me.
It seems, that notification works only, when forum is visible to public view.
Pusher plugin listens for two events: PostWasPosted, and NotificationWillBeSent. First one is raised when there is new post, and notification is sent, if Guest user can see it:
public function pushNewPost(PostWasPosted $event)
{
if ($event->post->isVisibleTo(new Guest)) {
$pusher = $this->getPusher();
$pusher->trigger('public', 'newPost', [
'postId' => $event->post->id,
'discussionId' => $event->post->discussion->id,
'tagIds' => $event->post->discussion->tags()->lists('id')
]);
}
}
second type of notification, NotificationWillBeSent, should send notification, if user can see a post:
public function pushNotification(NotificationWillBeSent $event)
{
$pusher = $this->getPusher();
$blueprint = $event->blueprint;
foreach ($event->users as $user) {
if ($user->shouldAlert($blueprint::getType())) {
$pusher->trigger('private-user'.$user->id, 'notification', null);
}
}
}
But after search in my whole Flarum instance, I haven't found a single line of code, that rises it. So no chances for push notification...
Am I missing something? Maybe there is some extension, that rises this event? Or is it a bug, and I should write about it on Github?
Can someone confirm, that this is by design, or bug?