|| (sessionContext != null && sessionContext
.getAttribute(SessionContext.SESSION_ATTRIBUTE_PRESENCE_STANZA_NO_RECEIVE) != null)) {
return null;
}
PresenceStanzaType type = presenceStanza.getPresenceType();
boolean available = PresenceStanzaType.isAvailable(type);
if (isOutboundStanza) {
Entity user = XMPPCoreStanzaHandler.extractUniqueSenderJID(presenceStanza, sessionContext);
if (user == null) {
return ServerErrorResponses.getStanzaError(StanzaErrorCondition.UNKNOWN_SENDER,
presenceStanza, StanzaErrorType.MODIFY, "sender info insufficient: no from", null, null);
}
if (available) {
return handleOutboundAvailable(presenceStanza, serverRuntimeContext, sessionContext, rosterManager,
user, registry);
} else if (type == UNAVAILABLE) {
return handleOutboundUnavailable(presenceStanza, serverRuntimeContext, sessionContext, rosterManager,
user, registry);
} else if (type == PROBE) {
return handleOutboundPresenceProbe(presenceStanza, serverRuntimeContext, sessionContext, registry);
} else if (type == ERROR) {
throw new RuntimeException("not implemented yet");
} else {
throw new RuntimeException("unhandled outbound presence case " + type.value());
}
} else /* inbound */{
if (available) {
return handleInboundAvailable(presenceStanza, serverRuntimeContext, sessionContext, registry);
} else if (type == UNAVAILABLE) {
return handleInboundUnavailable(presenceStanza, serverRuntimeContext, sessionContext, registry);
} else if (type == PROBE) {
return handleInboundPresenceProbe(presenceStanza, serverRuntimeContext, sessionContext, registry,
rosterManager);
} else if (type == ERROR) {
throw new RuntimeException("not implemented yet");
} else {
throw new RuntimeException("unhandled inbound presence case " + type.value());
}
}
}