@Override public void newStreamInitiation(Jid from, String streamID) { primaryNegotiator.newStreamInitiation(from, streamID); secondaryNegotiator.newStreamInitiation(from, streamID); }
protected final IQ initiateIncomingStream(final XMPPConnection connection, StreamInitiation initiation) throws NoResponseException, XMPPErrorException, NotConnectedException { final StreamInitiation response = createInitiationAccept(initiation, getNamespaces()); newStreamInitiation(initiation.getFrom(), initiation.getSessionID()); final String eventKey = initiation.getFrom().toString() + '\t' + initiation.getSessionID(); IQ streamMethodInitiation; try { streamMethodInitiation = initationSetEvents.performActionAndWaitForEvent(eventKey, connection.getReplyTimeout(), new Callback<NotConnectedException>() { @Override public void action() throws NotConnectedException { try { connection.sendStanza(response); } catch (InterruptedException e) { // Ignore } } }); } catch (InterruptedException e) { // TODO remove this try/catch once merged into 4.2's master branch throw new IllegalStateException(e); } if (streamMethodInitiation == null) { throw NoResponseException.newWith(connection, "stream initiation"); } XMPPErrorException.ifHasErrorThenThrow(streamMethodInitiation); return streamMethodInitiation; }