Exemplo n.º 1
0
 public void findWaitingMessages(OnMessageFound onMessageFound) {
   synchronized (this.messages) {
     for (Message message : this.messages) {
       if (message.getStatus() == Message.STATUS_WAITING) {
         onMessageFound.onMessageFound(message);
       }
     }
   }
 }
Exemplo n.º 2
0
 public void findUnreadMessages(OnMessageFound onMessageFound) {
   synchronized (this.messages) {
     for (Message message : this.messages) {
       if (!message.isRead()) {
         onMessageFound.onMessageFound(message);
       }
     }
   }
 }
Exemplo n.º 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);
       }
     }
   }
 }
Exemplo n.º 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);
       }
     }
   }
 }
Exemplo n.º 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);
       }
     }
   }
 }
Exemplo n.º 6
0
 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);
       }
     }
   }
 }