aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2017-02-09 15:36:36 +0100
committerChristian Schneppe <christian@pix-art.de>2017-02-09 15:36:36 +0100
commit49fb5e29cd931a504bd414c3398cb0e39fa17da6 (patch)
treeef668d437d8a8756cf23cb0ad8d6d4f6f29ece67 /src
parent793810d4c06a40a33e1fb51fa8c1b8fa94e37f8a (diff)
only show failed uploads if file isn't deleted
Diffstat (limited to 'src')
-rw-r--r--src/main/java/de/pixart/messenger/entities/Conversation.java2
-rw-r--r--src/main/java/de/pixart/messenger/entities/Message.java4
2 files changed, 5 insertions, 1 deletions
diff --git a/src/main/java/de/pixart/messenger/entities/Conversation.java b/src/main/java/de/pixart/messenger/entities/Conversation.java
index 4a7b45088..db06ecb93 100644
--- a/src/main/java/de/pixart/messenger/entities/Conversation.java
+++ b/src/main/java/de/pixart/messenger/entities/Conversation.java
@@ -1000,7 +1000,7 @@ public class Conversation extends AbstractEntity implements Blockable, Comparabl
for (int i = this.messages.size() - 1; i >= 0; --i) {
Message message = this.messages.get(i);
if ((message.getType() == Message.TYPE_IMAGE || message.getType() == Message.TYPE_FILE) && message.getEncryption() != Message.ENCRYPTION_PGP) {
- if (message.getStatus() == Message.STATUS_SEND_FAILED){
+ if (message.getStatus() == Message.STATUS_SEND_FAILED && !message.isDeleted()){
++count;
}
}
diff --git a/src/main/java/de/pixart/messenger/entities/Message.java b/src/main/java/de/pixart/messenger/entities/Message.java
index 0936c86c8..59073cb77 100644
--- a/src/main/java/de/pixart/messenger/entities/Message.java
+++ b/src/main/java/de/pixart/messenger/entities/Message.java
@@ -804,6 +804,10 @@ public class Message extends AbstractEntity {
return type == TYPE_FILE || type == TYPE_IMAGE;
}
+ public boolean isDeleted() {
+ return (type == TYPE_FILE || type == TYPE_IMAGE) && getTransferable() != null && getTransferable().getFileSize() == 0;
+ }
+
public boolean hasFileOnRemoteHost() {
return isFileOrImage() && getFileParams().url != null;
}