AnsweredAssumed Answered

Smack 4.2.1-SNAPSHOT Roster#createEntry has extra attribute subscription='none' not defined in RFC 6121

Question asked by cmeng on Jun 10, 2017
Latest reply on Jun 10, 2017 by cmeng

Per the document RFC 6121 section 2.3 as attached below; it does not specifically mention the requirements of an attribute 'subscription' during adding a roster Item that was included in Smack 4.2.1-SNAPSHOT. This however does not impact the ejabberd xmpp server correct handling of the request. I have also performed the similar test on a Pidgin client in adding a new buddy, Pidgin client sends IQ set exactly as specified per RFC 6121 section 2.3.1

 

============ RFC 6121 =============

2.3. Adding a Roster Item

2.3.1. Request

  At any time, a client can add an item to the roster. This is done by

  sending a roster set containing a new item.

 

  C: <iq from='juliet@example.com/balcony'

  id='ph1xaz53'

  type='set'>

  <query xmlns='jabber:iq:roster'>

  <item jid='nurse@example.com'

  name='Nurse'>

  <group>Servants</group>

  </item>

  </query>

  </iq>

 

============= aTalk log for Roster#createEntry ===============

06-09 11:35:18.756 D/aTalk: [53] impl.protocol.jabber.ServerStoredContactListJabberImpl.addContact().462 Adding contact newx@atalk.org to parent=JabberGroup.friends, childContacts=0:[]

06-09 11:35:18.766 D/SMACK: SENT (1): <iq id='F37d7-221' type='set'><query xmlns='jabber:iq:roster'><item jid='newx@atalk.org' name='newx@atalk.org' subscription='none'><group>friends</group></item></query></iq>

06-09 11:35:19.116 D/SMACK: RECV (1): <iq to='leopard@atalk.org/atalk' from='leopard@atalk.org' type='set' id='push15054467870323009988'><query ver='ad469212e7689d08917b9222136eb1ffbd40c597' xmlns='jabber:iq:roster'><item name='newx@atalk.org' jid='newx@atalk.org'><group>friends</group></item></query></iq>

06-09 11:35:19.126 D/SMACK: RECV (1): <iq xml:lang='en' to='leopard@atalk.org/atalk' from='leopard@atalk.org' type='result' id='F37d7-221'/>

06-09 11:35:19.126 D/aTalk: [47] impl.protocol.jabber.ServerStoredContactListJabberImpl.entriesAdded().1300 entriesAdded [newx@atalk.org]

06-09 11:35:19.126 D/SMACK: SENT (1): <presence to='newx@atalk.org' id='F37d7-224' type='subscribe'><nick xmlns="http://jabber.org/protocol/nick">Chong Meng Eng</nick><x xmlns='vcard-temp:x:update'><photo>ed341d7cb4d39f423989c0cf5fe8d9527be3ffde</ph oto></x></presence>

06-09 11:35:19.126 D/aTalk: [47] impl.protocol.jabber.OperationSetPersistentPresenceJabberImpl.firePresenceStatu sChanged().1415 Received a status update for buddy = newx@atalk.org

06-09 11:35:19.126 D/SMACK: SENT (1): <iq to='leopard@atalk.org' id='push15054467870323009988' type='result'></iq>

06-09 11:35:19.156 D/SMACK: SENT (1): <iq id='F37d7-230' type='set'><query xmlns='jabber:iq:roster'><item jid='newx@atalk.org' name='newx' subscription='none'><group>friends</group></item></query></iq>

06-09 11:35:19.246 D/SMACK: RECV (1): <iq to='leopard@atalk.org/atalk' from='leopard@atalk.org' type='set' id='push13212746768293106996'><query ver='e85311305c7f48af55d91f3497608404868431cd' xmlns='jabber:iq:roster'><item ask='subscribe' name='newx@atalk.org' jid='newx@atalk.org'><group>friends</group></item></query></iq>

06-09 11:35:19.266 D/SMACK: SENT (1): <iq to='leopard@atalk.org' id='push13212746768293106996' type='result'></iq><a xmlns='urn:xmpp:sm:3' h='31'/><r xmlns='urn:xmpp:sm:3'/>

06-09 11:35:19.446 D/SMACK: RECV (1): <iq to='leopard@atalk.org/atalk' from='leopard@atalk.org' type='set' id='push706896553016754919'><query ver='a73a362168f4d0847b3dd500ffd84c96839c449e' xmlns='jabber:iq:roster'><item ask='subscribe' name='newx' jid='newx@atalk.org'><group>friends</group></item></query></iq>

06-09 11:35:19.446 D/SMACK: RECV (1): <iq xml:lang='en' to='leopard@atalk.org/atalk' from='leopard@atalk.org' type='result' id='F37d7-230'/>

...

 

=========== Pidgin XMPP Console log - during Add Buddy... ===================

C:<iq type='set' id='purple2624508a'>

<query xmlns='jabber:iq:roster'>

<item jid='newx@atalk.org' name='newx'>

<group>atalk member</group>

<group>friends</group>

</item>

</query>

</iq>

C:<presence to='newx@atalk.org' type='subscribe'/>

 

S:<iq to='swan@atalk.org/pidgin' from='swan@atalk.org' type='set' id='push11938586407078998045'>

<query xmlns='jabber:iq:roster' ver='a616f09ff8557a89e70505f5b6a860e2caa51b90'>

<item name='newx' jid='newx@atalk.org'>

<group>atalk member</group>

<group>friends</group>

</item>

</query>

</iq>

C:<iq type='result' id='push11938586407078998045'/>

S:<iq lang='en' to='swan@atalk.org/pidgin' from='swan@atalk.org' type='result' id='purple2624508a'/>

S:<iq to='swan@atalk.org/pidgin' from='swan@atalk.org' type='set' id='push13945211814345191093'>

<query xmlns='jabber:iq:roster' ver='3c455f64e06cecc6f5a21a151dc2a0e21d031b5f'>

<item ask='subscribe' name='newx' jid='newx@atalk.org'>

<group>atalk member</group>

<group>friends</group>

</item>

</query>

</iq>

 

C:<iq type='result' id='push13945211814345191093'/>

Outcomes