mirror of
https://github.com/Hizenberg469/secure_mailer.git
synced 2026-04-19 16:52:24 +03:00
Hidding attachment implemented
This commit is contained in:
12
pom.xml
12
pom.xml
@@ -103,33 +103,33 @@
|
||||
<dependency>
|
||||
<groupId>org.openjfx</groupId>
|
||||
<artifactId>javafx-controls</artifactId>
|
||||
<version>23</version> <!-- Adjust this version based on your setup -->
|
||||
<version>23.0.1</version> <!-- Adjust this version based on your setup -->
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.openjfx</groupId>
|
||||
<artifactId>javafx-fxml</artifactId>
|
||||
<version>23</version>
|
||||
<version>23.0.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.openjfx</groupId>
|
||||
<artifactId>javafx-graphics</artifactId>
|
||||
<version>23</version>
|
||||
<version>23.0.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.openjfx</groupId>
|
||||
<artifactId>javafx-media</artifactId>
|
||||
<version>23</version>
|
||||
<version>23.0.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.openjfx</groupId>
|
||||
<artifactId>javafx-swing</artifactId>
|
||||
<version>23</version>
|
||||
<version>23.0.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.openjfx</groupId>
|
||||
<artifactId>javafx-web</artifactId>
|
||||
<version>23</version>
|
||||
<version>23.0.1</version>
|
||||
</dependency>
|
||||
|
||||
<!-- JavaMail Dependency -->
|
||||
|
||||
@@ -77,8 +77,12 @@ public class MessageRendererService extends Service<Object>{
|
||||
// Check if it is an attachment
|
||||
String disposition = bodyPart.getDisposition();
|
||||
if (disposition != null && disposition.equalsIgnoreCase(Part.ATTACHMENT) ) {
|
||||
|
||||
if( emailMessage.getIsAuthenticated()) {
|
||||
MimeBodyPart mbp = (MimeBodyPart) bodyPart;
|
||||
if (!emailMessage.isAttachmentLoaded())emailMessage.addAttachment(mbp);
|
||||
}
|
||||
|
||||
} else if (isSimpleType(contentType)) {
|
||||
|
||||
if( emailMessage.getIsAuthenticated() ) {
|
||||
@@ -89,16 +93,18 @@ public class MessageRendererService extends Service<Object>{
|
||||
}
|
||||
|
||||
} else if (isMultipartType(contentType)){
|
||||
|
||||
Multipart multipart2 = (Multipart) bodyPart.getContent();
|
||||
loadMultipart(multipart2,stringBuffer);
|
||||
|
||||
// } else if (!isTextPlain(contentType)) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isTextPlain(String contentType) {
|
||||
return contentType.contains("TEXT/PLAIN");
|
||||
}
|
||||
// private boolean isTextPlain(String contentType) {
|
||||
// return contentType.contains("TEXT/PLAIN");
|
||||
// }
|
||||
|
||||
private boolean isSimpleType(String contentType) {
|
||||
if(contentType.contains("TEXT/HTML") ||
|
||||
|
||||
@@ -277,9 +277,13 @@ public class MainWindowController extends BaseController implements Initializabl
|
||||
sKey = SecretCodeDAO.getSecretCode(fromEmailId);
|
||||
} catch (SQLException e) {
|
||||
// TODO Auto-generated catch block
|
||||
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
if( sKey == null || sKey.isEmpty() ) {
|
||||
showAlert("Missing Secret Key","Register Secret Key for "+fromEmailId);
|
||||
}
|
||||
|
||||
String emlHash = generateEmlHash(emailMessage.getMessage(),StringToSecretKey.stringToSecretKey(sKey));
|
||||
// String emlHash = Integer.toString(emailMessage.getMessage().hashCode());
|
||||
@@ -705,9 +709,9 @@ public class MainWindowController extends BaseController implements Initializabl
|
||||
else return false;
|
||||
}
|
||||
|
||||
private boolean isTextPlain(String contentType) {
|
||||
return contentType.contains("TEXT/PLAIN");
|
||||
}
|
||||
// private boolean isTextPlain(String contentType) {
|
||||
// return contentType.contains("TEXT/PLAIN");
|
||||
// }
|
||||
|
||||
private boolean isSimpleType(String contentType) {
|
||||
if(contentType.contains("TEXT/HTML") ||
|
||||
|
||||
Reference in New Issue
Block a user