forked from Nexus/nexus
make webpush enabled check better
Because Continuwuity sends a VAPID even when webpush is disabled.
This commit is contained in:
parent
7424bec0fb
commit
9d495410f6
2 changed files with 12 additions and 3 deletions
|
|
@ -225,7 +225,8 @@ class UnifiedPushController extends AsyncNotifier<String?> {
|
|||
CapabilitiesController.provider.future,
|
||||
);
|
||||
|
||||
if (capabilities.webpush?.vapid == null) {
|
||||
final vapid = capabilities.webPushVapid;
|
||||
if (vapid == null) {
|
||||
throw UnsupportedError(
|
||||
"Your homeserver does not support MSC4174 (Web Push), and therefore cannot send notifications to Nexus.",
|
||||
);
|
||||
|
|
@ -243,7 +244,7 @@ class UnifiedPushController extends AsyncNotifier<String?> {
|
|||
await Future.wait([
|
||||
UnifiedPush.register(
|
||||
instance: deviceId,
|
||||
vapid: capabilities.webpush?.vapid,
|
||||
vapid: vapid,
|
||||
),
|
||||
endpoint.future,
|
||||
], eagerError: true);
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ class UnifiedPushAllowedController extends AsyncNotifier<String?> {
|
|||
CapabilitiesController.provider.future,
|
||||
);
|
||||
|
||||
if (capabilities.webpush?.vapid == null) {
|
||||
if (capabilities.webPushVapid == null) {
|
||||
return "Your homeserver does not support MSC4174 (Web Push), and therefore cannot send notifications to Nexus.";
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue