Ignore:
Timestamp:
04/16/19 16:06:37 (5 years ago)
Author:
bln4
Message:

You can now check for new mail while logged in (when you open the mail bay)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/expeditee/auth/account/Authenticate.java

    r1316 r1320  
    11package org.expeditee.auth.account;
    22
    3 import java.io.File;
    43import java.io.IOException;
    5 import java.nio.file.Path;
    6 import java.nio.file.Paths;
    74import java.security.InvalidKeyException;
    85import java.security.KeyFactory;
     
    2926import org.expeditee.auth.AuthenticatorBrowser;
    3027import org.expeditee.auth.Mail;
    31 import org.expeditee.auth.Mail.MailEntry;
    3228import org.expeditee.auth.gui.MailBay;
    3329import org.expeditee.auth.tags.AuthenticationTag;
     
    107103                                        byte[] keyBytes = Base64.getDecoder().decode(keyEncoded);
    108104                                        PrivateKey key = KeyFactory.getInstance(AsymmetricAlgorithm).generatePrivate(new PKCS8EncodedKeySpec(keyBytes));
    109                                         List<MailEntry> mailForLoggingInUser = Mail.getEntries(UserSettings.UserName.get(), key);                       
    110                                         for (MailEntry mail: mailForLoggingInUser) {
    111                                                 MailBay.addMessage(mail.timestamp, mail.message, mail.message2, mail.options);
    112                                         }
    113                                        
    114                                         // Update last read files.
    115                                         Path deadDropPath = Paths.get(FrameIO.DEAD_DROPS_PATH);
    116                                         for (File connectionDir: deadDropPath.toFile().listFiles()) {
    117                                                 if (connectionDir.isDirectory()) {
    118                                                         Path deaddropforcontactPath = Paths.get(connectionDir.getAbsolutePath());
    119                                                         AuthenticatorBrowser.getInstance().updateLastReadMailTime(deaddropforcontactPath);
    120                                                 }
    121                                         }
     105                                        org.expeditee.auth.Mail.checkMail(key);
    122106                                } else {
    123107                                        res.additionalInfo.add("No private key present: your communication with other Expeditee users will be limited until this is resolved.");
     
    163147                return AuthenticationResult.SuccessLogout;
    164148        }
    165 
     149       
    166150        public enum AuthenticationResult {
    167151
Note: See TracChangeset for help on using the changeset viewer.