Transferred from: http://www.cnblogs.com/dyingbleed/archive/2013/05/13/3071544.html
Friend status
Get a friend status by implementing
-(void) Xmppstream: (xmppstream *) sender didreceivepresence: (xmpppresence *) presence
Method
When the content of the <presence/> Tag is received, the Xmppframework framework callbacks the method
The format of a <presence/> tag is generally as follows:
<presence from= "" >
<show> here is the content displayed <show/>
<status> here is the state of the display <status/>
<presence/>
Status of Presence:
Available online
Away leave
Do not Disturb busy
Unavailable downline
-(void) Xmppstream: (Xmppstream *) sender Didreceivepresence: (xmpppresence *) presence { NSString *presencetype = [ Presence type]; NSString *presencefromuser = [[presence from] user]; if (![ Presencefromuser isequaltostring:[[sender Myjid] user]) { if ([Presencetype isequaltostring:@ "available"]) { // } else if ([Presencetype isequaltostring:@ "Unavailable"]) { // }}}
IOS XMPP uses Xmppframewok (iii): Friend status