Exemplo n.º 1
0
        internal void OnRecivedVCard(IQVCard sender, EventArgs args)
        {
            if (RecivedVCard != null)
            {

                if (sender.NTPicture.ImageBase64 != null & sender.NTPicture.ImageBase64.Length > 0) mPresenceAvatarSHA1 = SHA1_ComputeHexaHash(System.Convert.FromBase64String(sender.NTPicture.ImageBase64));
                RecivedVCard(sender, args);
            }
        }
Exemplo n.º 2
0
 internal void OnRecivedVCard(IQVCard sender, EventArgs args)
 {
     if (RecivedVCard != null)
     {
         if (sender.NTPicture.ImageBase64 != null & sender.NTPicture.ImageBase64.Length > 0)
         {
             mPresenceAvatarSHA1 = SHA1_ComputeHexaHash(System.Convert.FromBase64String(sender.NTPicture.ImageBase64));
         }
         RecivedVCard(sender, args);
     }
 }
Exemplo n.º 3
0
        internal void ProcessIQ(String iqraw)
        {
            IQ iq = null;

            using (MemoryStream stream = new MemoryStream(Encoding.UTF8.GetBytes(iqraw)))
            {
                XmlSerializer des = new XmlSerializer(typeof(IQ));
                try
                {
                    iq = (IQ)des.Deserialize(stream);
                }
                catch (Exception ex)
                {
                    return;
                }
                stream.Close();
            }
            if (iq == null | iq.Items == null)
            {
                return;
            }

            if (iq.Type == IQType.Result)
            {
                foreach (object item in iq.Items)
                {
                    try
                    {
                        if (item.GetType() == typeof(IQBind))
                        {
                            return;
                        }
                        if (item.GetType() == typeof(IQAuth))
                        {
                            return;
                        }
                        if (item.GetType() == typeof(IQBrowse))
                        {
                            return;
                        }
                        if (item.GetType() == typeof(IQDiscoInfo))
                        {
                            return;
                        }
                        if (item.GetType() == typeof(IQDiscoItems))
                        {
                            return;
                        }
                        if (item.GetType() == typeof(IQRoster))
                        {
                            return;
                        }
                        if (item.GetType() == typeof(IQSession))
                        {
                            return;
                        }

                        if (item.GetType() == typeof(IQVCard))
                        {
                            IQVCard vcard = (IQVCard)item;
                            vcard.NTJabberID = iq.From != null ? iq.From : iq.To;
                            OnRecivedVCard(vcard, new EventArgs());
                        }
                    }

                    catch (Exception)
                    {
                        //   throw;
                    }
                }
            }
        }