Changeset 1320 for trunk/src/org/expeditee/auth/Mail.java
- Timestamp:
- 04/16/19 16:06:37 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/auth/Mail.java
r1294 r1320 34 34 import javax.crypto.NoSuchPaddingException; 35 35 36 import org.expeditee.auth.gui.MailBay; 36 37 import org.expeditee.gui.FrameIO; 37 38 import org.expeditee.settings.UserSettings; … … 55 56 public static void sendMail(MailEntry mail, String colleagueName) { 56 57 // Ensure dead drop area is set up. 57 Path databaseFileDirPath = Paths.get(FrameIO.DEAD_DROPS_PATH).resolve(UserSettings.UserName.get() + "+" + colleagueName); 58 String me = UserSettings.UserName.get().toLowerCase(); 59 String them = colleagueName.toLowerCase(); 60 Path databaseFileDirPath = Paths.get(FrameIO.DEAD_DROPS_PATH).resolve(me + "+" + them); 61 if (!databaseFileDirPath.toFile().exists()) { 62 databaseFileDirPath = Paths.get(FrameIO.DEAD_DROPS_PATH).resolve(them + "+" + me); 63 } 58 64 Path databaseFilePath = databaseFileDirPath.resolve(colleagueName + ".db"); 59 65 File databaseFile = databaseFilePath.toFile(); … … 234 240 } 235 241 } 242 243 public static void checkMail(PrivateKey key) throws NoSuchAlgorithmException, NoSuchPaddingException, 244 IllegalBlockSizeException, BadPaddingException, InvalidKeyException, KeyStoreException, 245 FileNotFoundException, CertificateException, IOException, ClassNotFoundException, SQLException, ParseException { 246 MailBay.clear(); 247 AuthenticatorBrowser.getInstance().loadMailDatabase(); 248 List<MailEntry> mailForLoggingInUser = Mail.getEntries(UserSettings.UserName.get(), key); 249 for (MailEntry mail: mailForLoggingInUser) { 250 MailBay.addMessage(mail.timestamp, mail.message, mail.message2, mail.options); 251 } 252 253 // Update last read files. 254 Path deadDropPath = Paths.get(FrameIO.DEAD_DROPS_PATH); 255 for (File connectionDir: deadDropPath.toFile().listFiles()) { 256 if (connectionDir.isDirectory()) { 257 Path deaddropforcontactPath = Paths.get(connectionDir.getAbsolutePath()); 258 AuthenticatorBrowser.getInstance().updateLastReadMailTime(deaddropforcontactPath); 259 } 260 } 261 } 236 262 }
Note:
See TracChangeset
for help on using the changeset viewer.