Hidding attachment implemented

This commit is contained in:
2024-11-12 13:16:38 +05:30
parent 9cf823b469
commit 4a68f7f2f5
3 changed files with 24 additions and 14 deletions

12
pom.xml
View File

@@ -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 -->

View File

@@ -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) ) {
MimeBodyPart mbp = (MimeBodyPart) bodyPart;
if (!emailMessage.isAttachmentLoaded())emailMessage.addAttachment(mbp);
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") ||

View File

@@ -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") ||