mirror of
https://github.com/bitwarden/server.git
synced 2025-07-02 00:22:50 -05:00
enabled send and added send sync notifications (#1106)
This commit is contained in:
@ -139,6 +139,36 @@ namespace Bit.Core.Services
|
||||
await SendPayloadToUserAsync(userId, type, message, false);
|
||||
}
|
||||
|
||||
public async Task PushSyncSendCreateAsync(Send send)
|
||||
{
|
||||
await PushSendAsync(send, PushType.SyncSendCreate);
|
||||
}
|
||||
|
||||
public async Task PushSyncSendUpdateAsync(Send send)
|
||||
{
|
||||
await PushSendAsync(send, PushType.SyncSendUpdate);
|
||||
}
|
||||
|
||||
public async Task PushSyncSendDeleteAsync(Send send)
|
||||
{
|
||||
await PushSendAsync(send, PushType.SyncSendDelete);
|
||||
}
|
||||
|
||||
private async Task PushSendAsync(Send send, PushType type)
|
||||
{
|
||||
if (send.UserId.HasValue)
|
||||
{
|
||||
var message = new SyncSendPushNotification
|
||||
{
|
||||
Id = send.Id,
|
||||
UserId = send.UserId.Value,
|
||||
RevisionDate = send.RevisionDate
|
||||
};
|
||||
|
||||
await SendPayloadToUserAsync(message.UserId, type, message, true);
|
||||
}
|
||||
}
|
||||
|
||||
private async Task SendPayloadToUserAsync(Guid userId, PushType type, object payload, bool excludeCurrentContext)
|
||||
{
|
||||
var request = new PushSendRequestModel
|
||||
|
Reference in New Issue
Block a user