public void sendIQ(final String category, final IQ iq, final IQCallback handler) {
iqManager.sendIQRequest(category, iq, handler, false);
}
private void bindResource(@Nullable final String resource) {
final IQ iq = new IQ(IQ.Type.set);
if (Strings.isNullOrEmpty(resource))
iq.addExtension("bind", XmppNamespaces.BIND);
else
iq.addExtension("bind", XmppNamespaces.BIND).setChildText("resource", resource);
iqManager.sendIQRequest("bind-resource", iq, new IQCallback() {
@Override
public void onIQSuccess(final IQ iq) {
setStatus(SessionStatus.binded);
requestSession(XmppURI.uri(iq.getExtension("bind", XmppNamespaces.BIND).getChildText("jid")));
}
@Override
public void onIQFailure(final IQ iq) {
connection.disconnect();