On Thursday 05 October 2006 06:20, Mark Doliner wrote:
> Hi, I'm wondering what is the correct way to remove a nickname from a
> roster item?
>
> Method 1:
> <iq type='set' id='lalala123'><query xmlns='jabber:iq:roster'><item
> jid='[EMAIL PROTECTED]'><group>Buddies</group></item></query></iq>
>
> Method 2:
> <iq type='set' id='lalala124'><query xmlns='jabber:iq:roster'><item
> jid='[EMAIL PROTECTED]'
> name=''><group>Buddies</group></item></query></iq>

According to http://www.xmpp.org/specs/rfc3921.html#def / Section B5

// --
<?xml version='1.0' encoding='UTF-8'?>

<xs:schema
    xmlns:xs='http://www.w3.org/2001/XMLSchema'
    targetNamespace='jabber:iq:roster'
    xmlns='jabber:iq:roster'
    elementFormDefault='qualified'>

  <!-- ... -->
  <xs:element name='item'>
    <xs:complexType>
      <!-- .. -->
      <xs:attribute name='name' type='xs:string' use='optional'/>
      <!-- .. -->
    </xs:complexType>
  </xs:element>

  <!-- .. -->
</xs:schema>
// --

The "name" attribute of the "item" element in "jabber:iq:roster" namespace is 
optional. What I personally understand from this:
a) items can have no "name" (nickname) - when "name" is missing
b) items can have a "name" (nickname) - when "name" is present

Therefore, when you give/receive "name" that means the item has some nickname 
set, no matter what the contents of "name" is. Under these conditions, a 
client receiving name='' should list a blank space in the roster - which is 
not something you'd like, I think.

IMO, missing "name" is not the same with empty "name". 

I would go with method 1.


Regards,
Mircea

-- 
http://mircea.bardac.net

Attachment: pgpcMi4Asl5Me.pgp
Description: PGP signature

Reply via email to