public void findWaitingMessages(OnMessageFound onMessageFound) { synchronized (this.messages) { for (Message message : this.messages) { if (message.getStatus() == Message.STATUS_WAITING) { onMessageFound.onMessageFound(message); } } } }
public void findUnreadMessages(OnMessageFound onMessageFound) { synchronized (this.messages) { for (Message message : this.messages) { if (!message.isRead()) { onMessageFound.onMessageFound(message); } } } }
public void findUnsentTextMessages(OnMessageFound onMessageFound) { synchronized (this.messages) { for (Message message : this.messages) { if (message.getType() != Message.TYPE_IMAGE && message.getStatus() == Message.STATUS_UNSEND) { onMessageFound.onMessageFound(message); } } } }
public void findMessagesWithFiles(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) { onMessageFound.onMessageFound(message); } } } }
public void findUnsentMessagesWithOtrEncryption(OnMessageFound onMessageFound) { synchronized (this.messages) { for (Message message : this.messages) { if ((message.getStatus() == Message.STATUS_UNSEND || message.getStatus() == Message.STATUS_WAITING) && (message.getEncryption() == Message.ENCRYPTION_OTR)) { onMessageFound.onMessageFound(message); } } } }
public void findUnsentMessagesWithEncryption(int encryptionType, OnMessageFound onMessageFound) { synchronized (this.messages) { for (Message message : this.messages) { if ((message.getStatus() == Message.STATUS_UNSEND || message.getStatus() == Message.STATUS_WAITING) && (message.getEncryption() == encryptionType)) { onMessageFound.onMessageFound(message); } } } }