0

我正在编写示例 xmpp 客户端,需要设置帐户用户头像。

按照 ignite 站点中的示例,我可以登录到 xmpp 服务器,但无法使用 ejabberd 服务器端设置 useravatar。我也尝试在核心中使用带有 asmack 的 beem(开源 xmpp 项目),它也无法设置头像。

请帮忙,谢谢任何建议

ProviderManager.getInstance().addIQProvider("vCard", "vcard-temp", new VCardProvider());
                    VCard vCard = new VCard();
                    try {
                        vCard.load(connection);
                        vCard.setAvatar(byteArray);
                        vCard.save(connection);
                    } catch (XMPPException e1) {
                        // TODO Auto-generated catch block
                        e1.printStackTrace();
                    }
4

1 回答 1

1

the problem with XEP documentation is that it only contains the message data information but not how to implement them. for example to get lastname from vCard I need to type:

String lastname = vCard.getlastname(); // just example

this information I cannot see anywhere in the xep documentation. therefore I think answers should stop asking the questioners to see the documentation since, they have already in most cases seen them but did not find the answers and so turned to SO. but if there is any documentation that shows how to implement the smack library would be useful to cite. Thank you! and Happy Programming!

于 2013-11-30T15:49:11.367 回答