Example #1
0
        public void Publish(string node, XmlElement item)
        {
            IQ iq = new IQ(m_Account.Client.Document);

            iq.Type = IQType.set;
            PubSub pubsub = new PubSub(m_Account.Client.Document);

            pubsub.SetAttribute("xmlns", "http://jabber.org/protocol/pubsub");
            Publish publish = new Publish(m_Account.Client.Document);

            publish.SetAttribute("node", node);
            publish.AddChild(item);
            pubsub.AddChild(publish);
            iq.AddChild(pubsub);

            if (m_Account.ConnectionState == AccountConnectionState.Connected)
            {
                m_Account.Send(iq);
            }
            else
            {
                lock (m_Queue) {
                    m_Queue.Enqueue(iq);
                }
            }
        }
Example #2
0
        public void Publish(string node, XmlElement item)
        {
            IQ iq = new IQ(m_Account.Client.Document);
            iq.Type = IQType.set;
            PubSub pubsub = new PubSub(m_Account.Client.Document);
            pubsub.SetAttribute("xmlns", "http://jabber.org/protocol/pubsub");
            Publish publish = new Publish(m_Account.Client.Document);
            publish.SetAttribute("node", node);
            publish.AddChild(item);
            pubsub.AddChild(publish);
            iq.AddChild(pubsub);

            if (m_Account.ConnectionState == AccountConnectionState.Connected) {
                m_Account.Send(iq);
            } else {
                lock (m_Queue) {
                    m_Queue.Enqueue(iq);
                }
            }
        }