Esempio n. 1
0
        public virtual async Task <Guid> Add(Guid currentUserId, Guid?chatId, TChatInfo chatInfo, TParticipationCandidates participationCandidates)
        {
            var command = ChatsCommandBuilder.BuildAddChatCommand(currentUserId, chatId, chatInfo, participationCandidates);
            await ChatsPermissionValidator.ValidateAdd(currentUserId, command.ChatId, chatInfo, ServiceName).ConfigureAwait(false);

            await ChatCommandSender.Send(command).ConfigureAwait(false);

            return(command.ChatId);
        }
Esempio n. 2
0
        public virtual async Task <Guid> Add(Guid currentUserId, Guid chatId, Guid?messageId, TChatMessageInfo messageInfo)
        {
            await ChatMessagesPermissionValidator.ValidateAdd(currentUserId, chatId, messageInfo, ServiceName)
            .ConfigureAwait(false);

            var command = ChatMessagesCommandBuilder.BuildIndexChatMessageCommand(currentUserId, chatId, messageId, false, messageInfo);
            await ChatCommandSender.Send(command).ConfigureAwait(false);

            return(command.MessageId);
        }
Esempio n. 3
0
        public virtual async Task Add(Guid currentUserId, Guid chatId, Guid userId, ChatParticipantType chatParticipantType, string style = null, string metadata = null)
        {
            await ChatParticipantsPermissionValidator.ValidateAdd(currentUserId, chatId, userId, chatParticipantType, style, metadata, ServiceName)
            .ConfigureAwait(false);

            var command = ChatParticipantsCommandBuilder.BuildAddChatParticipantCommand(currentUserId, chatId, userId, chatParticipantType, style, metadata);
            await ChatCommandSender.Send(command).ConfigureAwait(false);
        }