Exemple #1
0
        private void JabberClient_OnSASLEnd(Object sender, Jabber.Protocol.Stream.Features feat)
        {
            lock (StateLock)
            {
                State = BindState.Instance;
            }
            if (feat["bind", URI.BIND] != null)
            {
                IQ iq = new IQ(this.Document);
                iq.Type = IQType.set;

                Jabber.Protocol.Stream.Bind bind = new Jabber.Protocol.Stream.Bind(this.Document);
                if ((Resource != null) && (Resource != ""))
                {
                    bind.Resource = Resource;
                }

                iq.AddChild(bind);
                this.Tracker.BeginIQ(iq, new IqCB(GotResource), feat);
            }
            else if (feat["session", URI.SESSION] != null)
            {
                IQ iq = new IQ(this.Document);
                iq.Type = IQType.set;
                iq.AddChild(new Jabber.Protocol.Stream.Session(this.Document));
                this.Tracker.BeginIQ(iq, new IqCB(GotSession), feat);
            }
            else
            {
                IsAuthenticated = true;
            }
        }
        private void JabberClient_OnSASLEnd(Object sender, Jabber.Protocol.Stream.Features feat)
        {
            lock (StateLock)
            {
                State = BindState.Instance;
            }
            if (feat["bind", URI.BIND] != null)
            {
                IQ iq = new IQ(this.Document);
                iq.Type = IQType.set;

                Jabber.Protocol.Stream.Bind bind = new Jabber.Protocol.Stream.Bind(this.Document);
                if ((Resource != null) && (Resource != ""))
                    bind.Resource = Resource;

                iq.AddChild(bind);
                this.Tracker.BeginIQ(iq, new IqCB(GotResource), feat);
            }
            else if (feat["session", URI.SESSION] != null)
            {
                IQ iq = new IQ(this.Document);
                iq.Type = IQType.set;
                iq.AddChild(new Jabber.Protocol.Stream.Session(this.Document));
                this.Tracker.BeginIQ(iq, new IqCB(GotSession), feat);
            }
            else
                IsAuthenticated = true;
        }