Beispiel #1
0
        public async Task <Message> InsertMessageAsync(Message inputMessage, Guid userId)
        {
            var check = await userChatAssociationsService.CheckUserInChatAsync(inputMessage.ChatId, userId);

            if (!check)
            {
                ExceptionManager.Friendly("Chat not found");
            }

            var message = messagingFactory.CreateMessage(inputMessage.Body, userId, inputMessage.ChatId);
            await messageRepository.InsertAsync(message);

            return(message);
        }