ejabberd development
  1. ejabberd development
  2. EJAB-1436

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

    Details

    • Type: New Feature New Feature
    • Status: Not Yet Scheduled Not Yet Scheduled
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: ejabberd 3.0.0-alpha-2
    • Fix Version/s: None
    • Component/s: Publish-Subscribe
    • Environment:
      Debian

      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>

        Activity

        Hide
        pandans
        added a comment -

        yes!
        expect it I also have another question that:
        how can i get this result:
        /home/host/admin
        /home/host/admin/test1
        /home/host/admin/test2
        and A subscribe /home/host/admin
        when i publish item on /home/host/admin/test1 or /home/host/admin/test2
        A can get message notify

        Show
        pandans
        added a comment - yes! expect it I also have another question that: how can i get this result: /home/host/admin /home/host/admin/test1 /home/host/admin/test2 and A subscribe /home/host/admin when i publish item on /home/host/admin/test1 or /home/host/admin/test2 A can get message notify

          People

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

            Dates

            • Created:
              Updated:
              Days since last comment:
              2 years, 26 weeks, 4 days ago

              Issue deployment