mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-11-23 20:42:06 +01:00
JIBB works
This commit is contained in:
parent
c4ef2c9552
commit
a101de29fd
3 changed files with 37 additions and 38 deletions
|
@ -135,16 +135,15 @@ public class IncomingJingleFileOffer extends JingleFileTransferSession implement
|
|||
return;
|
||||
}
|
||||
|
||||
queued.add(threadPool.submit(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
state = State.active;
|
||||
|
||||
transportSession.initiateIncomingSession(new JingleTransportInitiationCallback() {
|
||||
@Override
|
||||
public void onSessionInitiated(BytestreamSession bytestreamSession) {
|
||||
LOGGER.log(Level.INFO, "BEFORE THREAD START!");
|
||||
receivingThread = new ReceiveTask(bytestreamSession, file, target);
|
||||
queued.add(threadPool.submit(receivingThread));
|
||||
LOGGER.log(Level.INFO,"AFTER THREAD START!");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -152,13 +151,13 @@ public class IncomingJingleFileOffer extends JingleFileTransferSession implement
|
|||
|
||||
}
|
||||
});
|
||||
|
||||
try {
|
||||
jutil.sendSessionAccept(getInitiator(), sid, creator, name, JingleContent.Senders.initiator, file, transportSession.createTransport());
|
||||
} catch (SmackException.NotConnectedException | SmackException.NoResponseException | XMPPException.XMPPErrorException | InterruptedException e) {
|
||||
LOGGER.log(Level.SEVERE, "Could not send session-accept: " + e, e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void declineIncomingFileOffer(Jingle request) {
|
||||
|
|
|
@ -103,9 +103,9 @@ public class OutgoingJingleFileOffer extends JingleFileTransferSession {
|
|||
|
||||
LOGGER.log(Level.INFO, "Session was accepted. Initiate Bytestream.");
|
||||
state = State.active;
|
||||
queued.add(threadPool.submit(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
transportSession.processJingle(sessionAccept);
|
||||
|
||||
transportSession.initiateOutgoingSession(new JingleTransportInitiationCallback() {
|
||||
@Override
|
||||
public void onSessionInitiated(final BytestreamSession session) {
|
||||
|
@ -119,8 +119,6 @@ public class OutgoingJingleFileOffer extends JingleFileTransferSession {
|
|||
LOGGER.log(Level.SEVERE, "Cannot create outgoing Bytestream session: ", e);
|
||||
}
|
||||
});
|
||||
}
|
||||
}));
|
||||
|
||||
return jutil.createAck(sessionAccept);
|
||||
}
|
||||
|
|
|
@ -89,7 +89,7 @@ public class JingleIBBTransportSession extends JingleTransportSession<JingleIBBT
|
|||
public void incomingBytestreamRequest(BytestreamRequest request) {
|
||||
if (request.getFrom().asFullJidIfPossible().equals(jingleSession.get().getRemote())
|
||||
&& request.getSessionID().equals(ibbTransport.getSessionId())) {
|
||||
|
||||
LOGGER.log(Level.INFO,"MATCH! Create bytesteam session.");
|
||||
BytestreamSession session;
|
||||
|
||||
try {
|
||||
|
@ -99,6 +99,8 @@ public class JingleIBBTransportSession extends JingleTransportSession<JingleIBBT
|
|||
return;
|
||||
}
|
||||
callback.onSessionInitiated(session);
|
||||
} else {
|
||||
LOGGER.log(Level.SEVERE, "MISSMATCH");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue