// Synchronization to avoid conflict with login/logout events
// processed in the SessionManager asynchronously
synchronized (session) {
try {
final String jid = session.getJID();
PresenceType pres_type = roster_util.getPresenceType(session, packet);
if (pres_type == null) {
log.warning("Invalid presence found: " + packet.toString());
return;
} // end of if (type == null)