Uploaded image for project: 'ejabberd development'
  1. ejabberd development
  2. EJAB-673

Support of collection node subscription options

    Details

      Description

      Currently one can subscribe to collection node, but not with options. There exists 2 options specific to collection nodes: pubsub#subscription_type and pubsub#subscription_depth.

      The XEP-0060 writes about this [1]:

      A service that implements collection nodes SHOULD allow entities to subscribe to collection nodes (subject to access models and local security policies).

      In addition to the subscription configuration options already defined, there are two subscription configuration options specific to collection nodes:

      So let's say this is not a bug, nor a new feature, but an improvement (else change issue type).
      Currently if I try to subscribe to a collection node with these options, it is rejected:

      <iq type='set'
          from='test@localhost.net/Gajim'
          to='pubsub.localhost.net'
          id='collsub2'>
        <pubsub xmlns='http://jabber.org/protocol/pubsub'>
          <subscribe jid='test@localhost.net'
      	       node='home/localhost.net/supertest/somenode/superblog2/comments'/>
          <options>
            <x xmlns='jabber:x:data' type='submit'>
      	<field var='FORM_TYPE' type='hidden'>
      	  <value>http://jabber.org/protocol/pubsub#subscribe_options</value>
      	</field>
      	<field var='pubsub#subscription_type'>
      	  <value>items</value>
      	</field>
      	<field var='pubsub#subscription_depth'>
      	  <value>all</value>
      	</field>
            </x>
          </options>
        </pubsub>
      </iq>
      
      <iq from='pubsub.localhost.net'
          to='test@localhost.net/Gajim'
          type='error' xml:lang='fr'
          id='collsub2'>
        <pubsub xmlns='http://jabber.org/protocol/pubsub'>
          <subscribe jid='test@localhost.net'
      	       node='home/localhost.net/supertest/somenode/superblog2/comments'/>
          <options>
            <x xmlns='jabber:x:data' type='submit'>
      	<field var='FORM_TYPE' type='hidden'>
      	  <value>http://jabber.org/protocol/pubsub#subscribe_options</value>
      	</field>
      	<field var='pubsub#subscription_type'>
      	  <value>items</value>
      	</field>
      	<field var='pubsub#subscription_depth'>
      	  <value>all</value>
      	</field>
            </x>
          </options>
        </pubsub>
        <error code='400' type='modify'>
          <bad-request xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
        </error>
      </iq>
      

      If I do the same, without the options, it works.

      <iq type='set'
          from='test@localhost.net/Gajim'
          to='pubsub.localhost.net'
          id='collsub2'>
        <pubsub xmlns='http://jabber.org/protocol/pubsub'>
          <subscribe jid='test@localhost.net'
      	       node='home/localhost.net/supertest/somenode/superblog2/comments'/>
        </pubsub>
      </iq>
      
      <iq from='pubsub.localhost.net'
          to='test@localhost.net/Gajim'
          id='collsub2'
          type='result'>
        <subscription node='/home/localhost.net/supertest/somenode/superblog2/comments'
      		jid='test@localhost.net'
      		subscription='subscribed'
      		subid='4BE65CA677F5'/>
      </iq>
      
      <message from='pubsub.localhost.net' to='test2@localhost.net'>
        <event xmlns='http://jabber.org/protocol/pubsub#event'>
          <items node='/home/localhost.net/supertest/somenode/superblog2/comments'/>
        </event>
      </message>
      

      But then I don't receive the items published in /home/localhost.net/supertest/somenode/superblog2/comments and I am so sad about this.

      [1] http://www.xmpp.org/extensions/xep-0060.html#collections-subscribe

        Issue Links

          Activity

          Hide
          jehan Jehan Hysseo added a comment -

          Argh I let my real jabber jid on the last query! And it is also same as my real email, which is most embarrassing because of spams! Apparently I cannot edit the ticket. Could I ask some administrator around here to please remove this jid and replace it by something else please?

          Show
          jehan Jehan Hysseo added a comment - Argh I let my real jabber jid on the last query! And it is also same as my real email, which is most embarrassing because of spams! Apparently I cannot edit the ticket. Could I ask some administrator around here to please remove this jid and replace it by something else please?
          Hide
          badlop Badlop added a comment -

          Jehan: I've edited the description: replaced your domain with 'localhost', added HTML tags and indented the XML.

          Show
          badlop Badlop added a comment - Jehan: I've edited the description: replaced your domain with 'localhost', added HTML tags and indented the XML.
          Hide
          jehan Jehan Hysseo added a comment -

          Thanks for the email/jid.
          And I will make better looking comments next time, looking at the Jira documentation.

          Show
          jehan Jehan Hysseo added a comment - Thanks for the email/jid. And I will make better looking comments next time, looking at the Jira documentation.
          Hide
          cromain@process-one.net Christophe Romain added a comment -

          Yes, subscription options are not yet supported. see comment in (features function)
          %TODO "subscription-options", % OPTIONAL

          options and configuration is part of what is needed to be worked on trunk.
          any provided patch would be appreciated to make that feature integrated faster of course.
          this is (at least for pubsub#subscription_type set to items) a quite small patch i guess.

          Show
          cromain@process-one.net Christophe Romain added a comment - Yes, subscription options are not yet supported. see comment in (features function) %TODO "subscription-options", % OPTIONAL options and configuration is part of what is needed to be worked on trunk. any provided patch would be appreciated to make that feature integrated faster of course. this is (at least for pubsub#subscription_type set to items) a quite small patch i guess.
          Hide
          cromain@process-one.net Christophe Romain added a comment -

          this is implemented in EJAB-815 and EJAB-845, so i close this issue.
          this should be committed in a very near future.

          Show
          cromain@process-one.net Christophe Romain added a comment - this is implemented in EJAB-815 and EJAB-845 , so i close this issue. this should be committed in a very near future.
          Hide
          gperrot Guillaume Perrot added a comment -

          Duplicate issue links are missing.

          Show
          gperrot Guillaume Perrot added a comment - Duplicate issue links are missing.

            People

            • Votes:
              3 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development