[JDEV] jabber:iq:roster question
Ryan Eatmon
reatmon at ti.com
Wed Dec 29 08:36:39 CST 1999
Keith Minkler wrote:
>
> Ryan,
>
> >subscription is set by the server, unless the client sets it to "none",
>
> you should only ever set subscription = 'remove' if you want to remove them,
> none means that there is no subscription to presence.
subscription = 'remove' removes that <item/> from the roster? I was
trying something mentioned on the wen site the other day and it wasn't
working, but I don't think it was this... Need to add that to the
documentation. Just to clarify, if I send:
<item jid="bob at jabber.org" subscription="remove"/>
it will remove that <item/> from the roster?
> >And if the above is correct then the <subscribe/>, <unsubscribe/> tags
> >are requests to the JID, and <subscribed/>, <unsubscribed/> are the
> >expected responses from the JID. That's important to know for a client.
>
> I forgot to mention these... they were taken out of the <item/> tag as of (i
> believe) 0.8.1, and are handled completely by presence. when you receive
> your roster, you will get any queued presence packets for subscription, they
> will no longer be in the <item/> tag. here is a more detailed example:
Ahhh... that makes sense then. Note to self, remove the tags from
Net::Jabber::IQ::Roster::Item...
> USER A and USER B just met, and want to add eachother to their roster. to
> simplify things, USER A's jid will be 'A' and USER B's jid will be 'B':
>
> USER A adds USER B to his roster by sending this:
> <iq type='set'><query xmlns='jabber:iq:roster'><item name='some guy'
> jid='B'/></query></iq>
>
> and the server responds with:
> <iq type='result'><query xmlns='jabber:iq:roster/></iq>
>
> USER A also takes the opportunity to subscribe to USER B's presence, and
> sends this:
> <presence to='B' type='subscribe'/>
>
> The server will send back a roster push, indicating that the ask field is
> now changed:
> <iq type='set'><query xmlns:iq:roster><item name="some guy" jid = 'B'
> ask='subscribe'/></query></iq>
>
> at this point, user B recieves this notification with the following from
> his/her server:
> <presence from='A' type='subscribe'/>
>
> USER B realizes that he/she just met this person, and allows them to
> subscribe:
> <presence to='A' type='subscribed'/>
>
> USER A will recieve this packet, and then BOTH users will get a roster push.
> USER A will have ask= removed, and subscription='to' USER B will have
> subscription='from'
> NOTE: that the SERVER will create a new roster item for USER B at this
> point, since user A isn't in his/her roster.
>
> note that any time the server changes the roster, the user gets a roster
> push with the NEW roster item in it.
This example helps a lot.
--
Ryan Eatmon reatmon at ti.com
-----------------------------------------
Mixed Signal Product Development EDA Team
More information about the JDev
mailing list