PDA

View Full Version : [jdev] Accessing the roster from a component


Esteban Manchado Velázquez
06-05-2008, 12:12 AM
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@localhost/hunter'>
<iq id='1426' type='get'>
<query xmlns='jabber:iq:roster'/>
</iq>
</route>

and I get this back:

<route from='estebanm@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@localhost' type='get'
xmlns='jabber:iq:roster'/>

but I get this back:

<xdb from='estebanm@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,

--
Esteban Manchado Velázquez <emanchado (AT) demiurgo (DOT) org>

_______________________________________________
JDev mailing list
FAQ: http://www.jabber.org/discussion-lists/jdev-faq
Forum: http://www.jabberforum.org/forumdisplay.php?f=20
Info: http://mail.jabber.org/mailman/listinfo/jdev
Unsubscribe: JDev-unsubscribe (AT) jabber (DOT) org
_______________________________________________

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iD8DBQFIRxL8hYgK5b1UDsERAgeOAJ9H3VGxQSzFFg4O7hVJVC 4prHQOmwCeMGJV
O2LXv0QapoTahxYKoeAq8/Y=
=jy34
-----END PGP SIGNATURE-----

Pedro Melo
06-05-2008, 04:16 PM
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@localhost/hunter'>
> <iq id='1426' type='get'>
> <query xmlns='jabber:iq:roster'/>
> </iq>
> </route>
>
> and I get this back:
>
> <route from='estebanm@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@localhost' type='get'
> xmlns='jabber:iq:roster'/>
>
> but I get this back:
>
> <xdb from='estebanm@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 (DOT) sapo.pt
XMPP: pedro.melo (AT) sapo (DOT) pt


_______________________________________________
JDev mailing list
FAQ: http://www.jabber.org/discussion-lists/jdev-faq
Forum: http://www.jabberforum.org/forumdisplay.php?f=20
Info: http://mail.jabber.org/mailman/listinfo/jdev
Unsubscribe: JDev-unsubscribe (AT) jabber (DOT) org
_______________________________________________

Tomasz Sterna
06-05-2008, 05:11 PM
Dnia 2008-06-05, czw o godzinie 15:14 +0100, Pedro Melo pisze:
> 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.

I was thinking about implementing in in jabberd2, but never got to it,
because of lack of interest in it.
Maybe I should rethink it now. ;-)

Nevertheless, my proposition of the enhancements is here:
http://jabberd2.xiaoka.com/wiki/ComponentProtocol


--
/\_./o__ Tomasz Sterna
(/^/(_^^' http://www.xiaoka.com/
._.(_.)_ im:smoku (AT) xiaoka (DOT) com

_______________________________________________
JDev mailing list
FAQ: http://www.jabber.org/discussion-lists/jdev-faq
Forum: http://www.jabberforum.org/forumdisplay.php?f=20
Info: http://mail.jabber.org/mailman/listinfo/jdev
Unsubscribe: JDev-unsubscribe (AT) jabber (DOT) org
_______________________________________________

Peter Saint-Andre
06-05-2008, 05:26 PM
On 06/05/2008 9:08 AM, Tomasz Sterna wrote:
> Dnia 2008-06-05, czw o godzinie 15:14 +0100, Pedro Melo pisze:
>> 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.
>
> I was thinking about implementing in in jabberd2, but never got to it,
> because of lack of interest in it.
> Maybe I should rethink it now. ;-)
>
> Nevertheless, my proposition of the enhancements is here:
> http://jabberd2.xiaoka.com/wiki/ComponentProtocol

Is there a way that we can build that on top of XEP-0225?

http://www.xmpp.org/extensions/xep-0225.html

It would be nice to have a layered approach so that minimal
implementations could at least have improved security, and more advanced
implementations could have the fancy roster-access and all that. But I
admit that I haven't looked at it in quite a while...

Peter

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


_______________________________________________
JDev mailing list
FAQ: http://www.jabber.org/discussion-lists/jdev-faq
Forum: http://www.jabberforum.org/forumdisplay.php?f=20
Info: http://mail.jabber.org/mailman/listinfo/jdev
Unsubscribe: JDev-unsubscribe (AT) jabber (DOT) org
_______________________________________________

Esteban Manchado Velázquez
06-05-2008, 11:40 PM
Hi Pedro,

Thanks for your quick reply :-)

On Thu, Jun 05, 2008 at 03:14:58PM +0100, Pedro Melo wrote:
> Hi,
>
> 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.

Aha. I guess I'll have to search for another solution then :-)

--
Esteban Manchado Velázquez <emanchado (AT) demiurgo (DOT) org>

_______________________________________________
JDev mailing list
FAQ: http://www.jabber.org/discussion-lists/jdev-faq
Forum: http://www.jabberforum.org/forumdisplay.php?f=20
Info: http://mail.jabber.org/mailman/listinfo/jdev
Unsubscribe: JDev-unsubscribe (AT) jabber (DOT) org
_______________________________________________

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iD8DBQFISFzZhYgK5b1UDsERAnfsAJ94ILB+CR/zAfIDpMYqaFCpJ4qR0gCdGKy7
QoCCZNBd8r4L17lVqYIGiHs=
=yUu1
-----END PGP SIGNATURE-----