mirror of
https://github.com/M66B/FairEmail.git
synced 2026-03-28 20:06:29 +01:00
OAuth/POP3: set max messages
This commit is contained in:
@@ -759,6 +759,7 @@ public class FragmentOAuth extends FragmentBase {
|
||||
Log.i("OAuth passed provider=" + provider.id);
|
||||
|
||||
EntityAccount update = null;
|
||||
int protocol = (pop ? EntityAccount.TYPE_POP : EntityAccount.TYPE_IMAP);
|
||||
DB db = DB.getInstance(context);
|
||||
try {
|
||||
db.beginTransaction();
|
||||
@@ -766,7 +767,7 @@ public class FragmentOAuth extends FragmentBase {
|
||||
if (args.getBoolean("update")) {
|
||||
List<EntityAccount> accounts =
|
||||
db.account().getAccounts(username,
|
||||
pop ? EntityAccount.TYPE_POP : EntityAccount.TYPE_IMAP,
|
||||
protocol,
|
||||
new int[]{AUTH_TYPE_OAUTH, AUTH_TYPE_PASSWORD});
|
||||
if (accounts != null && accounts.size() == 1)
|
||||
update = accounts.get(0);
|
||||
@@ -778,7 +779,7 @@ public class FragmentOAuth extends FragmentBase {
|
||||
// Create account
|
||||
EntityAccount account = new EntityAccount();
|
||||
|
||||
account.protocol = (pop ? EntityAccount.TYPE_POP : EntityAccount.TYPE_IMAP);
|
||||
account.protocol = protocol;
|
||||
account.host = inbound.host;
|
||||
account.encryption = aencryption;
|
||||
account.port = inbound.port;
|
||||
@@ -800,6 +801,9 @@ public class FragmentOAuth extends FragmentBase {
|
||||
|
||||
account.partial_fetch = provider.partial;
|
||||
|
||||
if (pop)
|
||||
account.max_messages = EntityAccount.DEFAULT_MAX_MESSAGES;
|
||||
|
||||
account.created = new Date().getTime();
|
||||
account.last_connected = account.created;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user