File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1010
1111namespace phpbb \webpushnotifications \event ;
1212
13- /**
14- * @ignore
15- */
16-
1713use FastImageSize \FastImageSize ;
1814use phpbb \config \config ;
1915use phpbb \controller \helper as controller_helper ;
Original file line number Diff line number Diff 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 {
You can’t perform that action at this time.
0 commit comments