public void onPresenceReceived(XmppPresence presence)
{
try
{
XmppID id = presence.getFromID();
String jid = id.toStringNoResource();
String type = presence.getType();
if(type != null&&(type.equals("subscribe")||type.equals("subscribed")||type.equals("unsubscribe")||type.equals("unsubscribed")))
{
onSubscription(id,type,presence.getNick());
return;