ejabberd 有时在添加花名册时无法设置昵称

ejabberd can not set nickname when add roster sometimes

我正在使用iOS xmppframework 和ejabberd 作为xmpp server.When 我用昵称添加花名册,有时我可以设置昵称,有时我不能设置昵称。我发送到服务器的数据包是:

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="xh1@192.168.1.67" name="songxiao"/></query></iq>
2015-07-03 10:19:24:144 pigai[36644:800b] SEND: <presence type="subscribe" to="xh1@192.168.1.67"><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="test3@192.168.1.67" to="test3@192.168.1.67/iPhone" id="push2270407375" type="set"><query xmlns="jabber:iq:roster" ver="6e3b72a923e4574fac87e8e89f08eee251cf73c8"><item subscription="none" name="songxiao" jid="xh1@192.168.1.67"/></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="test3@192.168.1.67" to="test3@192.168.1.67/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="test3@192.168.1.67" to="test3@192.168.1.67/iPhone" id="push2639732641" type="set"><query xmlns="jabber:iq:roster" ver="b16ad5f42baf7c0fe11925ed879ac7ecb0bcfb85"><item ask="subscribe" subscription="none" jid="xh1@192.168.1.67"/></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"/>

昵称未设置。从客户端来看,昵称是空的。从服务器端来看,昵称没有存储在数据库中。

这是一个应该可以正常工作的序列:

  1. 发送状态订阅。
  2. 等待回复。
  3. 在花名册项目上设置名称。

我们会看看是否可以改进以更好地处理这种情况。