protected override void OnServiceDiscoveryMessageReceived(object sender, XmppServiceDiscoveryMessageEventArgs e)
        {
            if (this.pendingMessages.Contains(e.QueryResult.ID) &&
                e.QueryResult.Type == IQType.Result)
            {
                this.pendingMessages.Remove(e.QueryResult.ID);

                // Reponse to our capabilities query
                foreach (object item in e.QueryResult.Items)
                {
                    if (item is ServiceQuery)
                    {
                        ServiceQuery query = (ServiceQuery)item;

                        foreach (ServiceIdentity identity in query.Identities)
                        {
                            this.Identities.Add(new XmppServiceIdentity(identity.Category, identity.Type));
                        }

                        foreach (ServiceFeature supportedFeature in query.Features)
                        {
                            this.Features.Add(new XmppServiceFeature(supportedFeature.Name));
                        }
                    }
                }

                if (!this.Session.ClientCapabilitiesStorage.Exists(this.Node, this.VerificationString))
                {
                    this.Session.ClientCapabilitiesStorage.Add(this);
                    this.Session.ClientCapabilitiesStorage.Save();
                }
            }
        }
        protected override void OnServiceDiscoveryMessageReceived(object sender, XmppServiceDiscoveryMessageEventArgs e)
        {
            if (this.pendingMessages.Contains(e.QueryResult.ID) &&
                e.QueryResult.Type == IQType.Result)
            {
                this.pendingMessages.Remove(e.QueryResult.ID);

                // Reponse to our capabilities query
                foreach (object item in e.QueryResult.Items)
                {
                    if (item is ServiceQuery)
                    {
                        ServiceQuery query = (ServiceQuery)item;

                        foreach (ServiceIdentity identity in query.Identities)
                        {
                            this.Identities.Add(new XmppServiceIdentity(identity.Category, identity.Type));
                        }

                        foreach (ServiceFeature supportedFeature in query.Features)
                        {
                            this.Features.Add(new XmppServiceFeature(supportedFeature.Name));
                        }
                    }
                }

                if (!this.Session.ClientCapabilitiesStorage.Exists(this.Node, this.VerificationString))
                {
                    this.Session.ClientCapabilitiesStorage.Add(this);
                    this.Session.ClientCapabilitiesStorage.Save();
                }
            }
        }