大家好  项目采用GLOOX1.0 版本开发 目前就是做实时获取用户状态我在handleRosterPresence接口里面能正确获取,  现在有个问题 就是我开始登陆的时候 服务器不会吧 当前在线和其他状态的用户不会发送给我 , 只是用户改变状态过后才发送给我, 请我 我要如何在登陆后 获取用户的状态!。
问题二:
 void RefConListen::handleVCard( const JID& jid, const VCard* vcard ) 
{
VCard c;
c=*vcard;
VCard::EmailList::const_iterator ite=c.emailAddresses().begin();
VCard::LabelList ::const_iterator itse=c.labels().begin();
}
这个接口是调用获取好友信息, 但是 进去后我如何 获取好友的任何信息 , 希望赐教点代码!

解决方案 »

  1.   

    朋友,,第一个问题:
    handleRoster这个接口的Roster& roster,包含了你所有的好友以及好友的在线状态(登录成功即返回),
    而你说的handleRosterPresence接口,这是返回在线的,或者是状态有改变好友时返回的。第二个问题:
    这个接口返回的是jid(你想要获取的好友id),vcard即是这个id下的名片夹信息,里面有所有你需要的信息。调用名片管理类的 如下方法即可:
    /** * Use this function to fetch the VCard of a remote entity or yourself.
           * The result will be announced by calling handleVCard() the VCardHandler.
           * @param jid The entity's JID. Should be a bare JID unless you want to fetch the VCard of, e.g., a MUC item.
           * @param vch The VCardHandler that will receive the result of the VCard fetch.
           */
          void fetchVCard( const JID& jid, VCardHandler* vch );我也是最近开始研究gloox的。打算开发IM程序。可以与我交流:[email protected]
      

  2.   

    http://blog.csdn.net/night_cat/article/details/3912043