using IM_API.Domain.Events; using IM_API.Interface.Services; using MassTransit; namespace IM_API.Application.EventHandlers.FriendAddHandler { public class FriendAddConversationHandler : IConsumer { private readonly IConversationService _cService; public FriendAddConversationHandler(IConversationService cService) { _cService = cService; } public async Task Consume(ConsumeContext context) { var @event = context.Message; await _cService.MakeConversationAsync(@event.RequestUserId, @event.ResponseUserId, Models.ChatType.PRIVATE); await _cService.MakeConversationAsync(@event.ResponseUserId, @event.RequestUserId, Models.ChatType.PRIVATE); } } }