Ejemplo n.º 1
0
 internal void StartSession()
 {
     sessioniq = new SessionIQ();
     //sessioniq = new IQ();
     //sessioniq.InnerXML = "<session xmlns='urn:ietf:params:xml:ns:xmpp-session'/>";
     sessioniq.From = null;
     sessioniq.To   = null;
     sessioniq.Type = IQType.set.ToString();
     //XMPPClient.SendXMPP(sessioniq);
     XMPPClient.SendObject(sessioniq);
 }
Ejemplo n.º 2
0
 public IQ BuildIQ(System.Xml.Linq.XElement elem, string strXML)
 {
     if ((elem.FirstNode != null) && (elem.FirstNode is XElement) &&
         (((XElement)(elem.FirstNode)).Name == "{urn:xmpp:ping}ping"))
     {
         PingIQ query = Utility.ParseObjectFromXMLString(strXML, typeof(PingIQ)) as PingIQ;
         return(query);
     }
     else if ((elem.FirstNode != null) && (elem.FirstNode is XElement) &&
              (((XElement)(elem.FirstNode)).Name == "{urn:ietf:params:xml:ns:xmpp-session}session"))
     {
         SessionIQ query = Utility.ParseObjectFromXMLString(strXML, typeof(SessionIQ)) as SessionIQ;
         return(query);
     }
     else if ((elem.FirstNode != null) && (elem.FirstNode is XElement) &&
              (((XElement)(elem.FirstNode)).Name == "{urn:ietf:params:xml:ns:xmpp-bind}bind"))
     {
         BindIQ query = Utility.ParseObjectFromXMLString(strXML, typeof(BindIQ)) as BindIQ;
         return(query);
     }
     return(null);
 }