【发布时间】:2018-01-24 19:24:42
【问题描述】:
当使用这个 Strophe 命令时:
var iq = $iq({type: 'get'}).c('query', {xmlns: 'jabber:iq:roster'});
connection.sendIQ(iq)
我得到这个作为成功回调:
<iq xmlns="jabber:client" xml:lang="pt-br" to="user01@localhost/100164477219111523302818" from="user01@localhost" type="result" id="82480785-c170-48d1-a180-bcadbff957d2:sendIQ">
<query xmlns="jabber:iq:roster">
<item subscription="both" jid="user02@localhost">
<group>Roster01</group>
<group>Roster02</group>
</item>
<item subscription="both" jid="admin@localhost">
<group>Roster01</group>
<group>Roster02</group>
</item>
<item subscription="both" jid="grupo02@conference.localhost">
<group>Roster02</group>
</item>
<item subscription="both" jid="grupo01@conference.localhost">
<group>Roster01</group>
</item>
</query>
</iq>
我想知道是否有某种方法可以让这个回调按组及其成员分组。如果没有,我怎么能用 Javascript 做到这一点。示例:
- 名册 01 有 admin、user02 和 grupo01
- Roster 02 有 admin、user02 和 grupo02
我使用 ejabberd 作为 XMPP 服务器,使用 Ionic 3 作为客户端。
【问题讨论】: