private void GotIQ(object sender, IQ iq) { switch (iq.Type) { case IQType.get: if (iq.Query is DiscoInfo) { DiscoInfoIQ outdisco = new DiscoInfoIQ(XmppGlobal.InternalClient.Document); outdisco.Query = (XmlElement)disco_info.Clone(); outdisco.To = iq.From; outdisco.ID = iq.ID; outdisco.Type = IQType.result; XmppGlobal.Connection.SendPacket(outdisco); } break; case IQType.result: if (iq.Query is DiscoInfo) { XmppGlobal.InternalQueryCache.DiscoInfo[iq.From.ToString() + "!!!!!" + (iq.Query as DiscoInfo).Node] = iq; } else if (iq.Query is DiscoItems) { XmppGlobal.InternalQueryCache.DiscoItems[iq.From.ToString() + "!!!!!" + (iq.Query as DiscoItems).Node] = iq; } break; } //TODO: dataforms //if (CheckForFormData (iq)) { // DataForm f = new DataForm (); // f.LoadForm (iq); // f.Show (); //} }
public DiscoInfoIQ CreateDiscoInfoQuery() { DiscoInfoIQ iq = new DiscoInfoIQ(XmppGlobal.InternalClient.Document); iq.Type = jabber.protocol.client.IQType.get; return(iq); }
/// <summary> /// Requests a list of agents from the XMPP server. /// </summary> public void GetAgents() { DiscoInfoIQ diq = new DiscoInfoIQ(Document); diq.Type = IQType.get; diq.To = this.Server; Tracker.BeginIQ(diq, new IqCB(GotDiscoInfo), null); }
/// <summary> /// Creates a disco#info IQ packet. /// </summary> /// <param name="doc">XmlDocument to create the XML elements with.</param> /// <returns>XML representing the disco#info request.</returns> public IQ InfoIQ(System.Xml.XmlDocument doc) { m_pendingInfo = true; DiscoInfoIQ iiq = new DiscoInfoIQ(doc); iiq.To = JID; iiq.Type = IQType.get; if (Node != null) { DiscoInfo info = iiq.Instruction; info.Node = Node; } return(iiq); }
public void DiscoInfoQuery(jabber.JID to, string node, bool refresh, QueryCallback callback, object state) { if (!refresh) { IQ cache_version = XmppGlobal.InternalQueryCache.DiscoInfo[to.ToString() + "!!!!!" + node]; if (cache_version != null) { callback.Invoke(this, cache_version, state); return; } } DiscoInfoIQ iq = XmppGlobal.Queries.CreateDiscoInfoQuery(); iq.To = to; if (!string.IsNullOrEmpty(node)) { iq.Node = node; } XmppGlobal.Queries.SendQuery(iq, callback, state); }
/// <summary> /// Requests a list of agents from the XMPP server. /// </summary> public void GetAgents() { DiscoInfoIQ diq = new DiscoInfoIQ(Document) {Type = IQType.Get, To = Server}; Tracker.BeginIQ(diq, GotDiscoInfo, null); }
private void GotIQ(object sender, IQ iq) { switch (iq.Type) { case IQType.get: if (iq.Query is DiscoInfo) { DiscoInfoIQ outdisco = new DiscoInfoIQ (XmppGlobal.InternalClient.Document); outdisco.Query = (XmlElement)disco_info.Clone (); outdisco.To = iq.From; outdisco.ID = iq.ID; outdisco.Type = IQType.result; XmppGlobal.Connection.SendPacket (outdisco); } break; case IQType.result: if (iq.Query is DiscoInfo) XmppGlobal.InternalQueryCache.DiscoInfo[iq.From.ToString () + "!!!!!" + (iq.Query as DiscoInfo).Node] = iq; else if (iq.Query is DiscoItems) XmppGlobal.InternalQueryCache.DiscoItems[iq.From.ToString () + "!!!!!" + (iq.Query as DiscoItems).Node] = iq; break; } //TODO: dataforms //if (CheckForFormData (iq)) { // DataForm f = new DataForm (); // f.LoadForm (iq); // f.Show (); //} }
/// <summary> /// Creates a disco#info IQ packet. /// </summary> /// <param name="doc">XmlDocument to create the XML elements with.</param> /// <returns>XML representing the disco#info request.</returns> public IQ InfoIQ(System.Xml.XmlDocument doc) { m_pendingInfo = true; DiscoInfoIQ iiq = new DiscoInfoIQ(doc); iiq.To = JID; iiq.Type = IQType.get; if (Node != null) { DiscoInfo info = iiq.Instruction; info.Node = Node; } return iiq; }
public DiscoInfoIQ CreateDiscoInfoQuery() { DiscoInfoIQ iq = new DiscoInfoIQ (XmppGlobal.InternalClient.Document); iq.Type = jabber.protocol.client.IQType.get; return iq; }