mirror of
https://github.com/Govor-team/Govor.git
synced 2026-11-18 05:15:06 +00:00
Add reactions, reliable push & session checks
Implements message reactions and reaction packs (domain models, services, admin HTTP API, media processing via ImageSharp and limits) and adds reliable push delivery (ChatPushNotification, ChatPushDispatcher, ChatPushWorker, improved ChatNotificationService). Enhances message reading (ReadChat API, unread counts, concurrency-safe receipts) and tightens session security (access-token session validation in JWT, hub filter, SessionAuthorization). Improves SignalR behavior (session groups, reaction/channel events, hub/error mappings). Adds EF migrations, many controller fixes (Forbid handling, password API), tests (Govor.Server.Tests), docs, CI and tooling updates (Dockerfile → .NET 10, GH Actions matrix for sqlite/postgres, Govor.Server.slnx, global.json), and small infra changes (AutoMapper bump, NullPushProvider, storage/token handling).
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
using Govor.Domain.Models.Messages;
|
||||
|
||||
namespace Govor.Contracts.Responses.SignalR;
|
||||
|
||||
public class ChatReadResponse
|
||||
{
|
||||
public Guid ChatId { get; set; }
|
||||
public RecipientType RecipientType { get; set; }
|
||||
public Guid ReaderId { get; set; }
|
||||
public DateTime ReadAt { get; set; }
|
||||
public Guid? UpToMessageId { get; set; }
|
||||
public DateTime? UpToSentAt { get; set; }
|
||||
public IReadOnlyList<Guid>? MessageIds { get; set; }
|
||||
public int ReadCount { get; set; }
|
||||
public int UnreadCount { get; set; }
|
||||
}
|
||||
@@ -49,6 +49,12 @@ public class HubResult<T>
|
||||
ErrorMessage = message,
|
||||
};
|
||||
|
||||
public static HubResult<T> Forbidden(string message) => new()
|
||||
{
|
||||
Status = HubResultStatus.Forbidden,
|
||||
ErrorMessage = message
|
||||
};
|
||||
|
||||
public static HubResult<T> UnprocessableEntity(string message) => new()
|
||||
{
|
||||
Status = HubResultStatus.UnprocessableEntity,
|
||||
@@ -69,8 +75,9 @@ public enum HubResultStatus : int
|
||||
NoContent = 204,
|
||||
BadRequest = 400,
|
||||
Unauthorized = 401,
|
||||
Forbidden = 403,
|
||||
NotFound = 404,
|
||||
Conflict = 409,
|
||||
UnprocessableEntity = 422,
|
||||
ServerError = 500,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
using Govor.Domain.Models.Messages;
|
||||
using Govor.Domain.Models.Reactions;
|
||||
|
||||
namespace Govor.Contracts.Responses.SignalR;
|
||||
|
||||
public class ReactionCountResponse
|
||||
{
|
||||
public Guid? ReactionId { get; set; }
|
||||
public string ReactionCode { get; set; } = string.Empty;
|
||||
public int Count { get; set; }
|
||||
}
|
||||
|
||||
public class MessageReactionsChangedResponse
|
||||
{
|
||||
public Guid MessageId { get; set; }
|
||||
public Guid RecipientId { get; set; }
|
||||
public RecipientType RecipientType { get; set; }
|
||||
public long Version { get; set; }
|
||||
public Guid ActorId { get; set; }
|
||||
public MessageReactionResponse? ActorReaction { get; set; }
|
||||
public List<ReactionCountResponse> Counts { get; set; } = [];
|
||||
}
|
||||
|
||||
public class ChannelReactionPolicyResponse
|
||||
{
|
||||
public Guid GroupId { get; set; }
|
||||
public ChannelReactionMode Mode { get; set; }
|
||||
public long Version { get; set; }
|
||||
public List<Guid> ReactionIds { get; set; } = [];
|
||||
}
|
||||
Reference in New Issue
Block a user