public async Task SendMessage(string user, string message)
        {
            var conversation = new mp_conversation
            {
                from    = Context.UserIdentifier,
                to      = user,
                message = message
            };

            ConversationUtil.AddConversation(conversation);

            await Clients.User(user).SendAsync(user, message);

            //await Clients.All.SendAsync("ReceiveMessage", Context.User.Identity.Name ?? "anonymous", message);
        }
Пример #2
0
        public IActionResult mconversations()
        {
            var user_id = _userManager.GetUserId(HttpContext.User);

            if (User.IsInRole("client"))
            {
                var profile = _profileService.GetProfileByUserId(user_id);
                ViewBag.conversation_items = ConversationUtil.GetUserChannels(profile.id, "client");
            }
            else if (User.IsInRole("clinician"))
            {
                var profile = _clinicianService.GetByUserId(user_id);
                ViewBag.conversation_items = ConversationUtil.GetUserChannels(profile.id, "client");
            }
            return(View());
        }
Пример #3
0
 public Conversation(IEnumerable <string> participants)
 {
     Participants = new SortedSet <string>(participants);
     Uuid         = ConversationUtil.GenerateUuid(Participants);
 }
Пример #4
0
        public IQueryable <mp_conversation> GetUserConversations(string contact_id)
        {
            var user_id = _userManager.GetUserId(HttpContext.User);

            return(ConversationUtil.GetConversations(contact_id, user_id));
        }