Apply the fix on click

This commit is contained in:
tom79 2019-06-11 17:48:30 +02:00
parent eaba8b6842
commit 1ddf409174
1 changed files with 4 additions and 3 deletions

View File

@ -1546,14 +1546,15 @@ public class API {
String accountID = sharedpreferences.getString(Helper.NEWS_ACCOUNT_ID+userId+instance, null); String accountID = sharedpreferences.getString(Helper.NEWS_ACCOUNT_ID+userId+instance, null);
if( accountID == null){ if( accountID == null){
HashMap<String, String> params2 = new HashMap<>();
try { try {
params.put("q", URLEncoder.encode("https://framapiaf.org/@fedilab", "UTF-8")); params2.put("q", URLEncoder.encode("https://framapiaf.org/@fedilab", "UTF-8"));
} catch (UnsupportedEncodingException e) { } catch (UnsupportedEncodingException e) {
params.put("q", "https://framapiaf.org/@fedilab"); params2.put("q", "https://framapiaf.org/@fedilab");
} }
HttpsConnection httpsConnection = new HttpsConnection(context, this.instance); HttpsConnection httpsConnection = new HttpsConnection(context, this.instance);
try { try {
String response = httpsConnection.get(getAbsoluteUrl("/search"), 60, params, prefKeyOauthTokenT); String response = httpsConnection.get(getAbsoluteUrl("/search"), 60, params2, prefKeyOauthTokenT);
Results res = parseResultsResponse(new JSONObject(response)); Results res = parseResultsResponse(new JSONObject(response));
if( res != null && res.getAccounts() != null && res.getAccounts().size() > 0 ){ if( res != null && res.getAccounts() != null && res.getAccounts().size() > 0 ){
accountID = res.getAccounts().get(0).getId(); accountID = res.getAccounts().get(0).getId();