aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu/siacs
diff options
context:
space:
mode:
authoriNPUTmice <daniel@gultsch.de>2015-01-25 16:32:59 +0100
committeriNPUTmice <daniel@gultsch.de>2015-01-25 16:32:59 +0100
commit82a74fabc978d554384351aae13996059c827550 (patch)
tree63f2d0c7f2153bf6c7e389602293cb212b2405c7 /src/main/java/eu/siacs
parente5700f075c9385e9f6f42b128b628027e102f12e (diff)
set jingle file transfer to offer after iq offer has returned
Diffstat (limited to 'src/main/java/eu/siacs')
-rw-r--r--src/main/java/eu/siacs/conversations/xmpp/jingle/JingleConnection.java23
1 files changed, 17 insertions, 6 deletions
diff --git a/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleConnection.java b/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleConnection.java
index 843cf1e6..2d949e21 100644
--- a/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleConnection.java
+++ b/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleConnection.java
@@ -36,8 +36,6 @@ public class JingleConnection implements Downloadable {
protected static final int JINGLE_STATUS_INITIATED = 0;
protected static final int JINGLE_STATUS_ACCEPTED = 1;
- protected static final int JINGLE_STATUS_TERMINATED = 2;
- protected static final int JINGLE_STATUS_CANCELED = 3;
protected static final int JINGLE_STATUS_FINISHED = 4;
protected static final int JINGLE_STATUS_TRANSMITTING = 5;
protected static final int JINGLE_STATUS_FAILED = 99;
@@ -360,7 +358,6 @@ public class JingleConnection implements Downloadable {
}
private void sendInitRequest() {
- this.mXmppConnectionService.markMessage(this.message, Message.STATUS_OFFERED);
JinglePacket packet = this.bootstrapPacket("session-initiate");
Content content = new Content(this.contentCreator, this.contentName);
if (message.getType() == Message.TYPE_IMAGE || message.getType() == Message.TYPE_FILE) {
@@ -379,8 +376,19 @@ public class JingleConnection implements Downloadable {
content.setTransportId(this.transportId);
content.socks5transport().setChildren(getCandidatesAsElements());
packet.setContent(content);
- this.sendJinglePacket(packet);
- this.mJingleStatus = JINGLE_STATUS_INITIATED;
+ this.sendJinglePacket(packet,new OnIqPacketReceived() {
+
+ @Override
+ public void onIqPacketReceived(Account account, IqPacket packet) {
+ if (packet.getType() != IqPacket.TYPE.ERROR) {
+ mJingleStatus = JINGLE_STATUS_INITIATED;
+ mXmppConnectionService.markMessage(message, Message.STATUS_OFFERED);
+ } else {
+ fail();
+ }
+ }
+ });
+
}
}
@@ -451,10 +459,13 @@ public class JingleConnection implements Downloadable {
}
private void sendJinglePacket(JinglePacket packet) {
- // Log.d(Config.LOGTAG,packet.toString());
account.getXmppConnection().sendIqPacket(packet, responseListener);
}
+ private void sendJinglePacket(JinglePacket packet, OnIqPacketReceived callback) {
+ account.getXmppConnection().sendIqPacket(packet,callback);
+ }
+
private boolean receiveAccept(JinglePacket packet) {
Content content = packet.getJingleContent();
mergeCandidates(JingleCandidate.parse(content.socks5transport()