コード例 #1
0
ファイル: PersonalEventing.cs プロジェクト: xlizzard/synapse
        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);
                }
            }
        }
コード例 #2
0
ファイル: PersonalEventing.cs プロジェクト: jrudolph/synapse
        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);
                }
            }
        }