예제 #1
0
파일: ChatService.cs 프로젝트: mrtcn/upope
        public async Task <List <ChatModel> > GetChats(string accessToken, int chatRoomId)
        {
            var chatRoom = _chatRoomService.Get(chatRoomId);

            var userProfile = await _identityService.GetUserProfileById(accessToken, chatRoom.UserId);

            var chatUserProfile = await _identityService.GetUserProfileById(accessToken, chatRoom.ChatUserId);

            IQueryable <ChatModel> chats = GetWholeChats(chatRoomId);

            chats = ApplyUserTypeRestrictions(userProfile, chatUserProfile, chats);

            return(chats.ToList());
        }