From 5b069f5245c883bc07020551174f8b0845d3a594 Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Wed, 20 Nov 2024 07:11:35 +0100 Subject: [PATCH] Seperate ring from strangers option --- .../xmpp/jingle/JingleConnectionManager.java | 5 +++-- src/main/res/values/strings.xml | 2 ++ src/main/res/xml/preferences_notifications.xml | 6 ++++++ src/monocleschat/res/drawable/ring_volume_24dp.xml | 10 ++++++++++ 4 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 src/monocleschat/res/drawable/ring_volume_24dp.xml diff --git a/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleConnectionManager.java b/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleConnectionManager.java index af0e984f3..3c5f4a4ff 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleConnectionManager.java +++ b/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleConnectionManager.java @@ -256,9 +256,10 @@ public class JingleConnectionManager extends AbstractConnectionManager { } private boolean isWithStrangerAndStrangerNotificationsAreOff(final Account account, Jid with) { - final var chatRequestsPref = mXmppConnectionService.getStringPreference("chat_requests", R.string.default_chat_requests); + final var ringFromStrangers = mXmppConnectionService.getBooleanPreference("ring_from_strangers", R.bool.notifications_from_strangers); + if (ringFromStrangers) return false; final var conversation = mXmppConnectionService.findOrCreateConversation(account, with, false, true); - return conversation.isChatRequest(chatRequestsPref); + return conversation.isWithStranger(); } ScheduledFuture schedule( diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml index dcfddefad..7c77e8b8c 100644 --- a/src/main/res/values/strings.xml +++ b/src/main/res/values/strings.xml @@ -1343,4 +1343,6 @@ Export data useful for importing into another app. Not a full backup. Your request has been sent to the moderators Full backups are meant for restore after a device loss, or for migrating to a new device. You cannot restore a backup to another app while still being connected with this one! + Ring calls from strangers + A stranger is someone not in your contacts to whom you have never sent a message \ No newline at end of file diff --git a/src/main/res/xml/preferences_notifications.xml b/src/main/res/xml/preferences_notifications.xml index 8088a8549..01d714ed0 100644 --- a/src/main/res/xml/preferences_notifications.xml +++ b/src/main/res/xml/preferences_notifications.xml @@ -74,6 +74,12 @@ android:key="chat_requests" android:title="@string/pref_chat_requests" app:useSimpleSummaryProvider="true" /> + + +