//------------------------------Prescence event------------------------------------\\
public void presenceChanged(final Presence presence)
{
JID jid = presence.getFrom();
final NormalJIDStatus jidStatus = (NormalJIDStatus) jidStatussen.get(jid);
if (jidStatus == null)
{
return;
}
if (jid.getUser() == null)
{
//server, server has no multiple resources
jidStatus.updatePresence(presence);
server.showChange(jidStatus);
return;
}
SecondaryJIDStatus secondary = jidStatus.getSecondaryJIDStatus(jid.getResource());
boolean seconderyAdded = false;
ResourceJIDStatus remove = null;
if (presence.getShow() == Presence.UNAVAILABLE)
{
remove = jidStatus.removeResource(jid.getResource());
if (remove == null)
{
//no remove so no resource so update presence to unavailable
if(secondary != null) secondary.updatePresence(presence);
}