do not offer tor or extended connection settings for quicksy

This commit is contained in:
Daniel Gultsch 2018-10-26 19:08:09 +02:00
parent 3b31133606
commit 4df0cc3657
8 changed files with 18 additions and 9 deletions

View File

@ -11,4 +11,8 @@ public class QuickConversationsService {
public static boolean isQuicksy() { public static boolean isQuicksy() {
return false; return false;
} }
public static boolean isFull() {
return true;
}
} }

View File

@ -47,7 +47,6 @@ public final class Config {
public static final boolean USE_RANDOM_RESOURCE_ON_EVERY_BIND = false; public static final boolean USE_RANDOM_RESOURCE_ON_EVERY_BIND = false;
public static final boolean ALLOW_NON_TLS_CONNECTIONS = false; //very dangerous. you should have a good reason to set this to true public static final boolean ALLOW_NON_TLS_CONNECTIONS = false; //very dangerous. you should have a good reason to set this to true
public static final boolean FORCE_ORBOT = false; // always use TOR
//Notification settings //Notification settings

View File

@ -3332,11 +3332,11 @@ public class XmppConnectionService extends Service {
} }
public boolean useTorToConnect() { public boolean useTorToConnect() {
return Config.FORCE_ORBOT || getBooleanPreference("use_tor", R.bool.use_tor); return QuickConversationsService.isFull() && getBooleanPreference("use_tor", R.bool.use_tor);
} }
public boolean showExtendedConnectionOptions() { public boolean showExtendedConnectionOptions() {
return getBooleanPreference("show_connection_options", R.bool.show_connection_options); return QuickConversationsService.isFull() && getBooleanPreference("show_connection_options", R.bool.show_connection_options);
} }
public boolean broadcastLastActivity() { public boolean broadcastLastActivity() {

View File

@ -623,8 +623,8 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat
} }
} }
SharedPreferences preferences = getPreferences(); SharedPreferences preferences = getPreferences();
mUseTor = Config.FORCE_ORBOT || preferences.getBoolean("use_tor", false); mUseTor = QuickConversationsService.isFull() && preferences.getBoolean("use_tor", getResources().getBoolean(R.bool.use_tor));
this.mShowOptions = mUseTor || preferences.getBoolean("show_connection_options", false); this.mShowOptions = mUseTor || (QuickConversationsService.isFull() && preferences.getBoolean("show_connection_options", getResources().getBoolean(R.bool.show_connection_options)));
this.binding.namePort.setVisibility(mShowOptions ? View.VISIBLE : View.GONE); this.binding.namePort.setVisibility(mShowOptions ? View.VISIBLE : View.GONE);
} }
@ -888,7 +888,7 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat
} }
final boolean editable = !mAccount.isOptionSet(Account.OPTION_LOGGED_IN_SUCCESSFULLY) && !QuickConversationsService.isQuicksy(); final boolean editable = !mAccount.isOptionSet(Account.OPTION_LOGGED_IN_SUCCESSFULLY) && QuickConversationsService.isFull();
this.binding.accountJid.setEnabled(editable); this.binding.accountJid.setEnabled(editable);
this.binding.accountJid.setFocusable(editable); this.binding.accountJid.setFocusable(editable);
this.binding.accountJid.setFocusableInTouchMode(editable); this.binding.accountJid.setFocusableInTouchMode(editable);

View File

@ -36,6 +36,7 @@ import eu.siacs.conversations.BuildConfig;
import eu.siacs.conversations.Config; import eu.siacs.conversations.Config;
import eu.siacs.conversations.R; import eu.siacs.conversations.R;
import eu.siacs.conversations.http.HttpConnectionManager; import eu.siacs.conversations.http.HttpConnectionManager;
import eu.siacs.conversations.services.QuickConversationsService;
import eu.siacs.conversations.ui.util.LocationHelper; import eu.siacs.conversations.ui.util.LocationHelper;
import eu.siacs.conversations.ui.widget.Marker; import eu.siacs.conversations.ui.widget.Marker;
import eu.siacs.conversations.ui.widget.MyLocation; import eu.siacs.conversations.ui.widget.MyLocation;
@ -103,7 +104,7 @@ public abstract class LocationActivity extends ActionBarActivity implements Loca
final IConfigurationProvider config = Configuration.getInstance(); final IConfigurationProvider config = Configuration.getInstance();
config.load(ctx, getPreferences()); config.load(ctx, getPreferences());
config.setUserAgentValue(BuildConfig.APPLICATION_ID + "_" + BuildConfig.VERSION_CODE); config.setUserAgentValue(BuildConfig.APPLICATION_ID + "_" + BuildConfig.VERSION_CODE);
if (Config.FORCE_ORBOT || getBooleanPreference("use_tor", R.bool.use_tor)) { if (QuickConversationsService.isFull() && getBooleanPreference("use_tor", R.bool.use_tor)) {
try { try {
config.setHttpProxy(HttpConnectionManager.getProxy()); config.setHttpProxy(HttpConnectionManager.getProxy());
} catch (IOException e) { } catch (IOException e) {

View File

@ -38,6 +38,7 @@ import eu.siacs.conversations.crypto.OmemoSetting;
import eu.siacs.conversations.entities.Account; import eu.siacs.conversations.entities.Account;
import eu.siacs.conversations.services.ExportLogsService; import eu.siacs.conversations.services.ExportLogsService;
import eu.siacs.conversations.services.MemorizingTrustManager; import eu.siacs.conversations.services.MemorizingTrustManager;
import eu.siacs.conversations.services.QuickConversationsService;
import eu.siacs.conversations.ui.util.StyledAttributes; import eu.siacs.conversations.ui.util.StyledAttributes;
import eu.siacs.conversations.utils.GeoHelper; import eu.siacs.conversations.utils.GeoHelper;
import eu.siacs.conversations.utils.TimeframeUtils; import eu.siacs.conversations.utils.TimeframeUtils;
@ -91,7 +92,7 @@ public class SettingsActivity extends XmppActivity implements
changeOmemoSettingSummary(); changeOmemoSettingSummary();
if (Config.FORCE_ORBOT) { if (QuickConversationsService.isQuicksy()) {
PreferenceCategory connectionOptions = (PreferenceCategory) mSettingsFragment.findPreference("connection_options"); PreferenceCategory connectionOptions = (PreferenceCategory) mSettingsFragment.findPreference("connection_options");
PreferenceScreen expert = (PreferenceScreen) mSettingsFragment.findPreference("expert"); PreferenceScreen expert = (PreferenceScreen) mSettingsFragment.findPreference("expert");
if (connectionOptions != null) { if (connectionOptions != null) {

View File

@ -296,7 +296,7 @@ public class StartConversationActivity extends XmppActivity implements XmppConne
final SharedPreferences preferences = getPreferences(); final SharedPreferences preferences = getPreferences();
this.mHideOfflineContacts = !QuickConversationsService.isQuicksy() && preferences.getBoolean("hide_offline", false); this.mHideOfflineContacts = QuickConversationsService.isFull() && preferences.getBoolean("hide_offline", false);
final boolean startSearching = preferences.getBoolean("start_searching",getResources().getBoolean(R.bool.start_searching)); final boolean startSearching = preferences.getBoolean("start_searching",getResources().getBoolean(R.bool.start_searching));

View File

@ -260,6 +260,10 @@ public class QuickConversationsService {
return true; return true;
} }
public static boolean isFull() {
return false;
}
public interface OnVerificationRequested { public interface OnVerificationRequested {
void onVerificationRequestFailed(int code); void onVerificationRequestFailed(int code);