@@ -215,6 +215,13 @@ private function get_anonymous_notifications(): string
215215 throw new http_exception (Response::HTTP_FORBIDDEN , 'NO_AUTH_OPERATION ' );
216216 }
217217
218+ /**
219+ * Get notification data for output from json encoded data stored in database
220+ *
221+ * @param string $notification_data Encoded data stored in database
222+ *
223+ * @return string Data for notification output with javascript
224+ */
218225 private function get_notification_data (string $ notification_data ): string
219226 {
220227 $ row_data = json_decode ($ notification_data , true );
@@ -229,7 +236,7 @@ private function get_notification_data(string $notification_data): string
229236 $ notification = $ this ->notification_manager ->get_item_type_class ($ row_data ['notification_type_name ' ], $ row_data );
230237
231238 // Load users for notification
232- $ this ->user_loader ->load_users ($ notification ->users_to_query (), [ USER_IGNORE ] );
239+ $ this ->user_loader ->load_users ($ notification ->users_to_query ());
233240
234241 return json_encode ([
235242 'heading ' => $ this ->config ['sitename ' ],
@@ -250,7 +257,6 @@ private function get_notification_data(string $notification_data): string
250257 */
251258 public function worker (): Response
252259 {
253- // @todo: only work for logged in users, no anonymous & bot
254260 $ content = $ this ->template ->render ('@phpbb_webpushnotifications/push_worker.js.twig ' , [
255261 'U_WEBPUSH_GET_NOTIFICATION ' => $ this ->controller_helper ->route ('phpbb_webpushnotifications_ucp_push_get_notification_controller ' ),
256262 'ASSETS_VERSION ' => $ this ->config ['assets_version ' ],
@@ -268,20 +274,6 @@ public function worker(): Response
268274 return $ response ;
269275 }
270276
271- /**
272- * Get template variables for subscribe type pages
273- *
274- * @return array
275- */
276- protected function get_subscribe_vars (): array
277- {
278- return [
279- 'U_WEBPUSH_SUBSCRIBE ' => $ this ->controller_helper ->route ('phpbb_webpushnotifications_ucp_push_subscribe_controller ' ),
280- 'U_WEBPUSH_UNSUBSCRIBE ' => $ this ->controller_helper ->route ('phpbb_webpushnotifications_ucp_push_unsubscribe_controller ' ),
281- 'FORM_TOKENS ' => $ this ->form_helper ->get_form_tokens (self ::FORM_TOKEN_UCP ),
282- ];
283- }
284-
285277 /**
286278 * Check (un)subscribe form for valid link hash
287279 *
0 commit comments