aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart/messenger/ui/adapter
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2019-02-21 19:45:12 +0100
committerChristian Schneppe <christian@pix-art.de>2019-02-21 19:45:12 +0100
commita5019812fbdaf57096b8483778b610fd3b0d1887 (patch)
treea435332fd2188c7a37163e5f3516d9e012480f82 /src/main/java/de/pixart/messenger/ui/adapter
parent485609f30cf8771b5594c951029847ee6c0b634e (diff)
show file too large instead of generic delivery failed
Diffstat (limited to 'src/main/java/de/pixart/messenger/ui/adapter')
-rw-r--r--src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java b/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java
index 8b93793c3..10eb977a7 100644
--- a/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java
+++ b/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java
@@ -260,10 +260,23 @@ public class MessageAdapter extends ArrayAdapter<Message> implements CopyTextVie
if (isResendable && file.exists()) {
info = getContext().getString(R.string.send_failed_resend);
} else {
- if (Message.ERROR_MESSAGE_CANCELLED.equals(message.getErrorMessage())) {
+ final String errorMessage = message.getErrorMessage();
+ if (Message.ERROR_MESSAGE_CANCELLED.equals(errorMessage)) {
info = getContext().getString(R.string.cancelled);
} else {
- info = getContext().getString(R.string.send_failed);
+ final String[] errorParts = errorMessage.split("\\u001f", 2);
+ if (errorParts.length == 2) {
+ switch (errorParts[0]) {
+ case "file-too-large":
+ info = getContext().getString(R.string.file_too_large);
+ break;
+ default:
+ info = getContext().getString(R.string.send_failed);
+ break;
+ }
+ } else {
+ info = getContext().getString(R.string.send_failed);
+ }
}
}
error = true;