コード例 #1
0
ファイル: DiscoHelper.cs プロジェクト: enptcvr/agsXmpp-1
        private void con_OnIq(object sender, IQ iq)
        {
            if (iq.Query != null)
            {
                if (iq.Query is DiscoInfo && iq.Type == IqType.get)
                {
                    /*
                     * <iq type='get'
                     *  from='[email protected]/orchard'
                     *  to='plays.shakespeare.lit'
                     *  id='info1'>
                     * <query xmlns='http://jabber.org/protocol/disco#info'/>
                     * </iq>
                     */
                    iq.SwitchDirection();
                    iq.Type = IqType.result;

                    DiscoInfo di = iq.Query as DiscoInfo;

                    if (ClientName != null)
                    {
                        di.AddIdentity(new DiscoIdentity(ClientCategory.ToString(), this.ClientName, "client"));
                    }

                    foreach (string feature in ClientFeatures)
                    {
                        di.AddFeature(new DiscoFeature(feature));
                    }

                    xmppCon.Send(iq);
                }
            }
        }