示例#1
0
        public XmppVCard(XmppJid jid, XmppIQ stream)
        {
            Jid = jid;

            XmppIQ xFN = stream.FindDescendant("FN", ns);

            if (xFN != null)
            {
                FN = xFN.Text;
            }

            XmppIQ xPhoto = stream.FindDescendant("PHOTO", ns);

            if (xPhoto != null)
            {
                XmppIQ xPhotoType = xPhoto.FindChild("TYPE", ns);
                if (xPhotoType != null)
                {
                    PhotoType = xPhotoType.Text;
                }
                XmppIQ xPhotoBin = xPhoto.FindChild("BINVAL", ns);
                if (xPhotoBin != null)
                {
                    PhotoBinVal = xPhotoBin.Text;
                }
            }
        }
示例#2
0
        public override bool Equals(object obj)
        {
            if (obj == null || (obj is XmppJid))
            {
                return(false);
            }

            XmppJid cJid = obj as XmppJid;

            return(this.Bare == cJid.Bare && this.Resource == cJid.Resource);
        }
示例#3
0
        public string ToStream(XmppJid from, XmppJid to, XmppIqType type, string id, string content)
        {
            StringBuilder result = new StringBuilder("<iq ");

            if (from != null && !string.IsNullOrWhiteSpace(from.Value))
            {
                result.AppendFormat("from=\"{0}\" ", from.Value);
            }
            if (to != null && !string.IsNullOrWhiteSpace(to.Value))
            {
                result.AppendFormat("to=\"{0}\" ", to.Value);
            }
            result.AppendFormat("id=\"{0}\" ", id);
            result.AppendFormat("type=\"{0}\">{1}</iq>", XmppIq.TypeToStr(type), content);
            return(result.ToString());
        }
示例#4
0
 public XmppSubscribeRequestEventArgs(XmppJid jid)
 {
     From = jid;
 }
示例#5
0
 public XmppChatNotifyEventArgs(XmppJid jid, string thread, XmppChatStatus chatStatus)
 {
     From       = jid;
     Thread     = thread;
     ChatStatus = chatStatus;
 }
示例#6
0
 public XmppRosterItem(string jid, string sub, string name, string group, string ask)
 {
     Jid = new XmppJid(jid); Subscription = sub; Name = name; Group = group; Ask = ask;
 }