Process UID command option

pull/194/merge
M66B 3 years ago
parent e819451416
commit 5a6ace9c4c

@ -1413,7 +1413,8 @@ public class IMAPFolder extends Folder implements UIDFolder, ResponseHandler {
try {
IMAPProtocol p = getProtocol();
if (p.hasCapability("X-UIDONLY") ||
(eu.faircode.email.BuildConfig.DEBUG && p.hasCapability("UIDPLUS"))) {
(p.hasCapability("UIDPLUS") &&
Boolean.parseBoolean(System.getProperty("fairemail.uid_command")))) {
// Verizon
FetchProfile fp = new FetchProfile();
fp.add(UIDFolder.FetchProfileItem.UID);
@ -2107,7 +2108,8 @@ public class IMAPFolder extends Folder implements UIDFolder, ResponseHandler {
try {
IMAPProtocol p = getProtocol();
if (p.hasCapability("X-UIDONLY") ||
(eu.faircode.email.BuildConfig.DEBUG && p.hasCapability("UIDPLUS"))) {
(p.hasCapability("UIDPLUS") &&
Boolean.parseBoolean(System.getProperty("fairemail.uid_command")))) {
// Verizon
FetchProfile fp = new FetchProfile();
fp.add(UIDFolder.FetchProfileItem.UID);

@ -1113,7 +1113,8 @@ public class IMAPMessage extends MimeMessage implements ReadableMime {
checkExpunged(); // Insure that this message is not expunged
if (p.hasCapability("X-UIDONLY") ||
"imap.mail.yahoo.co.jp".equals(p.getInetAddress().getHostName()) ||
(eu.faircode.email.BuildConfig.DEBUG && p.hasCapability("UIDPLUS"))) {
(p.hasCapability("UIDPLUS") &&
Boolean.parseBoolean(System.getProperty("fairemail.uid_command")))) {
// Verizon
// Yahoo: NO [CANNOT] STORE It's not possible to perform specified operation
long uid = getUID();

@ -897,6 +897,8 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("uid_command", checked).apply();
System.setProperty("fairemail.uid_command", Boolean.toString(checked));
ServiceSynchronize.reload(compoundButton.getContext(), null, true, "uid_command");
}
});
@ -913,7 +915,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("uid_expunge", checked).apply();
ServiceSynchronize.reload(compoundButton.getContext(), null, true, "perform_expunge");
ServiceSynchronize.reload(compoundButton.getContext(), null, true, "uid_expunge");
}
});

@ -236,6 +236,10 @@ public class MessageHelper {
System.setProperty("mail.mime.contentdisposition.strict", "false"); // default true
//System.setProperty("mail.imap.parse.debug", "true");
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
boolean uid_command = prefs.getBoolean("uid_command", false);
System.setProperty("fairemail.uid_command", Boolean.toString(uid_command));
}
static Properties getSessionProperties() {

Loading…
Cancel
Save