mirror of https://github.com/M66B/FairEmail.git
Removed dependency on UIDPLUS
Support for UIDPLUS has appeared to be unreliable
This commit is contained in:
parent
cc0f9766cc
commit
978f35c883
|
@ -18,7 +18,6 @@ import android.text.TextUtils;
|
|||
|
||||
import com.sun.mail.iap.ConnectionException;
|
||||
import com.sun.mail.iap.Response;
|
||||
import com.sun.mail.imap.AppendUID;
|
||||
import com.sun.mail.imap.IMAPFolder;
|
||||
import com.sun.mail.imap.IMAPMessage;
|
||||
import com.sun.mail.imap.IMAPStore;
|
||||
|
@ -680,12 +679,6 @@ class Core {
|
|||
}
|
||||
|
||||
private static long append(IMAPStore istore, IMAPFolder ifolder, MimeMessage imessage) throws MessagingException {
|
||||
if (istore.hasCapability("UIDPLUS")) {
|
||||
AppendUID[] uids = ifolder.appendUIDMessages(new Message[]{imessage});
|
||||
if (uids == null || uids.length == 0)
|
||||
throw new MessageRemovedException("Message not appended");
|
||||
return uids[0].uid;
|
||||
} else {
|
||||
ifolder.appendMessages(new Message[]{imessage});
|
||||
|
||||
long uid = -1;
|
||||
|
@ -706,7 +699,6 @@ class Core {
|
|||
|
||||
return uid;
|
||||
}
|
||||
}
|
||||
|
||||
static void onSynchronizeFolders(Context context, EntityAccount account, Store istore, State state) throws MessagingException {
|
||||
DB db = DB.getInstance(context);
|
||||
|
|
|
@ -119,7 +119,6 @@ public class FragmentAccount extends FragmentBase {
|
|||
private ContentLoadingProgressBar pbCheck;
|
||||
private TextView tvIdle;
|
||||
private TextView tvMove;
|
||||
private TextView tvUidPlus;
|
||||
private TextView tvUtf8;
|
||||
|
||||
private ArrayAdapter<EntityFolder> adapter;
|
||||
|
@ -198,7 +197,6 @@ public class FragmentAccount extends FragmentBase {
|
|||
|
||||
tvIdle = view.findViewById(R.id.tvIdle);
|
||||
tvMove = view.findViewById(R.id.tvMove);
|
||||
tvUidPlus = view.findViewById(R.id.tvUidPlus);
|
||||
tvUtf8 = view.findViewById(R.id.tvUtf8);
|
||||
|
||||
spDrafts = view.findViewById(R.id.spDrafts);
|
||||
|
@ -238,7 +236,6 @@ public class FragmentAccount extends FragmentBase {
|
|||
btnCheck.setVisibility(position > 0 ? View.VISIBLE : View.GONE);
|
||||
tvIdle.setVisibility(View.GONE);
|
||||
tvMove.setVisibility(View.GONE);
|
||||
tvUidPlus.setVisibility(View.GONE);
|
||||
tvUtf8.setVisibility(View.GONE);
|
||||
|
||||
Object tag = adapterView.getTag();
|
||||
|
@ -444,7 +441,6 @@ public class FragmentAccount extends FragmentBase {
|
|||
|
||||
tvIdle.setVisibility(View.GONE);
|
||||
tvMove.setVisibility(View.GONE);
|
||||
tvUidPlus.setVisibility(View.GONE);
|
||||
tvUtf8.setVisibility(View.GONE);
|
||||
|
||||
btnCheck.setVisibility(View.GONE);
|
||||
|
@ -523,7 +519,6 @@ public class FragmentAccount extends FragmentBase {
|
|||
pbCheck.setVisibility(View.VISIBLE);
|
||||
tvIdle.setVisibility(View.GONE);
|
||||
tvMove.setVisibility(View.GONE);
|
||||
tvUidPlus.setVisibility(View.GONE);
|
||||
tvUtf8.setVisibility(View.GONE);
|
||||
grpFolders.setVisibility(View.GONE);
|
||||
tvError.setVisibility(View.GONE);
|
||||
|
@ -584,7 +579,6 @@ public class FragmentAccount extends FragmentBase {
|
|||
|
||||
result.idle = ((IMAPStore) istore).hasCapability("IDLE");
|
||||
result.move = ((IMAPStore) istore).hasCapability("MOVE");
|
||||
result.uidplus = ((IMAPStore) istore).hasCapability("UIDPLUS");
|
||||
|
||||
boolean inbox = false;
|
||||
boolean archive = false;
|
||||
|
@ -685,7 +679,6 @@ public class FragmentAccount extends FragmentBase {
|
|||
protected void onExecuted(Bundle args, CheckResult result) {
|
||||
tvIdle.setVisibility(result.idle ? View.GONE : View.VISIBLE);
|
||||
tvMove.setVisibility(result.move ? View.GONE : View.VISIBLE);
|
||||
tvUidPlus.setVisibility(result.uidplus ? View.GONE : View.VISIBLE);
|
||||
tvUtf8.setVisibility(result.utf8 == null || result.utf8 ? View.GONE : View.VISIBLE);
|
||||
|
||||
setFolders(result.folders, result.account);
|
||||
|
@ -1455,7 +1448,6 @@ public class FragmentAccount extends FragmentBase {
|
|||
List<EntityFolder> folders;
|
||||
boolean idle;
|
||||
boolean move;
|
||||
boolean uidplus;
|
||||
Boolean utf8;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -604,8 +604,7 @@ public class ServiceSynchronize extends LifecycleService {
|
|||
}
|
||||
|
||||
final boolean capIdle = ((IMAPStore) istore).hasCapability("IDLE");
|
||||
final boolean capUidPlus = ((IMAPStore) istore).hasCapability("UIDPLUS");
|
||||
Log.i(account.name + " idle=" + capIdle + " uidplus=" + capUidPlus);
|
||||
Log.i(account.name + " idle=" + capIdle);
|
||||
|
||||
db.account().setAccountState(account.id, "connected");
|
||||
EntityLog.log(this, account.name + " connected");
|
||||
|
|
|
@ -466,17 +466,6 @@
|
|||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvIdle" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvUidPlus"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12dp"
|
||||
android:text="@string/title_no_uidplus"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Small"
|
||||
android:textStyle="italic"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvMove" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvUtf8"
|
||||
android:layout_width="wrap_content"
|
||||
|
@ -486,7 +475,7 @@
|
|||
android:textAppearance="@style/TextAppearance.AppCompat.Small"
|
||||
android:textStyle="italic"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvUidPlus" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvMove" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvDrafts"
|
||||
|
|
|
@ -256,7 +256,6 @@
|
|||
<string name="title_no_primary_drafts">No primary account or no drafts folder</string>
|
||||
<string name="title_no_idle">This provider does not support push messages. This will delay reception of new messages and increase battery usage.</string>
|
||||
<string name="title_no_move">This provider does not support MOVE</string>
|
||||
<string name="title_no_uidplus">This provider does not support UIDPLUS</string>
|
||||
<string name="title_no_utf8">This provider does not support UTF-8</string>
|
||||
<string name="title_no_sync">Synchronization errors since %1$s</string>
|
||||
<string name="title_sync_errors">Synchronizing some folders failed</string>
|
||||
|
|
Loading…
Reference in New Issue