[JDEV] Two jabber:iq:roster questions
Robert.Temple at dig.com
Thu Aug 16 03:09:42 CDT 2001
You do have to send both the presence and the jabber:iq:roster
packets. You can send them in either order.
I don't think you are ever supposed to send a jabber:iq:roster
with a subscription attribute. From what I remember from my
conversations with temas, the server just ignores that attribute
if you send it.
About the groups, unfortunately you always have to send the groups
even if you are just changing the name attribute. If you forget
to send the groups, you will lose them the next time you login.
If I also remember groups correctly, whatever you put in the area for
groups (inside of the item element) is just stored by the server
as is. You can put whatever XML you want in there. So if you sent:
<item jid='...'><foo>abc</foo><bar>123</bar></item>, you would
get that back the next time you signin and get your roster. Of
course if you put something other then groups in there, it would
might break other clients.
> -----Original Message-----
> From: Jens Alfke [mailto:jens at mac.com]
> Sent: Wednesday, August 15, 2001 4:21 PM
> To: jdev at jabber.org
> Subject: [JDEV] Two jabber:iq:roster questions
> I'm trying to improve my roster support by storing the actual
> names in
> addition to the jids. I have two questions:
> (1) When adding a buddy, do I have to first send a <presence>
> element to
> subscribe, then a jabber:iq:roster "set" to add a name? I
> can't specify
> the real name in the <presence> element, and conversely, I
> don't think
> simply changing the 'subscription' mode in a roster element will
> actually cause a subscription attempt to occur, right? This
> seems sort
> of kludgy.
> (2) When sending a roster "set", can I just skip the fields I
> don't want
> to change? Ideally I'd just like to send:
> <iq type="set">
> <query xmlns="jabber:iq"roster">
> <item jid="snej at jabber.org"
> name="Jens Alfke"/>
> but I'm afraid that omitting the 'group' and 'subscription' elements
> might clear their values.
> jdev mailing list
> jdev at jabber.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the JDev