ejabberd - Comments for "How to use ejabberd&amp;#039;s pubsub module" https://www.ejabberd.im/mod_pubsub-usage en Re: General pubsub nodes https://www.ejabberd.im/mod_pubsub-usage#comment-54488 <p>I have upgraded to 2.0.5 and it is better - good job.</p> <p>I see my mistake with <em>delete</em> - I was not using the <code>pubsub#owner</code> namespace. It is very confusing that <em>create</em> (and <em>configure</em> when used with a <em>create</em>) use the raw <code>pubsub</code> namespace, but all other owner operations (including <em>configure</em> when used on its own) use the <code>pubsub#owner</code> namespace. This means there are two distinct <code>pubsub</code> elements, two distinct <code>configure</code> elements, <em>etc.</em>, causing confusion in the spec, duplication in the schemas, then additional complexity and confusion in any databinding APIs (<em>e.g.</em> require two <code>PubSub</code> packet extension classes). Oh well, at least my code works now.</p> <p>The only remaining issue I see is that when a last published item is sent on subscription, it does not contain the <code>&lt;delay xmlns=&#039;urn:xmpp:delay&#039; ...</code> as suggested in the spec, but this is a minor issue.</p> <p>Mik</p> Thu, 23 Jul 2009 12:46:38 +0000 mikhailfranco comment 54488 at https://www.ejabberd.im Try 2.0.5. Or better: try trunk svn. https://www.ejabberd.im/mod_pubsub-usage#comment-54451 <p>&gt; All comments refer to ejabberd 2.0.1</p> <p>There were many bugfixes related to PubSub in ejabberd 2.0.x releases after 2.0.1. And there will be many improvements in ejabberd 2.1.0 once released. So, maybe some of the problems and annoyances you found in 2.0.1 are solved in 2.0.5 or will be solved in 2.1.0.</p> <p>You can try ejabberd from trunk SVN to verify if those problems are still present in the development version.</p> Sun, 12 Jul 2009 11:56:42 +0000 mfoss comment 54451 at https://www.ejabberd.im General pubsub nodes https://www.ejabberd.im/mod_pubsub-usage#comment-54442 <p>So if any user can only create nodes under <code>/home/myhost/username</code>,<br /> how can nodes be added under <code>/pubsub/nodes</code> ?</p> <p>How can I find out the owner of a node under <code>/pubsub/nodes</code> ?</p> <p>Two other interesting points that don't exactly leap out of the spec:</p> <ul> <li> a structured name implies the parent collection as a tree:<br /> i.e. <code>/home/myhost/username/foo</code> implies <code>pubsub#collection</code> property<br /> <em>/home/myhost/username</em> without having to add this to the config<br /> (in fact, you <strong>must not</strong> include <code>pubsub#collection</code> in create,<br /> because it is <code>error modify 406 not-acceptable</code>) </li> <li> <code>pubsub#node_type</code> appears to be mutable !?<br /> e.g. when ejabberd is installed, the <code>/home/myhost</code> and <code>/pubsub/nodes</code><br /> have <code>pubsub#node_type</code> <em>leaf</em>, but then you can add nodes<br /> underneath, and the type switches to <em>collection</em> ! </li> </ul> <p>ejabbered advertises feature <code>pubsub#delete-nodes</code> and it should be supported,<br /> because it does support <code>pubsub#create-nodes</code> (XEP-0060 Section 8.4) ,<br /> but any attempt to delete a node returns <code> error 501 cancel feature-not-implemented</code>.</p> <p>.. and the weirdest behaviour is that each user has to create<br /> an instant node before they can create a named node !?!?<br /> (first attempts to create a named node get <code>error auth 403 forbidden</code>)</p> <p>Mik</p> <p>P.S.I. without Psi XML console it would have been impossible to figure this all out - Psi rocks !</p> <p>P.P.S. All comments refer to ejabbered 2.0.1</p> Thu, 09 Jul 2009 13:18:28 +0000 mikhailfranco comment 54442 at https://www.ejabberd.im Hi itay, I have sent the https://www.ejabberd.im/mod_pubsub-usage#comment-52377 <p>Hi itay,</p> <p>I have sent the same messages to my local ejabberd server (replaced minden-203-90.resnet.brown.edu to localhost).</p> <p>It nearly works the way it should. The only problem is that it does not send (change event notification) message to the subscribers when the publisher changes the value of the item.</p> <p>Though it sends the current state of the item when the subscriber logs into the jabber server.</p> <p>I have tried with two versions of ejabberd:<br /> - the ejabberd-2.0.0 binary version from ejabberd home<br /> - the one packaged in ubuntu hardy - I could not find which version it is exactly(on 2008 may 12)</p> <p>Have I made a mistake or is it a function that only works in later (development) version of ejabberd?</p> Mon, 12 May 2008 10:08:26 +0000 asch comment 52377 at https://www.ejabberd.im pubsub examples https://www.ejabberd.im/mod_pubsub-usage#comment-52240 <p>Hi Norbert,</p> <p>The following work for me:</p> <div class="codeblock"><code>- instant nodes: <p>&lt;iq type=&quot;set&quot; from=&quot;test@minden-203-90.resnet.brown.edu&quot; <br />&nbsp;&nbsp;&nbsp; to=&quot;pubsub.minden-203-90.resnet.brown.edu&quot; id=&quot;create2&quot;&gt;<br />&nbsp; &lt;pubsub xmlns=&quot;http://jabber.org/protocol/pubsub&quot;&gt;<br />&nbsp;&nbsp;&nbsp; &lt;create/&gt;<br />&nbsp;&nbsp;&nbsp; &lt;configure/&gt;<br />&nbsp; &lt;/pubsub&gt;<br />&lt;/iq&gt;&nbsp; <br />&nbsp; <br />&lt;iq from=&quot;pubsub.minden-203-90.resnet.brown.edu&quot; <br />&nbsp;&nbsp;&nbsp; to=&quot;test@minden-203-90.resnet.brown.edu/SamePlace&quot; id=&quot;create2&quot; type=&quot;result&quot;&gt;<br />&nbsp; &lt;pubsub xmlns=&quot;http://jabber.org/protocol/pubsub&quot;&gt;<br />&nbsp;&nbsp;&nbsp; &lt;create node=&quot;/home/minden-203-90.resnet.brown.edu/test/2675892619&quot;/&gt;<br />&nbsp; &lt;/pubsub&gt;<br />&lt;/iq&gt;</p> <p>- named node:<br />&lt;iq type=&quot;set&quot; from=&quot;test@minden-203-90.resnet.brown.edu&quot; <br />&nbsp;&nbsp;&nbsp; to=&quot;pubsub.minden-203-90.resnet.brown.edu&quot; id=&quot;create1&quot;&gt;<br />&nbsp; &lt;pubsub xmlns=&quot;http://jabber.org/protocol/pubsub&quot;&gt;<br />&nbsp;&nbsp;&nbsp; &lt;create node=&quot;/home/minden-203-90.resnet.brown.edu/test/norbert_node&quot;/&gt;<br />&nbsp;&nbsp;&nbsp; &lt;configure/&gt;<br />&nbsp; &lt;/pubsub&gt;<br />&nbsp; <br />&lt;iq from=&quot;pubsub.minden-203-90.resnet.brown.edu&quot; <br />&nbsp;&nbsp;&nbsp; to=&quot;test@minden-203-90.resnet.brown.edu/SamePlace&quot; id=&quot;create1&quot; type=&quot;result&quot;&gt;<br />&nbsp; &lt;pubsub xmlns=&quot;http://jabber.org/protocol/pubsub&quot;&gt;<br />&nbsp;&nbsp;&nbsp; &lt;create node=&quot;/home/minden-203-90.resnet.brown.edu/test/norbert_node&quot;/&gt;<br />&nbsp; &lt;/pubsub&gt;<br />&lt;/iq&gt;</p> <p>- subscribe to node</p> <p>&lt;iq type=&quot;set&quot; from=&quot;test@minden-203-90.resnet.brown.edu&quot; <br />&nbsp;&nbsp;&nbsp; to=&quot;pubsub.minden-203-90.resnet.brown.edu&quot; id=&quot;sub1&quot;&gt;<br />&nbsp; &lt;pubsub xmlns=&quot;http://jabber.org/protocol/pubsub&quot;&gt;<br />&nbsp;&nbsp;&nbsp; &lt;subscribe node=&quot;/home/minden-203-90.resnet.brown.edu/test/norbert_node&quot; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; jid=&quot;test@minden-203-90.resnet.brown.edu&quot;/&gt;<br />&nbsp; &lt;/pubsub&gt;<br />&lt;/iq&gt;<br />&nbsp;&nbsp;&nbsp; <br />&lt;iq from=&quot;pubsub.minden-203-90.resnet.brown.edu&quot; <br />&nbsp;&nbsp;&nbsp;&nbsp; to=&quot;test@minden-203-90.resnet.brown.edu/SamePlace&quot; id=&quot;sub1&quot; type=&quot;result&quot;&gt;<br />&nbsp; &lt;subscription node=&quot;/home/minden-203-90.resnet.brown.edu/test/norbert_node&quot; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; jid=&quot;test@minden-203-90.resnet.brown.edu&quot; subscription=&quot;subscribed&quot; subid=&quot;4B8D779397046&quot;/&gt;<br />&lt;/iq&gt;</p> <p>&lt;message from=&quot;pubsub.minden-203-90.resnet.brown.edu&quot; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; to=&quot;test@minden-203-90.resnet.brown.edu&quot;&gt;<br />&nbsp; &lt;event xmlns=&quot;http://jabber.org/protocol/pubsub#event&quot;&gt;<br />&nbsp;&nbsp;&nbsp; &lt;items node=&quot;/home/minden-203-90.resnet.brown.edu/test/norbert_node&quot;/&gt;<br />&nbsp; &lt;/event&gt;<br />&lt;/message&gt;</p> <p>- publish to node<br />&nbsp; <br />&lt;iq type=&quot;set&quot; to=&quot;pubsub.minden-203-90.resnet.brown.edu&quot; id=&quot;publish1&quot;&gt;<br />&nbsp; &lt;pubsub xmlns=&quot;http://jabber.org/protocol/pubsub&quot;&gt;<br />&nbsp;&nbsp;&nbsp; &lt;publish node=&quot;/home/minden-203-90.resnet.brown.edu/test/norbert_node&quot;&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;item&gt;Hi Norbert!&lt;/item&gt;<br />&nbsp;&nbsp;&nbsp; &lt;/publish&gt;<br />&nbsp; &lt;/pubsub&gt;<br />&lt;/iq&gt;<br />&nbsp; <br />&lt;iq from=&quot;pubsub.minden-203-90.resnet.brown.edu&quot; <br />&nbsp;&nbsp;&nbsp; to=&quot;test@minden-203-90.resnet.brown.edu/SamePlace&quot; id=&quot;publish1&quot; type=&quot;result&quot;&gt;<br />&lt;/iq&gt;<br />&nbsp; <br />(this is the response, because I am subscribed to the node)<br />&lt;message from=&quot;pubsub.minden-203-90.resnet.brown.edu&quot; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; to=&quot;test@minden-203-90.resnet.brown.edu&quot;&gt;<br />&nbsp; &lt;event xmlns=&quot;http://jabber.org/protocol/pubsub#event&quot;&gt;<br />&nbsp;&nbsp;&nbsp; &lt;items node=&quot;/home/minden-203-90.resnet.brown.edu/test/norbert_node&quot;&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;item id=&quot;4B8D78BB7D4E9&quot;&gt;Hi Norbert!&lt;/item&gt;<br />&nbsp;&nbsp;&nbsp; &lt;/items&gt;<br />&nbsp; &lt;/event&gt;<br />&lt;/message&gt;</p></code></div> Tue, 22 Apr 2008 16:49:59 +0000 itay comment 52240 at https://www.ejabberd.im Maybe an example is in order ... https://www.ejabberd.im/mod_pubsub-usage#comment-52195 <p>When I tried to create an instant note I had to learn the hard way that <code>&lt;configure&gt;</code> must not be empty.</p> <p>I would very much appreciate an example showing the stanzas flowing back and forth for the following cases:</p> <p>* Creation of an instant node</p> <p>* Creation of a named node</p> <p>* Publishing to a node</p> <p>* Subscribing to a node</p> <p>The XEP-060 is not so useful for this, because for example this does not run :</p> <div class="codeblock"><code>&lt;iq type=&#039;set&#039;<br />&nbsp;&nbsp;&nbsp; from=&#039;hamlet@denmark.lit/elsinore&#039;<br />&nbsp;&nbsp;&nbsp; to=&#039;pubsub.shakespeare.lit&#039;<br />&nbsp;&nbsp;&nbsp; id=&#039;create2&#039;&gt;<br />&nbsp;&nbsp;&nbsp; &lt;pubsub xmlns=&#039;http://jabber.org/protocol/pubsub&#039;&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;create/&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;configure/&gt;<br />&nbsp;&nbsp;&nbsp; &lt;/pubsub&gt;<br />&lt;/iq&gt;</code></div> <p>Best wishes</p> <p>Norbert</p> Thu, 17 Apr 2008 09:22:04 +0000 NorbertK comment 52195 at https://www.ejabberd.im