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

Let get_items on a pubsub collection (dag) return all the items under that collection

    Details

      Description

      After looking into node_dag.erl, it appears that the node_dag.erl implementation of get_items requests the hometree implementation. Which won't recurse through the collection.

      So while subscriptions on pubsub collections with the dag-plug-in result in receiving items from one of the underlying nodes, trying to manually retrieve the underlying items fails.

      According to http://xmpp.org/extensions/xep-0248.html#retrieve-items, this item retrieval should have the following behavior:
      "When an entity requests items on a collection node the service SHOULD return the items on any leaf nodes associated with it subject to the access model of the collection node."

      However, if I send the following stanza:

      <iq type='get' from='123 <at> server/resource' to='pubsub.server.com' id='items1'>
      <pubsub xmlns='http://jabber.org/protocol/pubsub'>
      <items node='/home/server/user'/>
      </pubsub>
      </iq>

      => Nothing is retrieved:

      <iq xmlns='jabber:client' from='pubsub.server.com' to='123 <at> server/resource' id='items1' type='result'>
      <pubsub xmlns='http://jabber.org/protocol/pubsub'>
      <items node='/home/server/user'/>
      </pubsub>
      </iq>

      While:

      <iq type='get' from='123 <at> server/resource' to='pubsub.server.com' id='items1'>
      <query xmlns='http://jabber.org/protocol/disco#items' node='/home/server/user'>
      </query>
      </iq>

      => Retrieves only the collections directly under this collection:

      <iq xmlns='jabber:client' from='pubsub.server.com' to='123 <at> server/resource' id='items1' type='result'>
      <query xmlns='http://jabber.org/protocol/disco#items' node='/home/server/user'>
      <item jid='pubsub.server.com' node='/home/server/user/collectionA'/>
      <item jid='pubsub.server.com' node='/home/server/user/collectionB'/>
      <item jid='pubsub.server.com' node='/home/server/user/collectionC'/>
      <item jid='pubsub.server.com' node='/home/server/user/collectionD'/>
      </query>
      </iq>

        Expenses

          Activity

            People

            • Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development