コード例 #1
0
        public async Task BlockUser(BlockUserInput input)
        {
            var userIdentifier = AbpSession.ToUserIdentifier();
            var friendIdentifier = new UserIdentifier(input.TenantId, input.UserId);
            await _friendshipManager.BanFriendAsync(userIdentifier, friendIdentifier);

            var clients = _onlineClientManager.GetAllByUserId(userIdentifier);
            if (clients.Any())
            {
                await _chatCommunicator.SendUserStateChangeToClients(clients, friendIdentifier, FriendshipState.Blocked);
            }
        }
コード例 #2
0
 public async Task BlockUser(BlockUserInput input)
 {
     var userIdentifier   = AbpSession.ToUserIdentifier();
     var friendIdentifier = new UserIdentifier(input.TenantId, input.UserId);
     await _friendshipManager.BanFriendAsync(userIdentifier, friendIdentifier);
 }