mirror of
https://github.com/ArcaneChat/android.git
synced 2026-07-03 14:05:24 +02:00
hide IMAP folder options on chatmail (#3050)
* remove unused getConfig() variants * hide IMAP folder options if is_chatmail == 1 * hide e2ee, show-system-contacts as well * ignore system-contacts settings on chatmail (in case it was enabled before)
This commit is contained in:
@@ -136,8 +136,6 @@ public class DcContext {
|
||||
public native boolean setConfigFromQr (String qr);
|
||||
public native String getConfig (String key);
|
||||
public int getConfigInt (String key) { try{return Integer.parseInt(getConfig(key));} catch(Exception e) {} return 0; }
|
||||
@Deprecated public String getConfig (String key, String def) { return getConfig(key); }
|
||||
@Deprecated public int getConfigInt (String key, int def) { return getConfigInt(key); }
|
||||
public native String getInfo ();
|
||||
public native int getConnectivity ();
|
||||
public native String getConnectivityHtml ();
|
||||
@@ -232,6 +230,10 @@ public class DcContext {
|
||||
return ret.trim();
|
||||
}
|
||||
|
||||
public boolean isChatmail() {
|
||||
return getConfigInt("is_chatmail") == 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return true if at least one chat has location streaming enabled
|
||||
*/
|
||||
|
||||
@@ -116,7 +116,7 @@ public class ContactSelectionListFragment extends Fragment
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
this.getLoaderManager().initLoader(0, null, this);
|
||||
if (dcContext.getConfigInt("ui.android.show_system_contacts") != 0) {
|
||||
if (dcContext.getConfigInt("ui.android.show_system_contacts") != 0 && !dcContext.isChatmail()) {
|
||||
Permissions.with(this)
|
||||
.request(Manifest.permission.READ_CONTACTS)
|
||||
.ifNecessary()
|
||||
|
||||
@@ -207,6 +207,15 @@ public class AdvancedPreferenceFragment extends ListSummaryPreferenceFragment
|
||||
}
|
||||
return true;
|
||||
}));
|
||||
|
||||
if (dcContext.isChatmail()) {
|
||||
preferE2eeCheckbox.setVisible(false);
|
||||
showSystemContacts.setVisible(false);
|
||||
sentboxWatchCheckbox.setVisible(false);
|
||||
bccSelfCheckbox.setVisible(false);
|
||||
mvboxMoveCheckbox.setVisible(false);
|
||||
onlyFetchMvboxCheckbox.setVisible(false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user