Android smack无法使用muc id

时间:2017-05-16 13:27:51

标签: android smack vcard avatar multiuserchat

我正在使用smack版本4.1.8和服务器端我正在使用ejjabberd:

 VCard vcard = new VCard();
 vcard =  VCardManager.getInstanceFor(XMPPService.getMundioXmppConfig().getXmpptcpConnection()).loadVCard();

以上几行提供了登录帐户的vcard信息,但我想获得特定jid的vcard。

为此我尝试了:

vcard =  VCardManager.getInstanceFor(XMPPService.getMundioXmppConfig().getXmpptcpConnection()).loadVCard("testgroup@conference.localhost.com);

但它没有给我们vcard。

1 个答案:

答案 0 :(得分:0)

获取MUC vcard

<iq to='test@conference.localhost' id='get1' type='get'> <vCard xmlns='vcard-temp'/> </iq>

然后,服务器将回复此信息:

<iq from="test@conference.localhost" type="result" to="user@localhost/r" id="get1"> <vCard xmlns="vcard-temp"> <PHOTO> <TYPE>image/png</TYPE> <BINVAL> iVBORw0KGgoAAAANSUhEUgAA`</BINVAL> </PHOTO> </vCard> </iq>`

For more information about MUC vcard check this URL