Merge branch 'main' into lang_de

This commit is contained in:
2022-04-22 18:36:07 +02:00
15 changed files with 277 additions and 98 deletions

View File

@@ -14,6 +14,7 @@ public class ImapClient {
private static final Logger LOG = LoggerFactory.getLogger(ImapClient.class);
private final int port;
private final String host, username, password, folderName;
private final ProblemListener problemListener;
private IMAPFolder inbox;
private ListeningThread listeningThread;
private Heartbeat heartbeat;
@@ -47,6 +48,7 @@ public class ImapClient {
openInbox();
} catch (MessagingException e){
LOG.warn("Verbindung-Problem:",e);
problemListener.onImapException(e);
}
}
}
@@ -127,12 +129,13 @@ public class ImapClient {
}
}
public ImapClient(String host, int port, String username, String password, String folderName) {
public ImapClient(String host, int port, String username, String password, String folderName,ProblemListener listener) {
this.host = host;
this.port = port;
this.username = username;
this.password = password;
this.folderName = folderName;
this.problemListener = listener;
}
public ImapClient addListener(MessageHandler messageHandler) {

View File

@@ -0,0 +1,7 @@
package de.srsoftware.widerhall.mail;
import javax.mail.MessagingException;
public interface ProblemListener {
public void onImapException(MessagingException e);
}