[jdev] handling subscription...

Joe Hildebrand hildjj at gmail.com
Mon Jun 28 20:16:05 CDT 2004

> Will subscriptions/unsubscriptions always come in the form of sub/unsub requests? Or is it also necessary to scan the roster to see what has changed there?

You'll always get subscription requests.  But you'll always also get a
roster push.  See
http://www.jabber.org/ietf/draft-ietf-xmpp-im-22.html#roster as well
as section 8.

> What does it mean to deny an unsub request? i.e. what if you dont reply with 'unsubscribed'?

See section 9 from the above doc.  If you don't reply with
unsubscribed, your server should just keep bugging you about the
unsubscription, I think.

> In my application I want to allow everyone to subscribe to me, and when they do I want to subscribe in turn.
> And when they unsubscribe, I want to unsubscribe in turn. So Im doing something like this:
> onrequest(){
>     if ( subrequest )
>         send(subscribed)
>         send(subrequest)
>     else if ( unsubrequest )
>         send(unsubscribed)
>         send(unsubrequest)
> }
> Is this ok? If two of my clients do this to each other, it wont setup a constant flood will it?

It breaks one of the things that people seem to really like about
jabber, namely that you have to give access before someone can see
your presence.  But other than that, it should work.

Joe Hildebrand

More information about the JDev mailing list