aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart/messenger
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/de/pixart/messenger')
-rw-r--r--src/main/java/de/pixart/messenger/services/XmppConnectionService.java12
-rw-r--r--src/main/java/de/pixart/messenger/ui/SettingsActivity.java3
2 files changed, 8 insertions, 7 deletions
diff --git a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java
index 243b9b4f5..6aea5c8cf 100644
--- a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java
+++ b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java
@@ -685,7 +685,7 @@ public class XmppConnectionService extends Service {
sendReadMarker(c);
break;
case AudioManager.RINGER_MODE_CHANGED_ACTION:
- if (xaOnSilentMode()) {
+ if (dndOnSilentMode()) {
refreshAllPresences();
}
break;
@@ -870,8 +870,8 @@ public class XmppConnectionService extends Service {
}
}
- private boolean xaOnSilentMode() {
- return getPreferences().getBoolean("xa_on_silent_mode", false);
+ private boolean dndOnSilentMode() {
+ return getPreferences().getBoolean(SettingsActivity.DND_ON_SILENT_MODE, getResources().getBoolean(R.bool.dnd_on_silent_mode));
}
private boolean manuallyChangePresence() {
@@ -879,7 +879,7 @@ public class XmppConnectionService extends Service {
}
private boolean treatVibrateAsSilent() {
- return getPreferences().getBoolean(SettingsActivity.TREAT_VIBRATE_AS_SILENT, false);
+ return getPreferences().getBoolean(SettingsActivity.TREAT_VIBRATE_AS_SILENT, getResources().getBoolean(R.bool.treat_vibrate_as_silent));
}
private boolean awayWhenScreenOff() {
@@ -943,8 +943,8 @@ public class XmppConnectionService extends Service {
}
private Presence.Status getTargetPresence() {
- if (xaOnSilentMode() && isPhoneSilenced()) {
- return Presence.Status.XA;
+ if (dndOnSilentMode() && isPhoneSilenced()) {
+ return Presence.Status.DND;
} else if (awayWhenScreenOff() && !isInteractive()) {
return Presence.Status.AWAY;
} else {
diff --git a/src/main/java/de/pixart/messenger/ui/SettingsActivity.java b/src/main/java/de/pixart/messenger/ui/SettingsActivity.java
index feeec7c1c..9c92c8be5 100644
--- a/src/main/java/de/pixart/messenger/ui/SettingsActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/SettingsActivity.java
@@ -39,6 +39,7 @@ public class SettingsActivity extends XmppActivity implements
public static final String KEEP_FOREGROUND_SERVICE = "keep_foreground_service";
public static final String AWAY_WHEN_SCREEN_IS_OFF = "away_when_screen_off";
public static final String TREAT_VIBRATE_AS_SILENT = "treat_vibrate_as_silent";
+ public static final String DND_ON_SILENT_MODE = "dnd_on_silent_mode";
public static final String MANUALLY_CHANGE_PRESENCE = "manually_change_presence";
public static final String BLIND_TRUST_BEFORE_VERIFICATION = "btbv";
public static final String AUTOMATIC_MESSAGE_DELETION = "automatic_message_deletion";
@@ -238,7 +239,7 @@ public class SettingsActivity extends XmppActivity implements
public void onSharedPreferenceChanged(SharedPreferences preferences, String name) {
final List<String> resendPresence = Arrays.asList(
"confirm_messages",
- "xa_on_silent_mode",
+ DND_ON_SILENT_MODE,
AWAY_WHEN_SCREEN_IS_OFF,
"allow_message_correction",
TREAT_VIBRATE_AS_SILENT,