xmppSession.addIQListener(new IQListener() {
@Override
public void handle(IQEvent e) {
IQ iq = e.getIQ();
if (e.isIncoming() && !e.isConsumed() && iq.getType() == IQ.Type.GET) {
ConfirmationRequest confirmationRequest = iq.getExtension(ConfirmationRequest.class);
if (confirmationRequest != null) {
if (notifyHttpAuthListeners(iq, confirmationRequest)) {
e.consume();
}
}
}
}
});
xmppSession.addMessageListener(new MessageListener() {
@Override
public void handle(MessageEvent e) {
if (e.isIncoming()) {
Message message = e.getMessage();
if (message.getType() == null || message.getType() == Message.Type.NORMAL) {
ConfirmationRequest confirmationRequest = message.getExtension(ConfirmationRequest.class);
if (confirmationRequest != null) {
notifyHttpAuthListeners(message, confirmationRequest);
}
}
}