@@ -32,16 +32,22 @@ public function revert_data(): array
32
32
['config.update ' , ['webpush_enable ' , $ this ->config ['wpn_webpush_enable ' ]]],
33
33
]],
34
34
['if ' , [
35
- (isset ($ this ->config ['webpush_vapid_public ' ])),
35
+ (isset ($ this ->config ['webpush_vapid_public ' ]) && empty ( $ this -> config [ ' webpush_vapid_public ' ]) ),
36
36
['config.update ' , ['webpush_vapid_public ' , $ this ->config ['wpn_webpush_vapid_public ' ]]],
37
37
]],
38
38
['if ' , [
39
- (isset ($ this ->config ['webpush_vapid_private ' ])),
39
+ (isset ($ this ->config ['webpush_vapid_private ' ]) && empty ( $ this -> config [ ' webpush_vapid_private ' ]) ),
40
40
['config.update ' , ['webpush_vapid_private ' , $ this ->config ['wpn_webpush_vapid_private ' ]]],
41
41
]],
42
42
];
43
43
}
44
44
45
+ /*
46
+ * For phpBB 4.0 with core webpush notifications update notification method
47
+ * from extension's notification.method.phpbb.wpn.webpush to the core one
48
+ * notification.method.webpush otherwise remove notification method from
49
+ * user notifications table on the extension purge.
50
+ */
45
51
public function update_subscriptions ()
46
52
{
47
53
$ user_notifications_table = $ this ->table_prefix . 'user_notifications ' ;
@@ -65,6 +71,11 @@ public function update_subscriptions()
65
71
$ this ->db ->sql_query ($ sql );
66
72
}
67
73
74
+ /*
75
+ * For phpBB 4.0 with core webpush notifications copy all
76
+ * webpush subscriptions data from extension's tables to the core ones
77
+ * on the extension purge.
78
+ */
68
79
public function copy_subscription_tables ()
69
80
{
70
81
$ core_notification_push_table = $ this ->table_prefix . 'notification_push ' ;
0 commit comments