<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=US-ASCII">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2654.45">
<TITLE>RE: [JDEV] Two jabber:iq:roster questions</TITLE>
</HEAD>
<BODY>
<P><FONT SIZE=2>You do have to send both the presence and the jabber:iq:roster </FONT>
<BR><FONT SIZE=2>packets. You can send them in either order. </FONT>
</P>
<P><FONT SIZE=2>I don't think you are ever supposed to send a jabber:iq:roster </FONT>
<BR><FONT SIZE=2>with a subscription attribute. From what I remember from my </FONT>
<BR><FONT SIZE=2>conversations with temas, the server just ignores that attribute </FONT>
<BR><FONT SIZE=2>if you send it.</FONT>
</P>
<P><FONT SIZE=2>About the groups, unfortunately you always have to send the groups</FONT>
<BR><FONT SIZE=2>even if you are just changing the name attribute. If you forget</FONT>
<BR><FONT SIZE=2>to send the groups, you will lose them the next time you login.</FONT>
</P>
<P><FONT SIZE=2>If I also remember groups correctly, whatever you put in the area for</FONT>
<BR><FONT SIZE=2>groups (inside of the item element) is just stored by the server</FONT>
<BR><FONT SIZE=2>as is. You can put whatever XML you want in there. So if you sent:</FONT>
<BR><FONT SIZE=2><item jid='...'><foo>abc</foo><bar>123</bar></item>, you would</FONT>
<BR><FONT SIZE=2>get that back the next time you signin and get your roster. Of</FONT>
<BR><FONT SIZE=2>course if you put something other then groups in there, it would</FONT>
<BR><FONT SIZE=2>might break other clients.</FONT>
</P>
<P><FONT SIZE=2>-Robert</FONT>
</P>
<P><FONT SIZE=2>> -----Original Message-----</FONT>
<BR><FONT SIZE=2>> From: Jens Alfke [<A HREF="mailto:jens@mac.com">mailto:jens@mac.com</A>]</FONT>
<BR><FONT SIZE=2>> Sent: Wednesday, August 15, 2001 4:21 PM</FONT>
<BR><FONT SIZE=2>> To: jdev@jabber.org</FONT>
<BR><FONT SIZE=2>> Subject: [JDEV] Two jabber:iq:roster questions</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> I'm trying to improve my roster support by storing the actual </FONT>
<BR><FONT SIZE=2>> names in </FONT>
<BR><FONT SIZE=2>> addition to the jids. I have two questions:</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> (1) When adding a buddy, do I have to first send a <presence> </FONT>
<BR><FONT SIZE=2>> element to </FONT>
<BR><FONT SIZE=2>> subscribe, then a jabber:iq:roster "set" to add a name? I </FONT>
<BR><FONT SIZE=2>> can't specify </FONT>
<BR><FONT SIZE=2>> the real name in the <presence> element, and conversely, I </FONT>
<BR><FONT SIZE=2>> don't think </FONT>
<BR><FONT SIZE=2>> simply changing the 'subscription' mode in a roster element will </FONT>
<BR><FONT SIZE=2>> actually cause a subscription attempt to occur, right? This </FONT>
<BR><FONT SIZE=2>> seems sort </FONT>
<BR><FONT SIZE=2>> of kludgy.</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> (2) When sending a roster "set", can I just skip the fields I </FONT>
<BR><FONT SIZE=2>> don't want </FONT>
<BR><FONT SIZE=2>> to change? Ideally I'd just like to send:</FONT>
<BR><FONT SIZE=2>> <iq type="set"></FONT>
<BR><FONT SIZE=2>> <query xmlns="jabber:iq"roster"></FONT>
<BR><FONT SIZE=2>> <item jid="snej@jabber.org"</FONT>
<BR><FONT SIZE=2>> name="Jens Alfke"/></FONT>
<BR><FONT SIZE=2>> </query></FONT>
<BR><FONT SIZE=2>> </iq></FONT>
<BR><FONT SIZE=2>> but I'm afraid that omitting the 'group' and 'subscription' elements </FONT>
<BR><FONT SIZE=2>> might clear their values.</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> --Jens</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> _______________________________________________</FONT>
<BR><FONT SIZE=2>> jdev mailing list</FONT>
<BR><FONT SIZE=2>> jdev@jabber.org</FONT>
<BR><FONT SIZE=2>> <A HREF="http://mailman.jabber.org/listinfo/jdev" TARGET="_blank">http://mailman.jabber.org/listinfo/jdev</A></FONT>
<BR><FONT SIZE=2>> </FONT>
</P>
</BODY>
</HTML>