aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart/messenger/xmpp
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2016-10-26 22:43:04 +0200
committerChristian Schneppe <christian@pix-art.de>2016-10-26 22:43:04 +0200
commit844d59566c5ee3b84ab240cab14119490e7eec2b (patch)
treedb71961d882eaa197a1512d75d889768db767b3e /src/main/java/de/pixart/messenger/xmpp
parentfae5a658b9ea3c637c2158e60a1cd369ef4f912a (diff)
add error message to failed messages. accessible via context menu
Diffstat (limited to 'src/main/java/de/pixart/messenger/xmpp')
-rw-r--r--src/main/java/de/pixart/messenger/xmpp/jingle/JingleConnection.java12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/main/java/de/pixart/messenger/xmpp/jingle/JingleConnection.java b/src/main/java/de/pixart/messenger/xmpp/jingle/JingleConnection.java
index 0c8eec2bb..6db0b9787 100644
--- a/src/main/java/de/pixart/messenger/xmpp/jingle/JingleConnection.java
+++ b/src/main/java/de/pixart/messenger/xmpp/jingle/JingleConnection.java
@@ -27,6 +27,7 @@ import de.pixart.messenger.entities.Presence;
import de.pixart.messenger.entities.ServiceDiscoveryResult;
import de.pixart.messenger.entities.Transferable;
import de.pixart.messenger.entities.TransferablePlaceholder;
+import de.pixart.messenger.parser.IqParser;
import de.pixart.messenger.persistance.FileBackend;
import de.pixart.messenger.services.AbstractConnectionManager;
import de.pixart.messenger.services.XmppConnectionService;
@@ -90,7 +91,7 @@ public class JingleConnection implements Transferable {
@Override
public void onIqPacketReceived(Account account, IqPacket packet) {
if (packet.getType() != IqPacket.TYPE.RESULT) {
- fail();
+ fail(IqParser.extractErrorMessage(packet));
}
}
};
@@ -492,7 +493,7 @@ public class JingleConnection implements Transferable {
mJingleStatus = JINGLE_STATUS_INITIATED;
mXmppConnectionService.markMessage(message, Message.STATUS_OFFERED);
} else {
- fail();
+ fail(IqParser.extractErrorMessage(packet));
}
}
});
@@ -850,6 +851,10 @@ public class JingleConnection implements Transferable {
}
private void fail() {
+ fail(null);
+ }
+
+ private void fail(String errorMessage) {
this.mJingleStatus = JINGLE_STATUS_FAILED;
this.disconnectSocks5Connections();
if (this.transport != null && this.transport instanceof JingleInbandTransport) {
@@ -866,7 +871,8 @@ public class JingleConnection implements Transferable {
this.mXmppConnectionService.updateConversationUi();
} else {
this.mXmppConnectionService.markMessage(this.message,
- Message.STATUS_SEND_FAILED);
+ Message.STATUS_SEND_FAILED,
+ errorMessage);
this.message.setTransferable(null);
}
}