[jdev] PubSub subscription stanzas
Peter Saint-Andre
stpeter at stpeter.im
Mon Oct 13 18:13:25 CDT 2008
Julien Genestoux wrote:
> Hi everyone,
>
> I am currently working on a project that involves a XMPP PubSub mechanism.
> I am trying to implement a component that will manage this since we
> don't want to use a "full" PubSub server.
>
> Our users will be able to subscribe to a source using both a XMPP client
> and our web application.
> When a user subscribes to a node using the XMPP client, it is easy, I
> just have to follow what's given here
> : http://xmpp.org/extensions/xep-0060.html#subscriber-subscribe
>
> However, when he subscribes from our web application, what kind of
> stanza should I send,
Who is "I" here? The entity that is subscribing, or the entity that is
accepting the subscription (i.e., the service)?
> since the request is not coming from the xmpp
> client itself? My idea was to send something like :
>
> <iq type='result'
> from='pubsub.shakespeare.lit'
> to='francisco at denmark.lit/barracks'
> id='sub1'>
> <pubsub xmlns='http://jabber.org/protocol/pubsub'>
> <subscription
> node='princely_musings'
> jid='francisco at denmark.lit'
> subid='ba49252aaa4f5d320c24d3766f0bdcade78c78d3'
> subscription='subscribed'/>
> </pubsub>
> </iq>
>
> But the 'result' in iq type feels weird, since my understdanding was
> that resul corresponds to an action that was led by the client? Am I
> wrong? If so, can I send something like type='set' ?
You would send type='set' to subscribe, and type='result' to acknowledge
success of the subscription request. You can't answer a type='set' with
another type='set'.
But maybe I don't quite understand your scenario. :)
Peter
--
Peter Saint-Andre
https://stpeter.im/
More information about the JDev
mailing list