mirror of
https://github.com/bitwarden/server.git
synced 2025-07-01 16:12:49 -05:00
PM-10564: Notification create push notification simplification.
NotificationStatus not needed.
This commit is contained in:
@ -37,7 +37,7 @@ public class CreateNotificationCommand : ICreateNotificationCommand
|
||||
|
||||
var newNotification = await _notificationRepository.CreateAsync(notification);
|
||||
|
||||
await _pushNotificationService.PushSyncNotificationCreateAsync(newNotification, null);
|
||||
await _pushNotificationService.PushSyncNotificationCreateAsync(newNotification);
|
||||
|
||||
return newNotification;
|
||||
}
|
||||
|
@ -182,7 +182,7 @@ public class NotificationHubPushNotificationService : IPushNotificationService
|
||||
await PushAuthRequestAsync(authRequest, PushType.AuthRequestResponse);
|
||||
}
|
||||
|
||||
public async Task PushSyncNotificationCreateAsync(Notification notification, NotificationStatus? notificationStatus)
|
||||
public async Task PushSyncNotificationCreateAsync(Notification notification)
|
||||
{
|
||||
var message = new SyncNotificationPushNotification
|
||||
{
|
||||
@ -190,9 +190,7 @@ public class NotificationHubPushNotificationService : IPushNotificationService
|
||||
UserId = notification.UserId,
|
||||
OrganizationId = notification.OrganizationId,
|
||||
ClientType = notification.ClientType,
|
||||
RevisionDate = notification.RevisionDate,
|
||||
ReadDate = notificationStatus?.ReadDate,
|
||||
DeletedDate = notificationStatus?.DeletedDate
|
||||
RevisionDate = notification.RevisionDate
|
||||
};
|
||||
|
||||
if (notification.UserId.HasValue)
|
||||
|
@ -24,7 +24,7 @@ public interface IPushNotificationService
|
||||
Task PushSyncSendCreateAsync(Send send);
|
||||
Task PushSyncSendUpdateAsync(Send send);
|
||||
Task PushSyncSendDeleteAsync(Send send);
|
||||
Task PushSyncNotificationCreateAsync(Notification notification, NotificationStatus? notificationStatus);
|
||||
Task PushSyncNotificationCreateAsync(Notification notification);
|
||||
Task PushSyncNotificationUpdateAsync(Notification notification, NotificationStatus? notificationStatus);
|
||||
Task PushAuthRequestAsync(AuthRequest authRequest);
|
||||
Task PushAuthRequestResponseAsync(AuthRequest authRequest);
|
||||
|
@ -165,7 +165,7 @@ public class AzureQueuePushNotificationService : IPushNotificationService
|
||||
await PushSendAsync(send, PushType.SyncSendDelete);
|
||||
}
|
||||
|
||||
public async Task PushSyncNotificationCreateAsync(Notification notification, NotificationStatus? notificationStatus)
|
||||
public async Task PushSyncNotificationCreateAsync(Notification notification)
|
||||
{
|
||||
var message = new SyncNotificationPushNotification
|
||||
{
|
||||
@ -173,9 +173,7 @@ public class AzureQueuePushNotificationService : IPushNotificationService
|
||||
UserId = notification.UserId,
|
||||
OrganizationId = notification.OrganizationId,
|
||||
ClientType = notification.ClientType,
|
||||
RevisionDate = notification.RevisionDate,
|
||||
ReadDate = notificationStatus?.ReadDate,
|
||||
DeletedDate = notificationStatus?.DeletedDate
|
||||
RevisionDate = notification.RevisionDate
|
||||
};
|
||||
|
||||
await SendMessageAsync(PushType.SyncNotificationCreate, message, true);
|
||||
|
@ -146,9 +146,9 @@ public class MultiServicePushNotificationService : IPushNotificationService
|
||||
return Task.FromResult(0);
|
||||
}
|
||||
|
||||
public Task PushSyncNotificationCreateAsync(Notification notification, NotificationStatus? notificationStatus)
|
||||
public Task PushSyncNotificationCreateAsync(Notification notification)
|
||||
{
|
||||
PushToServices((s) => s.PushSyncNotificationCreateAsync(notification, notificationStatus));
|
||||
PushToServices((s) => s.PushSyncNotificationCreateAsync(notification));
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
|
@ -172,7 +172,7 @@ public class NotificationsApiPushNotificationService : BaseIdentityClientService
|
||||
await PushSendAsync(send, PushType.SyncSendDelete);
|
||||
}
|
||||
|
||||
public async Task PushSyncNotificationCreateAsync(Notification notification, NotificationStatus? notificationStatus)
|
||||
public async Task PushSyncNotificationCreateAsync(Notification notification)
|
||||
{
|
||||
var message = new SyncNotificationPushNotification
|
||||
{
|
||||
@ -180,9 +180,7 @@ public class NotificationsApiPushNotificationService : BaseIdentityClientService
|
||||
UserId = notification.UserId,
|
||||
OrganizationId = notification.OrganizationId,
|
||||
ClientType = notification.ClientType,
|
||||
RevisionDate = notification.RevisionDate,
|
||||
ReadDate = notificationStatus?.ReadDate,
|
||||
DeletedDate = notificationStatus?.DeletedDate
|
||||
RevisionDate = notification.RevisionDate
|
||||
};
|
||||
|
||||
await SendMessageAsync(PushType.SyncNotificationCreate, message, true);
|
||||
|
@ -190,7 +190,7 @@ public class RelayPushNotificationService : BaseIdentityClientService, IPushNoti
|
||||
await SendPayloadToUserAsync(authRequest.UserId, type, message, true);
|
||||
}
|
||||
|
||||
public async Task PushSyncNotificationCreateAsync(Notification notification, NotificationStatus? notificationStatus)
|
||||
public async Task PushSyncNotificationCreateAsync(Notification notification)
|
||||
{
|
||||
var message = new SyncNotificationPushNotification
|
||||
{
|
||||
@ -198,9 +198,7 @@ public class RelayPushNotificationService : BaseIdentityClientService, IPushNoti
|
||||
UserId = notification.UserId,
|
||||
OrganizationId = notification.OrganizationId,
|
||||
ClientType = notification.ClientType,
|
||||
RevisionDate = notification.RevisionDate,
|
||||
ReadDate = notificationStatus?.ReadDate,
|
||||
DeletedDate = notificationStatus?.DeletedDate
|
||||
RevisionDate = notification.RevisionDate
|
||||
};
|
||||
|
||||
if (notification.UserId.HasValue)
|
||||
|
@ -106,7 +106,7 @@ public class NoopPushNotificationService : IPushNotificationService
|
||||
return Task.FromResult(0);
|
||||
}
|
||||
|
||||
public Task PushSyncNotificationCreateAsync(Notification notification, NotificationStatus? notificationStatus) => Task.CompletedTask;
|
||||
public Task PushSyncNotificationCreateAsync(Notification notification) => Task.CompletedTask;
|
||||
|
||||
public Task PushSyncNotificationUpdateAsync(Notification notification, NotificationStatus? notificationStatus) => Task.CompletedTask;
|
||||
}
|
||||
|
Reference in New Issue
Block a user