mirror of
https://github.com/bitwarden/server
synced 2026-01-05 10:03:23 +00:00
organization status changed code changes (#5113)
* organization status changed code changes Signed-off-by: Cy Okeke <cokeke@bitwarden.com> * Add the push notification to subscriptionUpdated Signed-off-by: Cy Okeke <cokeke@bitwarden.com> * send notification using the SendPayloadToUser Signed-off-by: Cy Okeke <cokeke@bitwarden.com> * Change the implementation to send userId * Added new implementation for orgstatus sync * refactor the code and remove private methods --------- Signed-off-by: Cy Okeke <cokeke@bitwarden.com>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using System.Text.Json;
|
||||
using System.Text.RegularExpressions;
|
||||
using Bit.Core.AdminConsole.Entities;
|
||||
using Bit.Core.Auth.Entities;
|
||||
using Bit.Core.Context;
|
||||
using Bit.Core.Enums;
|
||||
@@ -226,6 +227,17 @@ public class NotificationHubPushNotificationService : IPushNotificationService
|
||||
}
|
||||
}
|
||||
|
||||
public async Task PushSyncOrganizationStatusAsync(Organization organization)
|
||||
{
|
||||
var message = new OrganizationStatusPushNotification
|
||||
{
|
||||
OrganizationId = organization.Id,
|
||||
Enabled = organization.Enabled
|
||||
};
|
||||
|
||||
await SendPayloadToOrganizationAsync(organization.Id, PushType.SyncOrganizationStatusChanged, message, false);
|
||||
}
|
||||
|
||||
private string GetContextIdentifier(bool excludeCurrentContext)
|
||||
{
|
||||
if (!excludeCurrentContext)
|
||||
|
||||
Reference in New Issue
Block a user