Reputation: 595
I am using iOS xmppframework and ejabberd as the xmpp server.When I add rosters with nickname, sometimes I can set the nick, sometimes I can not set nick. The packets I sent to the server are:
2015-07-03 10:19:24:144 pigai[36644:3a0b] The nick is songxiao
2015-07-03 10:19:24:144 pigai[36644:3a0b] SEND: <iq type="set" xmlns="jabber:client" id="roster-remotely-managed"><query xmlns="jabber:iq:roster"><item jid="[email protected]" name="songxiao"/></query></iq>
2015-07-03 10:19:24:144 pigai[36644:800b] SEND: <presence type="subscribe" to="[email protected]"><x xmlns="vcard-temp:x:update"><photo>c769b958f910fb6bfde4e8131385cc5ad2d95e0b</photo></x></presence>
2015-07-03 10:19:24:576 pigai[36644:3a0b] RECV: <iq xmlns="jabber:client" from="[email protected]" to="[email protected]/iPhone" id="push2270407375" type="set"><query xmlns="jabber:iq:roster" ver="6e3b72a923e4574fac87e8e89f08eee251cf73c8"><item subscription="none" name="songxiao" jid="[email protected]"/></query></iq>
2015-07-03 10:19:24:576 pigai[36644:3a0b] RECV: <r xmlns="urn:xmpp:sm:3"/>
2015-07-03 10:19:24:576 pigai[36644:3a0b] RECV: <iq xmlns="jabber:client" from="[email protected]" to="[email protected]/iPhone" id="roster-remotely-managed" type="result"/>
2015-07-03 10:19:24:577 pigai[36644:3a0b] RECV: <r xmlns="urn:xmpp:sm:3"/>
2015-07-03 10:19:24:577 pigai[36644:3a0b] RECV: <iq xmlns="jabber:client" from="[email protected]" to="[email protected]/iPhone" id="push2639732641" type="set"><query xmlns="jabber:iq:roster" ver="b16ad5f42baf7c0fe11925ed879ac7ecb0bcfb85"><item ask="subscribe" subscription="none" jid="[email protected]"/></query></iq>
2015-07-03 10:19:26:602 pigai[36644:433] RECV: <r xmlns="urn:xmpp:sm:3"/>
2015-07-03 10:19:26:602 pigai[36644:433] SEND: <a xmlns="urn:xmpp:sm:3" h="15"/>
2015-07-03 10:19:26:808 pigai[36644:4b17] SEND: <a xmlns="urn:xmpp:sm:3" h="15"/>
The nick was not set. From the client side, the nick is null. From the server side, the nick is not stored in the database.
Upvotes: 0
Views: 914
Reputation: 9055
Here is a sequence that should work fine:
We will have a look to see if we can improve to handle this case better as well.
Upvotes: 1