diff options
author | iNPUTmice <daniel@gultsch.de> | 2014-10-29 11:31:03 +0100 |
---|---|---|
committer | iNPUTmice <daniel@gultsch.de> | 2014-10-29 11:31:03 +0100 |
commit | 03593ba56fe0a15312e3ae231dfdaf3be6c7548a (patch) | |
tree | f3ca3a45423f3730fe530836a4e517c216d888b4 /src/eu/siacs/conversations/xmpp/jingle | |
parent | 64209829f779214ae7fc0c6ab35de4d006c745c4 (diff) |
proper error state for images
Diffstat (limited to 'src/eu/siacs/conversations/xmpp/jingle')
-rw-r--r-- | src/eu/siacs/conversations/xmpp/jingle/JingleConnection.java | 16 | ||||
-rw-r--r-- | src/eu/siacs/conversations/xmpp/jingle/JingleConnectionManager.java | 9 |
2 files changed, 11 insertions, 14 deletions
diff --git a/src/eu/siacs/conversations/xmpp/jingle/JingleConnection.java b/src/eu/siacs/conversations/xmpp/jingle/JingleConnection.java index 7e803f0b..6b9ca9aa 100644 --- a/src/eu/siacs/conversations/xmpp/jingle/JingleConnection.java +++ b/src/eu/siacs/conversations/xmpp/jingle/JingleConnection.java @@ -73,11 +73,7 @@ public class JingleConnection implements Downloadable { @Override public void onIqPacketReceived(Account account, IqPacket packet) { if (packet.getType() == IqPacket.TYPE_ERROR) { - if (initiator.equals(account.getFullJid())) { - mXmppConnectionService.markMessage(message, - Message.STATUS_SEND_FAILED); - } - mJingleStatus = JINGLE_STATUS_FAILED; + cancel(); } } }; @@ -354,6 +350,7 @@ 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) { @@ -716,13 +713,8 @@ public class JingleConnection implements Downloadable { this.mStatus = Downloadable.STATUS_FAILED; this.mXmppConnectionService.updateConversationUi(); } else { - if (this.mJingleStatus == JINGLE_STATUS_INITIATED) { - this.mXmppConnectionService.markMessage(this.message, - Message.STATUS_SEND_REJECTED); - } else { - this.mXmppConnectionService.markMessage(this.message, - Message.STATUS_SEND_FAILED); - } + this.mXmppConnectionService.markMessage(this.message, + Message.STATUS_SEND_FAILED); } } this.mJingleConnectionManager.finishConnection(this); diff --git a/src/eu/siacs/conversations/xmpp/jingle/JingleConnectionManager.java b/src/eu/siacs/conversations/xmpp/jingle/JingleConnectionManager.java index 1e7c84d4..d937146a 100644 --- a/src/eu/siacs/conversations/xmpp/jingle/JingleConnectionManager.java +++ b/src/eu/siacs/conversations/xmpp/jingle/JingleConnectionManager.java @@ -44,8 +44,13 @@ public class JingleConnectionManager extends AbstractConnectionManager { return; } } - account.getXmppConnection().sendIqPacket( - packet.generateRespone(IqPacket.TYPE_ERROR), null); + IqPacket response = packet.generateRespone(IqPacket.TYPE_ERROR); + Element error = response.addChild("error"); + error.setAttribute("type", "cancel"); + error.addChild("item-not-found", + "urn:ietf:params:xml:ns:xmpp-stanzas"); + error.addChild("unknown-session", "urn:xmpp:jingle:errors:1"); + account.getXmppConnection().sendIqPacket(response, null); } } |