Beispiel #1
0
 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);
       }
     }
   }
 }
Beispiel #3
0
 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);
       }
     }
   }
 }
Beispiel #4
0
 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);
       }
     }
   }
 }
Beispiel #5
0
 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);
       }
     }
   }
 }