make webpush enabled check better

Because Continuwuity sends a VAPID even when webpush is disabled.
This commit is contained in:
Henry Hiles 2026-12-02 13:50:34 -05:00
commit 9d495410f6
Signed by: Henry-Hiles
SSH key fingerprint: SHA256:VKQUdS31Q90KvX7EkKMHMBpUspcmItAh86a+v7PGiIs

View file

@ -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);