Exemplo n.º 1
0
        private void OnUserTyping(User user, string room)
        {
            InvokeIfInRoom(room, roomVm =>
            {
                UserViewModel userVm = _userService.GetUserViewModel(user);
                if (userVm == null || userVm.IsCurrentUser)
                {
                    return;
                }

                PostOnUi(() => roomVm.SetUserTyping(userVm));
            });
        }
Exemplo n.º 2
0
        private void CompleteSignin(LogOnInfo logOnInfo, TaskCompletionSource <UserViewModel> taskCompletionSource)
        {
            _logOnInfo = logOnInfo;

            User          userinfo      = _client.GetUserInfo().Result;
            UserViewModel userviewModel = _userService.GetUserViewModel(userinfo);

            userviewModel.IsCurrentUser = true;

            _roomService.JoinRooms(logOnInfo.Rooms);
            _roomService.GetRooms();

            CurrentUser = userviewModel;

            taskCompletionSource.TrySetResult(userviewModel);
        }
Exemplo n.º 3
0
        private ChatMessageViewModel CreateMessageViewModel(Message message)
        {
            string        content = ProcessEmoji(message.Content);
            var           msgVm   = _serviceLocator.GetViewModel <ChatMessageViewModel>();
            UserViewModel userVm  = _userService.GetUserViewModel(message.User);

            msgVm.IsNotifying = false;

            msgVm.RawContent      = message.Content;
            msgVm.MessageDateTime = message.When.LocalDateTime;
            msgVm.MessageId       = message.Id;
            msgVm.RichContent     = ConvertToXaml(content);
            msgVm.User            = userVm;

            msgVm.IsNotifying = true;

            return(msgVm);
        }