就是下面这个函数
- (void)xmppStream:(XMPPStream *)sender didReceivePresence:(XMPPPresence *)presence{}
目前网上的demo都是用这个函数来获取好友列表的,但是此方法并不是用来获取好友列表的,他只能拿到线上好友的信息,如果这个好友没上线,你就无法取得这个好友的信息,一旦这个好友上线了,你就能取到,如果他下线了,这个时候你能获得他下线的信息。
//取得好友状态
doctorFriend.presenceType = [presence type];
//当前用户
NSString *userId = [[sender myJID] user];
userId = [NSString stringWithFormat:@"%@@%@",userId,HOSTNAME];
//