rename config name and meaning

This commit is contained in:
adbenitez
2024-12-04 13:55:02 +01:00
parent af91cf7413
commit ab5a9c9d60
@@ -85,7 +85,7 @@ public class DcContext {
public final static int DC_CONNECTIVITY_WORKING = 3000;
public final static int DC_CONNECTIVITY_CONNECTED = 4000;
private static final String CONFIG_NOTIFY_MENTIONS_IF_MUTED = "ui.notify_mentions_if_muted";
private static final String CONFIG_MUTE_MENTIONS_IF_MUTED = "ui.mute_mentions_if_muted";
// when using DcAccounts, use DcAccounts.addAccount() instead
public DcContext(String osName, String dbfile) {
@@ -136,8 +136,7 @@ public class DcContext {
public void setConfigInt (String key, int value) { setConfig(key, Integer.toString(value)); }
public native boolean setConfigFromQr (String qr);
public native String getConfig (String key);
public int getConfigInt (String key) { return getConfigInt(key, 0); }
public int getConfigInt (String key, int defaultValue) { try {return Integer.parseInt(getConfig(key));} catch(Exception e) {} return defaultValue; }
public int getConfigInt (String key) { try{return Integer.parseInt(getConfig(key));} catch(Exception e) {} return 0; }
public native String getInfo ();
public native int getConnectivity ();
public native String getConnectivityHtml ();
@@ -215,11 +214,11 @@ public class DcContext {
public DcProvider getProviderFromEmailWithDns (String email) { long cptr = getProviderFromEmailWithDnsCPtr(email); return cptr!=0 ? new DcProvider(cptr) : null; }
public boolean isMentionsEnabled() {
return getConfigInt(CONFIG_NOTIFY_MENTIONS_IF_MUTED, 1) == 1;
return getConfigInt(CONFIG_MUTE_MENTIONS_IF_MUTED) != 1;
}
public void setMentionsEnabled(boolean enabled) {
setConfigInt(CONFIG_NOTIFY_MENTIONS_IF_MUTED, enabled? 1 : 0);
setConfigInt(CONFIG_MUTE_MENTIONS_IF_MUTED, enabled? 0 : 1);
}
public String getName() {