mirror of
https://github.com/M66B/FairEmail.git
synced 2025-12-28 08:32:16 +01:00
POP support
This commit is contained in:
@@ -49,7 +49,9 @@ public class EntityAccount implements Serializable {
|
||||
@NonNull
|
||||
public Integer auth_type;
|
||||
@NonNull
|
||||
public String host; // IMAP
|
||||
public Boolean pop = false;
|
||||
@NonNull
|
||||
public String host; // POP3/IMAP
|
||||
@NonNull
|
||||
public Boolean starttls;
|
||||
@NonNull
|
||||
@@ -86,6 +88,10 @@ public class EntityAccount implements Serializable {
|
||||
public String error;
|
||||
public Long last_connected;
|
||||
|
||||
String getProtocol() {
|
||||
return (pop ? "pop3" : "imap") + (starttls ? "" : "s");
|
||||
}
|
||||
|
||||
static String getNotificationChannelName(long account) {
|
||||
return "notification." + account;
|
||||
}
|
||||
@@ -110,6 +116,7 @@ public class EntityAccount implements Serializable {
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("id", id);
|
||||
json.put("auth_type", auth_type);
|
||||
json.put("pop", pop);
|
||||
json.put("host", host);
|
||||
json.put("starttls", starttls);
|
||||
json.put("insecure", insecure);
|
||||
@@ -142,6 +149,8 @@ public class EntityAccount implements Serializable {
|
||||
EntityAccount account = new EntityAccount();
|
||||
// id
|
||||
account.auth_type = json.getInt("auth_type");
|
||||
if (json.has("pop"))
|
||||
account.pop = json.getBoolean("pop");
|
||||
account.host = json.getString("host");
|
||||
account.starttls = (json.has("starttls") && json.getBoolean("starttls"));
|
||||
account.insecure = (json.has("insecure") && json.getBoolean("insecure"));
|
||||
|
||||
Reference in New Issue
Block a user