[jdev] Accessing the roster from a component

Pedro Melo melo at co.sapo.pt
Thu Jun 5 09:14:58 CDT 2008


Hi,

On Jun 4, 2008, at 11:11 PM, Esteban Manchado Velázquez wrote:

> Hi,
>
>     I would like to do something that I thought it would be very  
> simple, but I
> can't figure out how to do it: I want access to user rosters from a  
> component.
> The idea is customising the response to user requests depending  
> (e.g. service
> discovery) on the contents of that user's roster.
>
>     I have tried with the examples in the book "Jabber Developer's  
> Handbook"
> (both trying with routing and with direct xdb requests), but I only  
> get errors
> back. I guess that maybe those requests are outdated (the book is  
> quite old),
> but I can't figure out how to do it correctly.
>
> My attempt with routing is:
>
>     <route from='tada.localhost' to='estebanm at localhost/hunter'>
>         <iq id='1426' type='get'>
>             <query xmlns='jabber:iq:roster'/>
>         </iq>
>     </route>
>
> and I get this back:
>
>     <route from='estebanm at localhost/hunter' to='tada.localhost'  
> type='error'
>            xmlns='jabber:client'>
>         <iq id='1426' type='get'>
>             <query xmlns='jabber:iq:roster'/>
>         </iq>
>         <error code='400' type='modify'>
>             <bad-request xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
>         </error>
>     </route>
>
> My attempt with direct xdb is:
>
>     <xdb from='sessions' id='1225' to='estebanm at localhost' type='get'
>          xmlns='jabber:iq:roster'/>
>
> but I get this back:
>
>     <xdb from='estebanm at localhost' to='sessions' id='1225'  
> type='error'
>          xmlns='jabber:client'>
>         <error code='400' type='modify'>
>             <bad-request xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
>         </error>
>     </xdb>
>
> So, any ideas? Pointer to component development documentation  
> maybe? I haven't
> been able to find much about that.  I am using ejabberd 2 BTW. TIA,

There is no std protocol to access the roster from an external  
component. I believe jabberd2 had some extensions to do it, but I  
might be wrong on that.

Best regards,
-- 
HIId: Pedro Melo
SMTP: melo at co.sapo.pt
XMPP: pedro.melo at sapo.pt





More information about the JDev mailing list