Skip to content

Commit e7a7247

Browse files
committed
A little clean up
Signed-off-by: Matt Friedman <maf675@gmail.com>
1 parent 6423e08 commit e7a7247

2 files changed

Lines changed: 6 additions & 12 deletions

File tree

event/listener.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@
1010

1111
namespace phpbb\webpushnotifications\event;
1212

13-
/**
14-
* @ignore
15-
*/
16-
1713
use FastImageSize\FastImageSize;
1814
use phpbb\config\config;
1915
use phpbb\controller\helper as controller_helper;

ucp/controller/webpush.php

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -103,14 +103,7 @@ public function notification(): JsonResponse
103103
throw new http_exception(Response::HTTP_FORBIDDEN, 'NO_AUTH_OPERATION');
104104
}
105105

106-
if ($this->user->id() !== ANONYMOUS)
107-
{
108-
$notification_data = $this->get_user_notifications();
109-
}
110-
else
111-
{
112-
$notification_data = $this->get_anonymous_notifications();
113-
}
106+
$notification_data = $this->get_user_notifications();
114107

115108
// Decode and return data if everything is fine
116109
$data = json_decode($notification_data, true);
@@ -126,6 +119,11 @@ public function notification(): JsonResponse
126119
*/
127120
private function get_user_notifications(): string
128121
{
122+
if ($this->user->id() === ANONYMOUS)
123+
{
124+
return $this->get_anonymous_notifications();
125+
}
126+
129127
// Subscribe should only be available for logged-in "normal" users
130128
if ($this->user->data['user_type'] == USER_IGNORE)
131129
{

0 commit comments

Comments
 (0)