1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-11-27 14:32:06 +01:00
This commit is contained in:
vanitasvitae 2017-06-10 01:53:59 +02:00
parent eda7859aa7
commit 38f54b140c
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311
2 changed files with 26 additions and 22 deletions

View file

@ -61,13 +61,25 @@ public class InitiatorOutgoingFileTransferInitiated implements JingleSessionHand
switch (jingle.getAction()) {
case session_accept:
startTransfer(bm, jingle);
break;
case session_terminate:
break;
default:
break;
}
return IQ.createResultIQ(jingle);
}
public void startTransfer(AbstractJingleTransportManager<?> transportManager, Jingle jingle) {
BytestreamSession session;
try {
session = bm.outgoingInitiatedSession(jingle);
session = transportManager.outgoingInitiatedSession(jingle);
} catch (Exception e) {
//TODO
return null;
return;
}
HashElement fileHash;
@ -79,15 +91,7 @@ public class InitiatorOutgoingFileTransferInitiated implements JingleSessionHand
session.close();
} catch (IOException e) {
//TODO:
return null;
}
break;
case session_terminate:
break;
default:
break;
}
return IQ.createResultIQ(jingle);
return;
}
}
}

View file

@ -140,7 +140,7 @@ public final class JingleS5BTransportManager extends AbstractJingleTransportMana
public Jingle createSessionAccept(Jingle request)
throws XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException, SmackException.NoResponseException {
JingleContent receivedContent = request.getContents().get(0);
JingleS5BTransport receviedTransport = (JingleS5BTransport) receivedContent.getJingleTransports().get(0);
JingleS5BTransport receivedTransport = (JingleS5BTransport) receivedContent.getJingleTransports().get(0);
Jingle.Builder jb = Jingle.getBuilder();
jb.setResponder(connection().getUser())
.setAction(JingleAction.session_accept)
@ -151,7 +151,7 @@ public final class JingleS5BTransportManager extends AbstractJingleTransportMana
.setCreator(receivedContent.getCreator())
.setName(receivedContent.getName())
.setDescription(receivedContent.getDescription())
.addTransport(createJingleContentTransport(request.getInitiator(), receviedTransport));
.addTransport(createJingleContentTransport(request.getInitiator(), receivedTransport));
jb.addJingleContent(cb.build());
Jingle jingle = jb.build();