Skip to content

Commit

Permalink
auto-reload in case of IMAP bad messageset. issue #2724
Browse files Browse the repository at this point in the history
  • Loading branch information
j-dimension committed Dec 17, 2024
1 parent 0b2f8ed commit 7bb6d02
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2391,7 +2391,7 @@ private void cmbDownloadMailsActionPerformed(java.awt.event.ActionEvent evt) {//
int sortCol = -1;
List<? extends SortKey> sortKeys = this.tblMails.getRowSorter().getSortKeys();
if (sortKeys != null) {
if (sortKeys.size() > 0) {
if (!sortKeys.isEmpty()) {
sortCol = sortKeys.get(0).getColumn();
}
}
Expand Down Expand Up @@ -2602,7 +2602,16 @@ private void displayMessage() {
try {
DefaultMutableTreeNode selNode = (DefaultMutableTreeNode) this.treeFolders.getSelectionPath().getLastPathComponent();
MailboxSetup ms = this.getMailboxSetup(selNode);
this.mailContentUI.setMessage(msgC, ms);
boolean messageLoaded=this.mailContentUI.setMessage(msgC, ms);
if (!messageLoaded) {
if (this.treeFolders.getSelectionPath() != null) {
DefaultMutableTreeNode selectedNode = (DefaultMutableTreeNode) this.treeFolders.getSelectionPath().getLastPathComponent();
if (selectedNode.getUserObject() instanceof FolderContainer) {
((FolderContainer)selectedNode.getUserObject()).resetCaches();
}
this.cmbDownloadMailsActionPerformed(null);
}
}

JLawyerServiceLocator locator = JLawyerServiceLocator.getInstance(settings.getLookupProperties());
AddressServiceRemote ads = locator.lookupAddressServiceRemote();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1030,13 +1030,13 @@ public void setMessage(OutlookMessage om) {
}
}

public void setMessage(MessageContainer msgC, MailboxSetup ms) {
public boolean setMessage(MessageContainer msgC, MailboxSetup ms) {

this.emlMsgContainer = msgC;
try {
Message msg = msgC.getMessage();
if (msg == null) {
return;
return true;
}

Folder folder = msg.getFolder();
Expand All @@ -1052,7 +1052,7 @@ public void setMessage(MessageContainer msgC, MailboxSetup ms) {

if (msg.isExpunged()) {
JOptionPane.showMessageDialog(this, "Nachricht wurde verschoben oder gelöscht!", com.jdimension.jlawyer.client.utils.DesktopUtils.POPUP_TITLE_ERROR, JOptionPane.ERROR_MESSAGE);
return;
return false;
}

if (msg.getSize() > (1024 * 1024 * 1.5f)) {
Expand All @@ -1064,7 +1064,7 @@ public void setMessage(MessageContainer msgC, MailboxSetup ms) {
dlg.progress("Lade E-Mail... (" + df.format(msg.getSize() / 1024 / 1024) + "MB)");
LoadEmailAction lea = new LoadEmailAction(dlg, this, msg, ms, this.lblSubject, this.lblSentDate, this.lblTo, this.lblCC, this.lblBCC, this.lblFrom, this.lstAttachments, this.fxContainer, this.webViewId);
lea.start();
return;
return true;
} else {
MailContentUI.setMessageImpl(this, msg, ms, this.lblSubject, this.lblSentDate, this.lblTo, this.lblCC, this.lblBCC, this.lblFrom, this.lstAttachments, false, this.fxContainer, this.webViewId);
}
Expand All @@ -1089,7 +1089,9 @@ public void setMessage(MessageContainer msgC, MailboxSetup ms) {
this.lblSubject.setToolTipText(null);
this.lblTo.setText("");
this.lblTo.setToolTipText(null);
return false;
}
return true;
}

public static void setMessageImpl(MailContentUI contentUI, Message msg, MailboxSetup ms, JLabel lblSubject, JLabel lblSentDate, JLabel lblTo, JLabel lblCC, JLabel lblBCC, JLabel lblFrom, JList lstAttachments, boolean edt, JPanel fxContainer, String webViewId) throws Exception {
Expand Down

0 comments on commit 7bb6d02

Please sign in to comment.