diff options
Diffstat (limited to 'src/main/java/de/pixart/messenger/entities')
-rw-r--r-- | src/main/java/de/pixart/messenger/entities/Conversation.java | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/main/java/de/pixart/messenger/entities/Conversation.java b/src/main/java/de/pixart/messenger/entities/Conversation.java index db06ecb93..f643cb888 100644 --- a/src/main/java/de/pixart/messenger/entities/Conversation.java +++ b/src/main/java/de/pixart/messenger/entities/Conversation.java @@ -27,6 +27,7 @@ import java.util.concurrent.atomic.AtomicBoolean; import de.pixart.messenger.Config; import de.pixart.messenger.crypto.PgpDecryptionService; import de.pixart.messenger.crypto.axolotl.AxolotlService; +import de.pixart.messenger.services.XmppConnectionService; import de.pixart.messenger.xmpp.chatstate.ChatState; import de.pixart.messenger.xmpp.jid.InvalidJidException; import de.pixart.messenger.xmpp.jid.Jid; @@ -94,6 +95,8 @@ public class Conversation extends AbstractEntity implements Blockable, Comparabl private Message correctingMessage; public AtomicBoolean messagesLoaded = new AtomicBoolean(true); + XmppConnectionService mXmppConnectionService; + public boolean hasMessagesLeftOnServer() { return messagesLeftOnServer; } @@ -160,6 +163,19 @@ public class Conversation extends AbstractEntity implements Blockable, Comparabl } } + public void findFailedMessagesWithFiles(final OnMessageFound onMessageFound) { + synchronized (this.messages) { + for (final Message message : this.messages) { + if ((message.getType() == Message.TYPE_IMAGE || message.getType() == Message.TYPE_FILE) + && message.getEncryption() != Message.ENCRYPTION_PGP) { + if (message.getStatus() == Message.STATUS_SEND_FAILED && !message.isDeleted()) { + onMessageFound.onMessageFound(message); + } + } + } + } + } + public Message findMessageWithFileAndUuid(final String uuid) { synchronized (this.messages) { for (final Message message : this.messages) { |