[jdev] Retrieving items list for a pubsub nide

Sergei Golovan sgolovan at nes.ru
Wed Mar 12 12:22:16 CDT 2008


Hi!

Looking at section 5.5 of XEP-0060
(http://www.xmpp.org/extensions/xep-0060.html#entity-discoveritems) I
see that disco#items query is used for retrieving published items
list.

However, published items are very different from disco#items. If a
naive client attempts to interpret published item as an ordinary disco
item it will succeed but the result will be quite strange.

Example:

<iq id='21' to='some at jid' type='get' xml:lang='en'>
      <query xmlns='http://jabber.org/protocol/disco#items'
	node='http://jabber.org/protocol/mood'/>
</iq>

<iq from='some at jid' id='21' type='result' to='some at jid/resource'>
      <query node='http://jabber.org/protocol/mood'
	xmlns='http://jabber.org/protocol/disco#items'>
            <item name='mood1' jid='some at jid'/>
            <item name='mood2' jid='some at jid'/>
      </query>
</iq>

A client will interpret the answer as if JID "some at jid" have a natural
name (as in XEP-0030) "mood1" or "mood2".

To be able to process items list correctly two conditions must be met:
1) A client must support pubsub.
2) A client must know that a discovered node is a pubsub leaf node
(so, it must perform a preliminary disco#info query) and its
interpretation of disco#items query must depend on the context (which
makes client development more complicated).

Is there any valid reason why disco#items query is used for requesting
published items (except that both are items)? Maybe it would be better
to switch to some more appropriate custom protocol?

Cheers!
-- 
Sergei Golovan



More information about the JDev mailing list