Files
Govor/Govor.Application/Reactions/IMessageReactionService.cs
Artemy 29cc51ee0c 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).
2026-10-03 17:42:24 +07:00

20 lines
1.0 KiB
C#

using Govor.Domain.Common;
using Govor.Domain.Models.Messages;
using Govor.Domain.Models.Reactions;
using SmartRes;
namespace Govor.Application.Reactions;
public record ReactionCount(Guid? ReactionId, string ReactionCode, int Count);
public record MessageReactionState(Guid MessageId, Guid RecipientId, RecipientType RecipientType,
long Version, Guid ActorId, MessageReaction? ActorReaction, IReadOnlyList<ReactionCount> Counts, bool Changed = false);
public record ChannelReactionPolicy(Guid GroupId, ChannelReactionMode Mode, long Version, IReadOnlyList<Guid> ReactionIds);
public interface IMessageReactionService
{
Task<Result<MessageReactionState, Error>> GetAsync(Guid userId, Guid messageId);
Task<Result<MessageReactionState, Error>> SetAsync(Guid userId, Guid messageId, Guid? reactionId);
Task<Result<ChannelReactionPolicy, Error>> GetPolicyAsync(Guid userId, Guid groupId);
Task<Result<ChannelReactionPolicy, Error>> SetPolicyAsync(Guid userId, Guid groupId, ChannelReactionMode mode, IReadOnlyCollection<Guid> reactionIds);
}