From 8d6fdfbde7675824a6ba8b24644d08d23803c24a Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Sat, 9 Nov 2019 10:20:58 +0100 Subject: [PATCH] disable local server disco on Quicksy flavor --- .../siacs/conversations/ui/ChannelDiscoveryActivity.java | 4 ++++ .../java/eu/siacs/conversations/ui/SettingsActivity.java | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/main/java/eu/siacs/conversations/ui/ChannelDiscoveryActivity.java b/src/main/java/eu/siacs/conversations/ui/ChannelDiscoveryActivity.java index 5dfcf9bdc..567a2f3d6 100644 --- a/src/main/java/eu/siacs/conversations/ui/ChannelDiscoveryActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/ChannelDiscoveryActivity.java @@ -31,6 +31,7 @@ import eu.siacs.conversations.entities.Bookmark; import eu.siacs.conversations.entities.Conversation; import eu.siacs.conversations.entities.Room; import eu.siacs.conversations.services.ChannelDiscoveryService; +import eu.siacs.conversations.services.QuickConversationsService; import eu.siacs.conversations.ui.adapter.ChannelSearchResultAdapter; import eu.siacs.conversations.ui.util.PendingItem; import eu.siacs.conversations.ui.util.SoftKeyboardUtils; @@ -88,6 +89,9 @@ public class ChannelDiscoveryActivity extends XmppActivity implements MenuItem.O } private static ChannelDiscoveryService.Method getMethod(final Context c) { + if (QuickConversationsService.isQuicksy()) { + return ChannelDiscoveryService.Method.JABBER_NETWORK; + } final SharedPreferences p = PreferenceManager.getDefaultSharedPreferences(c); final String m = p.getString("channel_discovery_method", c.getString(R.string.default_channel_discovery)); try { diff --git a/src/main/java/eu/siacs/conversations/ui/SettingsActivity.java b/src/main/java/eu/siacs/conversations/ui/SettingsActivity.java index 99560801f..3d2b63d04 100644 --- a/src/main/java/eu/siacs/conversations/ui/SettingsActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/SettingsActivity.java @@ -92,11 +92,16 @@ public class SettingsActivity extends XmppActivity implements changeOmemoSettingSummary(); if (QuickConversationsService.isQuicksy()) { - PreferenceCategory connectionOptions = (PreferenceCategory) mSettingsFragment.findPreference("connection_options"); + final PreferenceCategory connectionOptions = (PreferenceCategory) mSettingsFragment.findPreference("connection_options"); + final PreferenceCategory groupChats = (PreferenceCategory) mSettingsFragment.findPreference("group_chats"); + final Preference channelDiscoveryMethod = mSettingsFragment.findPreference("channel_discovery_method"); PreferenceScreen expert = (PreferenceScreen) mSettingsFragment.findPreference("expert"); if (connectionOptions != null) { expert.removePreference(connectionOptions); } + if (groupChats != null && channelDiscoveryMethod != null) { + groupChats.removePreference(channelDiscoveryMethod); + } } PreferenceScreen mainPreferenceScreen = (PreferenceScreen) mSettingsFragment.findPreference("main_screen");