diff options
author | Christian Schneppe <christian@pix-art.de> | 2017-02-09 15:36:36 +0100 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2017-02-09 15:36:36 +0100 |
commit | 49fb5e29cd931a504bd414c3398cb0e39fa17da6 (patch) | |
tree | ef668d437d8a8756cf23cb0ad8d6d4f6f29ece67 /src | |
parent | 793810d4c06a40a33e1fb51fa8c1b8fa94e37f8a (diff) |
only show failed uploads if file isn't deleted
Diffstat (limited to '')
-rw-r--r-- | src/main/java/de/pixart/messenger/entities/Conversation.java | 2 | ||||
-rw-r--r-- | src/main/java/de/pixart/messenger/entities/Message.java | 4 |
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; } |