예제 #1
0
 public async Task SendUserStateChangeToClients(IReadOnlyList <IOnlineClient> clients, UserIdentifier user, FriendshipState newState)
 {
     await Task.CompletedTask;
 }
        public async Task SendUserStateChangeToClients(IReadOnlyList <IOnlineClient> clients, UserIdentifier user, FriendshipState newState)
        {
            foreach (var client in clients)
            {
                var signalRClient = GetSignalRClientOrNull(client);
                if (signalRClient == null)
                {
                    continue;
                }

                await signalRClient.SendAsync("getUserStateChange", user, newState);
            }
        }
예제 #3
0
        public Friendship(UserIdentifier user, UserIdentifier probableFriend, string probableFriendTenancyName, string probableFriendUserName, Guid?probableFriendProfilePictureId, FriendshipState state)
        {
            if (user == null)
            {
                throw new ArgumentNullException(nameof(user));
            }

            if (probableFriend == null)
            {
                throw new ArgumentNullException(nameof(probableFriend));
            }

            if (!Enum.IsDefined(typeof(FriendshipState), state))
            {
                throw new Exception("Invalid FriendshipState value: " + state);
            }

            UserId                 = user.UserId;
            TenantId               = user.TenantId;
            FriendUserId           = probableFriend.UserId;
            FriendTenantId         = probableFriend.TenantId;
            FriendTenancyName      = probableFriendTenancyName;
            FriendUserName         = probableFriendUserName;
            State                  = state;
            FriendProfilePictureId = probableFriendProfilePictureId;

            CreationTime = Clock.Now;
        }
예제 #4
0
 public void SendUserStateChangeToClients(IReadOnlyList <IOnlineClient> clients, UserIdentifier user, FriendshipState newState)
 {
 }
예제 #5
0
        public void SendUserStateChangeToClients(IReadOnlyList <IOnlineClient> clients, UserIdentifier user, FriendshipState newState)
        {
            foreach (var client in clients)
            {
                var signalRClient = GetSignalRClientOrNull(client);
                if (signalRClient == null)
                {
                    continue;
                }

                signalRClient.getUserStateChange(user, newState);
            }
        }
예제 #6
0
 public async Task <IEnumerable <Friendship> > GetByToUserAndStateAsync(Guid toUserId, FriendshipState state)
 {
     return(await entities.Where(friendship => friendship.ToUserId == toUserId && friendship.State == state)
            .Include(friendship => friendship.FromUser).ToListAsync());
 }
        public async Task SendUserStateChangeToClients(IReadOnlyList <IOnlineClient> clients, UserIdentifier user, FriendshipState newState)
        {
            foreach (var client in clients)
            {
                var signalRClient = GetSignalRClientOrNull(client);
                if (signalRClient == null)
                {
                    continue;
                }

                _enumExtensionsAppService.GetEntityEnumOutputDtoList <FriendshipState>();


                await signalRClient.SendAsync("getUserStateChange", user, newState.ToString());
            }
        }