Ejemplo n.º 1
0
        private static async Task ExecuteChannelManagementLogic(SignalRClient signalRClient)
        {
            await ConnectAsync(signalRClient);

            var client = await HubCommands.GetClientAsync(signalRClient);

            var channel = await HubCommands.CreateChannelAsync(signalRClient);

            var secondChannel = await HubCommands.CreateChannelAsync(signalRClient);

            await HubCommands.UpdateChannelAsync(signalRClient, channel.Id);

            await HubCommands.MuteChannelAsync(signalRClient, channel.Id);

            await HubCommands.PinChannelAsync(signalRClient, channel.Id);

            await HubCommands.CloseChannelAsync(signalRClient, channel.Id);

            // switch user
            _authMicroserviceConfiguration.UserName = _authMicroserviceConfiguration.InvitedUserName;
            await ConnectAsync(signalRClient);

            await HubCommands.JoinToChannelAsync(signalRClient, secondChannel.Id);

            await HubCommands.LeaveChannelAsync(signalRClient, secondChannel.Id);

            await HubCommands.CreateDirectChannelAsync(signalRClient, client.MemberId);

            await signalRClient.DisconnectAsync();
        }
Ejemplo n.º 2
0
        private static async Task ExecuteMessageManagementLogic(SignalRClient signalRClient, AuthMicroserviceConfiguration authMicroserviceConfiguration)
        {
            await ConnectAsync(authMicroserviceConfiguration, signalRClient);

            var channel = await HubCommands.CreateChannelAsync(signalRClient);

            var message = await HubCommands.AddMessageAsync(signalRClient, channel.Id);

            await HubCommands.SetLastReadMessageAsync(signalRClient, channel.Id, message.Id);

            await HubCommands.UpdateMessageAsync(signalRClient, message.Id);

            await HubCommands.DeleteMessageAsync(signalRClient, channel.Id, message.Id);
        }
Ejemplo n.º 3
0
        private static async Task ExecuteMessageManagementLogic(SignalRClient signalRClient)
        {
            await ConnectAsync(signalRClient);

            var channel = await HubCommands.CreateChannelAsync(signalRClient);

            var message = await HubCommands.AddMessageAsync(signalRClient, channel.Id);

            await HubCommands.SetLastReadMessageAsync(signalRClient, channel.Id, message.Id);

            await HubCommands.UpdateMessageAsync(signalRClient, message.Id);

            await HubCommands.DeleteMessageAsync(signalRClient, channel.Id, message.Id);

            await signalRClient.DisconnectAsync();
        }
Ejemplo n.º 4
0
        private static async Task ExecuteMembersManagementLogic(SignalRClient signalRClient, AuthMicroserviceConfiguration authMicroserviceConfiguration)
        {
            var userName        = authMicroserviceConfiguration.UserName;
            var invitedUserName = authMicroserviceConfiguration.InvitedUserName;

            authMicroserviceConfiguration.UserName = invitedUserName;
            await ConnectAsync(authMicroserviceConfiguration, signalRClient);

            var client = await HubCommands.GetClientAsync(signalRClient);

            // switch user
            authMicroserviceConfiguration.UserName = userName;
            await ConnectAsync(authMicroserviceConfiguration, signalRClient);

            var channel = await HubCommands.CreateChannelAsync(signalRClient);

            await HubCommands.InviteMemberAsync(signalRClient, channel.Id, client.MemberId);

            await HubCommands.DeleteMemberAsync(signalRClient, channel.Id, client.MemberId);

            await HubCommands.InviteMultipleMembersAsync(signalRClient, channel.Id, client.MemberId);
        }