Merge branch 'extended_and_tor'

* extended_and_tor:
  Allow extended settings and tor in any build flavour
This commit is contained in:
Stephen Paul Weber 2022-04-06 14:34:44 -05:00
commit 2f818afee8
No known key found for this signature in database
GPG Key ID: D11C2911CE519CDE
5 changed files with 7 additions and 7 deletions

View File

@ -428,7 +428,7 @@ public class MemorizingTrustManager {
private List<String> getPoshFingerprintsFromServer(String domain, String url, int maxTtl, boolean followUrl) {
Log.d(Config.LOGTAG, "downloading json for " + domain + " from " + url);
final SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(master);
final boolean useTor = QuickConversationsService.isConversations() && preferences.getBoolean("use_tor", master.getResources().getBoolean(R.bool.use_tor));
final boolean useTor = preferences.getBoolean("use_tor", master.getResources().getBoolean(R.bool.use_tor));
try {
final List<String> results = new ArrayList<>();
final InputStream inputStream = HttpConnectionManager.open(url, useTor);

View File

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

View File

@ -736,8 +736,8 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat
}
}
SharedPreferences preferences = getPreferences();
mUseTor = QuickConversationsService.isConversations() && preferences.getBoolean("use_tor", getResources().getBoolean(R.bool.use_tor));
this.mShowOptions = mUseTor || (QuickConversationsService.isConversations() && preferences.getBoolean("show_connection_options", getResources().getBoolean(R.bool.show_connection_options)));
mUseTor = preferences.getBoolean("use_tor", getResources().getBoolean(R.bool.use_tor));
this.mShowOptions = mUseTor || preferences.getBoolean("show_connection_options", getResources().getBoolean(R.bool.show_connection_options));
this.binding.namePort.setVisibility(mShowOptions ? View.VISIBLE : View.GONE);
if (mForceRegister != null) {
this.binding.accountRegisterNew.setVisibility(View.GONE);

View File

@ -97,7 +97,7 @@ public abstract class LocationActivity extends ActionBarActivity implements Loca
final IConfigurationProvider config = Configuration.getInstance();
config.load(ctx, getPreferences());
config.setUserAgentValue(BuildConfig.APPLICATION_ID + "/" + BuildConfig.VERSION_CODE);
if (QuickConversationsService.isConversations() && getBooleanPreference("use_tor", R.bool.use_tor)) {
if (getBooleanPreference("use_tor", R.bool.use_tor)) {
config.setHttpProxy(HttpConnectionManager.getProxy());
}
}

View File

@ -459,7 +459,7 @@ public abstract class XmppActivity extends ActionBarActivity {
}
private boolean useTor() {
return QuickConversationsService.isConversations() && getBooleanPreference("use_tor", R.bool.use_tor);
return getBooleanPreference("use_tor", R.bool.use_tor);
}
protected SharedPreferences getPreferences() {