public void Handle(TLUpdateUserName userName)
        {
            Execute.BeginOnUIThread(() =>
            {
                for (var i = 0; i < Items.Count; i++)
                {
                    if (Items[i].WithId == userName.UserId.Value &&
                        Items[i].With is TLUserBase)
                    {
                        var user       = (TLUserBase)Items[i].With;
                        user.FirstName = userName.FirstName;
                        user.LastName  = userName.LastName;

                        var userWithUserName = user as IUserName;
                        if (userWithUserName != null)
                        {
                            userWithUserName.UserName = userName.UserName;
                        }

                        Items[i].NotifyOfPropertyChange(() => Items[i].With);
                        break;
                    }
                }
            });
        }
Example #2
0
        public void Handle(TLUpdateUserName update)
        {
            // threadpool
            var userId  = update.UserId;
            var contact = CacheService.GetUser(userId) as TLUserContact;

            if (contact != null)
            {
                ContactsHelper.UpdateContactAsync(_fileManager, StateService, contact);
            }
        }
Example #3
0
        public void Handle(TLUpdateUserName update)
        {
            // threadpool
            var userId   = update.UserId;
            var userBase = CacheService.GetUser(userId);

            if (userBase != null && userBase.IsContact)
            {
                ContactsHelper.UpdateContactAsync(DownloadFileManager, StateService, userBase);
            }
        }
        public void Handle(TLUpdateUserName userName)
        {
            Execute.BeginOnUIThread(() =>
            {
                for (int i = 0; i < Count; i++)
                {
                    if (this[i].WithId == userName.UserId && this[i].With is TLUser)
                    {
                        var userBase       = (TLUser)this[i].With;
                        userBase.FirstName = userName.FirstName;
                        userBase.LastName  = userName.LastName;
                        userBase.Username  = userName.Username;

                        this[i].RaisePropertyChanged(() => this[i].With);
                        return;
                    }
                }
            });
        }