// if (!server.doesServe(toEntity)) throw WhateverException();
// TODO RFC3920: 'from' attribute SHOULD be silently ignored by the receiving entity
// TODO RFC3920bis: 'from' attribute SHOULD be not ignored by the receiving entity and used as 'to' in responses
}
responseStanza = new ServerResponses().getStreamOpenerForClient(sessionContext.getServerJID(),
responseVersion, sessionContext);
} else if (serverCall) {
// RFC3920: 'from' attribute SHOULD be used by the receiving entity
String fromValue = stanza.getAttributeValue("from");
if (fromValue != null) {
try {
EntityImpl.parse(fromValue);
} catch (EntityFormatException e) {
return new ResponseStanzaContainerImpl(ServerErrorResponses.getStreamError(
StreamErrorCondition.INVALID_FROM, sessionContext.getXMLLang(),
"could not parse incoming stanza's FROM attribute", null));
}
}
responseStanza = new ServerResponses().getStreamOpenerForServerAcceptor(sessionContext.getServerJID(),
responseVersion, sessionContext, serverRuntimeContext.getSslContext() != null);
} else {
String descriptiveText = "one of the two namespaces must be present: " + NamespaceURIs.JABBER_CLIENT
+ " or " + NamespaceURIs.JABBER_SERVER;
return respondIllegalNamespaceError(descriptiveText);