mirror of
https://github.com/bitwarden/server.git
synced 2026-02-04 16:13:12 +08:00
PM-15084: Push notifications to installation id.
This enables the Notification Center created global notifications to be sent to affected devices of the same server installation. All clients connected to any of the server instance of that installation id would receive it. This is useful for notifying all clients of an installation about upcoming maintenance. This works both for Self-Hosted, but also for Cloud, assuming an installation id is set.
This commit is contained in:
@@ -272,9 +272,13 @@ public static class ServiceCollectionExtensions
|
||||
services.AddSingleton<IPushNotificationService, MultiServicePushNotificationService>();
|
||||
if (globalSettings.SelfHosted)
|
||||
{
|
||||
if (globalSettings.Installation.Id == default)
|
||||
{
|
||||
throw new InvalidOperationException("Installation Id must be set for self-hosted installations.");
|
||||
}
|
||||
|
||||
if (CoreHelpers.SettingHasValue(globalSettings.PushRelayBaseUri) &&
|
||||
globalSettings.Installation?.Id != null &&
|
||||
CoreHelpers.SettingHasValue(globalSettings.Installation?.Key))
|
||||
CoreHelpers.SettingHasValue(globalSettings.Installation.Key))
|
||||
{
|
||||
services.AddKeyedSingleton<IPushNotificationService, RelayPushNotificationService>("implementation");
|
||||
services.AddSingleton<IPushRegistrationService, RelayPushRegistrationService>();
|
||||
@@ -290,7 +294,7 @@ public static class ServiceCollectionExtensions
|
||||
services.AddKeyedSingleton<IPushNotificationService, NotificationsApiPushNotificationService>("implementation");
|
||||
}
|
||||
}
|
||||
else if (!globalSettings.SelfHosted)
|
||||
else
|
||||
{
|
||||
services.AddSingleton<INotificationHubPool, NotificationHubPool>();
|
||||
services.AddSingleton<IPushRegistrationService, NotificationHubPushRegistrationService>();
|
||||
|
||||
Reference in New Issue
Block a user