예제 #1
0
 public long getLastMessageTransmitted() {
   long last_clear = getLastClearHistory();
   if (last_clear != 0) {
     return last_clear;
   }
   synchronized (this.messages) {
     for (int i = this.messages.size() - 1; i >= 0; --i) {
       Message message = this.messages.get(i);
       if (message.getStatus() == Message.STATUS_RECEIVED || message.isCarbon()) {
         return message.getTimeSent();
       }
     }
   }
   return 0;
 }
예제 #2
0
 private int getMostRecentlyUsedOutgoingEncryption() {
   synchronized (this.messages) {
     for (int i = this.messages.size() - 1; i >= 0; --i) {
       final Message m = this.messages.get(i);
       if (!m.isCarbon() && m.getStatus() != Message.STATUS_RECEIVED) {
         final int e = m.getEncryption();
         if (e == Message.ENCRYPTION_DECRYPTED || e == Message.ENCRYPTION_DECRYPTION_FAILED) {
           return Message.ENCRYPTION_PGP;
         } else {
           return e;
         }
       }
     }
   }
   return Message.ENCRYPTION_NONE;
 }