Individual account management proof of concept

This commit is contained in:
M66B
2019-12-06 20:58:56 +01:00
parent f7e522e042
commit 062d2e0deb
4 changed files with 206 additions and 41 deletions

View File

@@ -19,7 +19,10 @@ package eu.faircode.email;
Copyright 2018-2019 by Marcel Bokhorst (M66B)
*/
import java.util.Objects;
public class TupleAccountState extends EntityAccount {
// TODO: folder property changes (name, synchronize, poll)
public int folders;
public int operations;
@@ -27,10 +30,25 @@ public class TupleAccountState extends EntityAccount {
public boolean equals(Object obj) {
if (obj instanceof TupleAccountState) {
TupleAccountState other = (TupleAccountState) obj;
return (super.equals(obj) && // TODO selected attributes
this.folders == other.folders &&
this.operations == other.operations);
return (this.host.equals(other.host) &&
this.starttls == other.starttls &&
this.insecure == other.insecure &&
this.port.equals(other.port) &&
// auth_type
this.user.equals(other.user) &&
this.password.equals(other.password) &&
Objects.equals(this.realm, other.realm) &&
this.notify == other.notify &&
this.poll_interval.equals(other.poll_interval) &&
this.partial_fetch == other.partial_fetch &&
this.ignore_size == other.ignore_size &&
this.use_date == other.use_date &&
this.folders == other.folders);
} else
return false;
}
boolean shouldRun() {
return (synchronize && (folders > 0 || operations > 0));
}
}