[jdev] Retrieving items list for a pubsub nide

Peter Saint-Andre stpeter at stpeter.im
Fri Mar 21 09:54:30 CDT 2008


Sergei Golovan wrote:

> 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.

True, but why would a naive client send this kind of request in the
first place?

> 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).

I think a client would drill down this far only if it knew that the mood
node was pubsub-related.

> 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?

Despite what I typed above, I think you make a good point. Notice that
we do something similar in the language translation protocol (XEP-0171).
Perhaps some input from client developers would be useful here...

Peter

-- 
Peter Saint-Andre
https://stpeter.im/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 7338 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://mail.jabber.org/pipermail/jdev/attachments/20080321/9e1a072a/attachment-0002.bin>


More information about the JDev mailing list