- Timestamp:
- 12/03/19 16:30:10 (4 years ago)
- Location:
- trunk/src/org/expeditee/auth
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/auth/account/Authenticate.java
r1454 r1478 34 34 import org.expeditee.gui.FrameUtils; 35 35 import org.expeditee.gui.MessageBay; 36 import org.expeditee.gui.management.ResourceManager; 36 37 import org.expeditee.items.Item; 37 38 import org.expeditee.items.Text; … … 102 103 //Settings.parseSettings(settingsLink); 103 104 FrameUtils.ParseProfile(oneFrame); 105 ResourceManager.invalidateAllResourceDirectories(); 104 106 105 107 // At this point we at least login, but maybe with problems. -
trunk/src/org/expeditee/auth/mail/Mail.java
r1389 r1478 38 38 import org.expeditee.auth.AuthenticatorBrowser; 39 39 import org.expeditee.auth.mail.gui.MailBay; 40 import org.expeditee.encryption.Actions;41 40 import org.expeditee.encryption.CryptographyConstants; 42 41 import org.expeditee.gui.FrameIO; … … 70 69 // Send message 71 70 sendMail(mail, secretKey, databaseFilePath); 71 72 // Do it all again if demo mode is on (ensures sync without having to move db files) 73 if (Boolean.getBoolean("expeditee.demo-mode")) { 74 databaseFileDirPath = ensureDeadDropsDemoMode(colleagueName); 75 databaseFilePath = ensureDatabaseFile(colleagueName, databaseFileDirPath); 76 sendMail(mail, secretKey, databaseFilePath); 77 } 72 78 } 73 79 … … 98 104 // Send message 99 105 sendMail(mail, publicKey, databaseFilePath); 106 107 // Do it all again if demo mode is on (ensures sync without having to move db files) 108 if (Boolean.getBoolean("expeditee.demo-mode")) { 109 databaseFileDirPath = ensureDeadDropsDemoMode(colleagueName); 110 databaseFilePath = ensureDatabaseFile(colleagueName, databaseFileDirPath); 111 try { 112 publicKey = AuthenticatorBrowser.getInstance().getPublicKey(colleagueName); 113 } catch (InvalidKeySpecException | NoSuchAlgorithmException | KeyStoreException | CertificateException 114 | ClassNotFoundException | IOException | SQLException e) { 115 System.err.println("Error while sending message. Unable to obtain public key for colleague " + 116 colleagueName + ". Exception message: " + e.getMessage()); 117 return; 118 } 119 if (publicKey == null) { 120 System.err.println("(Demo mode) Error while sending message. Unable to obtain public key for colleague. Have you exchanged contact details?"); 121 return; 122 } 123 124 sendMail(mail, publicKey, databaseFilePath); 125 } 100 126 } 101 127 … … 138 164 } 139 165 166 private static Path ensureDeadDropsDemoMode(String colleagueName) { 167 String me = UserSettings.UserName.get().toLowerCase(); 168 String them = colleagueName.toLowerCase(); 169 String demoModeDeadDropsPath = FrameIO.DEAD_DROPS_PATH.replace(me, them); 170 Path databaseFileDirPath = Paths.get(demoModeDeadDropsPath).resolve(me + "+" + them); 171 if (!databaseFileDirPath.toFile().exists()) { 172 databaseFileDirPath = Paths.get(demoModeDeadDropsPath).resolve(them + "+" + me); 173 } 174 return databaseFileDirPath; 175 } 176 140 177 private static Path ensureDeadDrops(String colleagueName, String sender) { 141 178 String me = sender.toLowerCase();
Note:
See TracChangeset
for help on using the changeset viewer.