mirror of
https://github.com/bitwarden/server.git
synced 2024-12-13 15:36:45 +01:00
refactor the code and remove private methods
This commit is contained in:
parent
f33f93dc0f
commit
3539f7d2bf
@ -235,7 +235,7 @@ public class NotificationHubPushNotificationService : IPushNotificationService
|
||||
Enabled = organization.Enabled
|
||||
};
|
||||
|
||||
await SendPayloadToUserAsync(organization.Id, PushType.SyncOrganizationStatusChanged, message, true);
|
||||
await SendPayloadToOrganizationAsync(organization.Id, PushType.SyncOrganizationStatusChanged, message, false);
|
||||
}
|
||||
|
||||
private string GetContextIdentifier(bool excludeCurrentContext)
|
||||
|
@ -225,20 +225,12 @@ public class AzureQueuePushNotificationService : IPushNotificationService
|
||||
|
||||
public async Task PushSyncOrganizationStatusAsync(Organization organization)
|
||||
{
|
||||
await PushOrganizationStatusAsync(organization, PushType.SyncOrganizationStatusChanged);
|
||||
}
|
||||
|
||||
private async Task PushOrganizationStatusAsync(Organization organization, PushType type)
|
||||
{
|
||||
if (organization is not null)
|
||||
var message = new OrganizationStatusPushNotification
|
||||
{
|
||||
var message = new OrganizationStatusPushNotification
|
||||
{
|
||||
OrganizationId = organization.Id,
|
||||
Enabled = organization.Enabled
|
||||
};
|
||||
|
||||
await SendMessageAsync(type, message, true);
|
||||
}
|
||||
OrganizationId = organization.Id,
|
||||
Enabled = organization.Enabled
|
||||
};
|
||||
await SendMessageAsync(PushType.SyncOrganizationStatusChanged, message, false);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -231,20 +231,12 @@ public class NotificationsApiPushNotificationService : BaseIdentityClientService
|
||||
|
||||
public async Task PushSyncOrganizationStatusAsync(Organization organization)
|
||||
{
|
||||
await PushOrganizationStatusAsync(organization, PushType.SyncOrganizationStatusChanged);
|
||||
}
|
||||
|
||||
private async Task PushOrganizationStatusAsync(Organization organization, PushType type)
|
||||
{
|
||||
if (organization is not null)
|
||||
var message = new OrganizationStatusPushNotification
|
||||
{
|
||||
var message = new OrganizationStatusPushNotification
|
||||
{
|
||||
OrganizationId = organization.Id,
|
||||
Enabled = organization.Enabled
|
||||
};
|
||||
OrganizationId = organization.Id,
|
||||
Enabled = organization.Enabled
|
||||
};
|
||||
|
||||
await SendMessageAsync(type, message, true);
|
||||
}
|
||||
await SendMessageAsync(PushType.SyncOrganizationStatusChanged, message, false);
|
||||
}
|
||||
}
|
||||
|
@ -261,6 +261,6 @@ public class RelayPushNotificationService : BaseIdentityClientService, IPushNoti
|
||||
Enabled = organization.Enabled
|
||||
};
|
||||
|
||||
await SendPayloadToOrganizationAsync(organization.Id, PushType.SyncOrganizationStatusChanged, message, true);
|
||||
await SendPayloadToOrganizationAsync(organization.Id, PushType.SyncOrganizationStatusChanged, message, false);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user