private void OnDiscoInfoResult(object sender, IQ iq, object data) { // <iq from='proxy.cachet.myjabber.net' to='[email protected]/Exodus' type='result' id='jcl_19'> // <query xmlns='http://jabber.org/protocol/disco#info'> // <identity category='proxy' name='SOCKS5 Bytestreams Service' type='bytestreams'/> // <feature var='http://jabber.org/protocol/bytestreams'/> // <feature var='http://jabber.org/protocol/disco#info'/> // </query> // </iq> if (iq.Type == IqType.result) { if (iq.Query is DiscoInfo) { DiscoInfo di = iq.Query as DiscoInfo; if (di.HasFeature(agsXMPP.Uri.IQ_SEARCH)) { Jid jid = iq.From; if (!Util.XmppServices.Search.Contains(jid)) { Util.XmppServices.Search.Add(jid); } } else if (di.HasFeature(agsXMPP.Uri.BYTESTREAMS)) { Jid jid = iq.From; if (!Util.XmppServices.Proxy.Contains(jid)) { Util.XmppServices.Proxy.Add(jid); } } } } }
private void OnDiscoInfoResult(object sender, IQ iq, object data) { if (iq.Type == IqType.result) { if (iq.Query is DiscoInfo) { DiscoInfo di = iq.Query as DiscoInfo; Jid jid = iq.From; if (di.HasFeature(Uri.IQ_SEARCH)) { if (!Util.Services.Search.Contains(jid)) { Util.Services.Search.Add(jid); } } else if (di.HasFeature(Uri.BYTESTREAMS)) { if (!Util.Services.Proxy.Contains(jid)) { Util.Services.Proxy.Add(jid); } } } } }
private void GotDiscoInfo(object sender, IQ iq, object state) { bool error = false; if (iq.Type == IQType.error) { error = true; } else { DiscoInfo info = iq.Query as DiscoInfo; if (info == null) { error = true; } else { if (!info.HasFeature(URI.DISCO_ITEMS)) { error = true; // wow. weird server. } // TODO: stash away features for this node in discomanager? } } if (error) { // TODO: check the error type that jabberd1.4 or XCP 2.x return } }
private void DiscoveryFearures(IList <IXmppHandler> handlers) { foreach (var handler in handlers) { foreach (XmppHandlerAttribute attribute in handler.GetType().GetCustomAttributes(typeof(XmppHandlerAttribute), true)) { var nameSpace = ElementFactory.GetElementNamespace(attribute.XmppElementType); if (!string.IsNullOrEmpty(nameSpace) && !DiscoInfo.HasFeature(nameSpace)) { DiscoInfo.AddFeature(new DiscoFeature(nameSpace)); } } } }
private void OnDiscoInfoResult(object sender, IQ iq, object data) { // <iq from='proxy.cachet.myjabber.net' to='[email protected]/Exodus' type='result' id='jcl_19'> // <query xmlns='http://jabber.org/protocol/disco#info'> // <identity category='proxy' name='SOCKS5 Bytestreams Service' type='bytestreams'/> // <feature var='http://jabber.org/protocol/bytestreams'/> // <feature var='http://jabber.org/protocol/disco#info'/> // </query> // </iq> if (iq.Type == IqType.result) { if (iq.Query is DiscoInfo) { DiscoInfo di = iq.Query as DiscoInfo; if (di.HasFeature(agsXMPP.Uri.MUC)) { Jid jid = iq.From; listView1.Groups.Add(jid.ToString(), jid.ToString()); discoManager.DiscoverItems(jid, new IqCB(OnDiscoRoomlist), null); } } } }