Exemple #1
0
        public void DeleteItem(string strItemId, T item)
        {
            PubSubIQ iq = new PubSubIQ();

            iq.Type                 = IQType.set.ToString();
            iq.To                   = new JID(string.Format("pubsub.{0}", XMPPClient.Domain));
            iq.From                 = XMPPClient.JID;
            iq.PubSub.Retract       = new Retract();
            iq.PubSub.Retract.Node  = Node;
            iq.PubSub.Retract.Items = new PubSubItem[] { new PubSubItem()
                                                         {
                                                             Id = strItemId
                                                         } };

            ListSentIQs.Add(iq);

            XMPPClient.SendObject(iq);
        }
Exemple #2
0
        public void UpdateItem(string strItemId, T item)
        {
            PubSubIQ iq = new PubSubIQ();

            iq.Type                = IQType.set.ToString();
            iq.To                  = new JID(string.Format("pubsub.{0}", XMPPClient.Domain));
            iq.From                = XMPPClient.JID;
            iq.PubSub.Publish      = new Publish();
            iq.PubSub.Publish.Node = Node;
            iq.PubSub.Publish.Item = new PubSubItem()
            {
                Id = strItemId
            };
            iq.PubSub.Publish.Item.SetNodeFromObject(item);

            ListSentIQs.Add(iq);

            XMPPClient.SendObject(iq);
        }