mirror of https://github.com/M66B/FairEmail.git
Show when a provider does not support UTF-8
This commit is contained in:
parent
c557adb16d
commit
e59394a156
|
@ -63,6 +63,7 @@ import com.google.android.material.snackbar.Snackbar;
|
|||
import com.google.android.material.textfield.TextInputLayout;
|
||||
import com.sun.mail.imap.IMAPFolder;
|
||||
import com.sun.mail.imap.IMAPStore;
|
||||
import com.sun.mail.imap.protocol.IMAPProtocol;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.UnknownHostException;
|
||||
|
@ -119,6 +120,7 @@ public class FragmentAccount extends FragmentBase {
|
|||
private TextView tvIdle;
|
||||
private TextView tvMove;
|
||||
private TextView tvUidPlus;
|
||||
private TextView tvUtf8;
|
||||
|
||||
private ArrayAdapter<EntityFolder> adapter;
|
||||
private Spinner spDrafts;
|
||||
|
@ -197,6 +199,7 @@ 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);
|
||||
spSent = view.findViewById(R.id.spSent);
|
||||
|
@ -520,6 +523,7 @@ public class FragmentAccount extends FragmentBase {
|
|||
tvIdle.setVisibility(View.GONE);
|
||||
tvMove.setVisibility(View.GONE);
|
||||
tvUidPlus.setVisibility(View.GONE);
|
||||
tvUtf8.setVisibility(View.GONE);
|
||||
grpFolders.setVisibility(View.GONE);
|
||||
tvError.setVisibility(View.GONE);
|
||||
}
|
||||
|
@ -643,6 +647,14 @@ public class FragmentAccount extends FragmentBase {
|
|||
junk = true;
|
||||
}
|
||||
|
||||
if (EntityFolder.INBOX.equals(type))
|
||||
result.utf8 = (Boolean) ((IMAPFolder) ifolder).doCommand(new IMAPFolder.ProtocolCommand() {
|
||||
@Override
|
||||
public Object doCommand(IMAPProtocol protocol) {
|
||||
return protocol.supportsUtf8();
|
||||
}
|
||||
});
|
||||
|
||||
Log.i(folder.name + " id=" + folder.id +
|
||||
" type=" + folder.type + " attr=" + TextUtils.join(",", attrs));
|
||||
}
|
||||
|
@ -678,6 +690,7 @@ public class FragmentAccount extends FragmentBase {
|
|||
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);
|
||||
|
||||
|
@ -1459,5 +1472,6 @@ public class FragmentAccount extends FragmentBase {
|
|||
boolean idle;
|
||||
boolean move;
|
||||
boolean uidplus;
|
||||
Boolean utf8;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -486,6 +486,17 @@
|
|||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvMove" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvUtf8"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12dp"
|
||||
android:text="@string/title_no_utf8"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Small"
|
||||
android:textStyle="italic"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvUidPlus" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvDrafts"
|
||||
android:layout_width="wrap_content"
|
||||
|
@ -572,7 +583,7 @@
|
|||
android:layout_marginTop="12dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/barrier_folders"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvUidPlus" />
|
||||
app:layout_constraintTop_toBottomOf="@id/tvUtf8" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvDraftsRemark"
|
||||
|
|
|
@ -253,6 +253,7 @@
|
|||
<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_disabled">Synchronization is disabled</string>
|
||||
<string name="title_drafts_required">A drafts folder is required to send messages</string>
|
||||
|
|
Loading…
Reference in New Issue