private void SetMyVcard(Vcard vcard)
        {
            if (vcard != null)
            {
                _image = Storage.ImageFromPhoto(vcard.Photo, out _avatarHash);

                _fullName = vcard.Fullname;
                _nickName = vcard.Nickname;

                NotifyPropertyChanged("FullName");
                NotifyPropertyChanged("NickName");
                NotifyPropertyChanged("DisplayName");

                Storage.CacheVCard(vcard, Jid.Bare);
            }

            if (_image == null)
            {
                _image = Storage.GetDefaultAvatar();
            }

            NotifyPropertyChanged("Image");
            NotifyPropertyChanged("IsImageTransparent");

            _card = new VCard(vcard, Jid);
        }
Example #2
0
        public void SetVcard(Vcard vcard)
        {
            if (App.CheckAccessSafe())
            {
                _hasVCardRecieved = true;
                NotifyPropertyChanged("HasVCardRecieved");

                if (vcard != null)
                {
                    _fullName = vcard.Fullname;
                    _nickName = vcard.Nickname;

                    NotifyPropertyChanged("FullName");
                    NotifyPropertyChanged("NickName");
                    NotifyPropertyChanged("DisplayName");

                    BuildSearchText();

                    string hash;
                    Image = Storage.ImageFromPhoto(vcard.Photo, out hash);

                    if (Image != null)
                    {
                        _avatarHash = hash;
                        NotifyPropertyChanged("AvatarHash");
                    }

                    _card = new VCard(vcard, Jid);

                    NotifyPropertyChanged("Card");

                    Storage.CacheVCard(vcard, Jid.Bare);
                }
            }
            else
            {
                App.InvokeSafe(App._dispatcherPriority, new VcardHandler(SetVcard), vcard);
            }
        }