jabber.connection.PubSubNode.GotCreated C# (CSharp) Method

GotCreated() private method

private GotCreated ( object sender, IQ iq, object state ) : void
sender object
iq IQ
state object
return void
        private void GotCreated(object sender, IQ iq, object state)
        {
            if (iq.Type != IQType.result)
            {
                // Type=error with conflict is basically a no-op.
                if (iq.Type != IQType.error)
                {
                    FireError(Op.CREATE, "Create failed, invalid protocol", iq);
                    return;
                }
                Error err = iq.Error;
                if (err == null)
                {
                    FireError(Op.CREATE, "Create failed, unknown error", iq);
                    return;
                }
                if (err.Condition != Error.CONFLICT)
                {
                    FireError(Op.CREATE, "Error creating node", iq);
                    return;
                }
            }
            else
            {
                PubSub ps = iq.Query as PubSub;
                if (ps != null)
                {
                    Create c = ps["create", URI.PUBSUB] as Create;
                    if (c != null)
                        m_node = c.Node;
                }
            }

            this[Op.CREATE] = STATE.Running;

            if (OnCreate != null)
                OnCreate(this);

            SubscribeIfPending();
        }