1
0
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:
Cy Okeke 2024-12-12 15:02:29 +01:00
parent f33f93dc0f
commit 3539f7d2bf
No known key found for this signature in database
GPG Key ID: 88B341B55C84B45C
4 changed files with 13 additions and 29 deletions

View File

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

View File

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

View File

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

View File

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