public void Handle(TLUpdateContactLinkBase update)
 {
     if (With != null &&
         With.Index == update.UserId.Value)
     {
         Execute.BeginOnUIThread(() =>
         {
             Subtitle = GetSubtitle(With);
             NotifyOfPropertyChange(() => Subtitle);
             NotifyOfPropertyChange(() => With);
         });
     }
 }
Example #2
0
        public void Handle(TLUpdateContactLinkBase update)
        {
            var updateContactLink24 = update as TLUpdateContactLink24;

            if (updateContactLink24 != null && updateContactLink24.MyLink is TLContactLinkNone)
            {
                Execute.BeginOnUIThread(() =>
                {
                    for (var i = 0; i < Items.Count; i++)
                    {
                        var userBase = Items[i].With as TLUserBase;
                        if (userBase != null &&
                            userBase.Index == update.UserId.Value)
                        {
                            Items[i].NotifyOfPropertyChange(() => Items[i].With);
                        }
                    }
                });
            }
        }
Example #3
0
        public void Handle(TLUpdateContactLinkBase update)
        {
            BeginOnUIThread(() =>
            {
                if (LazyItems.Count > 0)
                {
                    return;
                }

                var updateContactLink24 = update as TLUpdateContactLink24;
                if (updateContactLink24 == null)
                {
                    return;
                }

                var isContact = updateContactLink24.MyLink is TLContactLink;
                var item      = Items.FirstOrDefault(x => x.Index == updateContactLink24.UserId.Value);
                if (item != null)
                {
                    if (isContact)
                    {
                        InsertContact(item);
                    }
                    else
                    {
                        Items.Remove(item);
                    }
                }
                else if (isContact)
                {
                    var user = CacheService.GetUser(update.UserId);
                    if (user != null)
                    {
                        InsertContact(user);
                    }
                }
            });
        }