return sendMessage(from, to, type, body, null, null);
}
protected Stanza sendMessage(Entity from, Entity to, MessageStanzaType type,
String body, X x, String subject) throws ProtocolException {
StanzaBuilder stanzaBuilder = StanzaBuilder.createMessageStanza(from,
to, type, null, body);
if(subject != null) {
stanzaBuilder.startInnerElement("subject").addText(subject).endInnerElement();
}
if(x != null) {
stanzaBuilder.addPreparedElement(x);
}
Stanza messageStanza = stanzaBuilder.build();
ResponseStanzaContainer container = handler.execute(messageStanza,
sessionContext.getServerRuntimeContext(), true, sessionContext,
null);
if (container != null) {
return container.getResponseStanza();