mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-29 22:03:55 +01:00
* Inserted missing spaces between `if` and `(` to improve code style, in line with GSG 4.6.2
This commit is contained in:
parent
0cf2299e49
commit
7b7d17a33b
69 changed files with 126 additions and 126 deletions
|
|
@ -244,9 +244,9 @@ public class ApacheHttpClientMediaWikiApi implements MediaWikiApi {
|
|||
Timber.d("Central auth token isn't valid. Trying to fetch a fresh token");
|
||||
api.removeAllCookies();
|
||||
String loginResultCode = login(AccountUtil.getUserName(context), AccountUtil.getPassword(context));
|
||||
if(loginResultCode.equals("PASS")) {
|
||||
if (loginResultCode.equals("PASS")) {
|
||||
return getCentralAuthToken();
|
||||
} else if(loginResultCode.equals("2FA")) {
|
||||
} else if (loginResultCode.equals("2FA")) {
|
||||
Timber.e("Cannot refresh session for 2FA enabled user. Login required");
|
||||
} else {
|
||||
Timber.e("Error occurred in refreshing session. Error code is %s", loginResultCode);
|
||||
|
|
|
|||
|
|
@ -117,4 +117,4 @@ public class CustomApiResult {
|
|||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ public class CustomMwApi {
|
|||
}
|
||||
|
||||
public String getAuthCookie() {
|
||||
if(authCookie == null){
|
||||
if (authCookie == null){
|
||||
authCookie = "";
|
||||
List<Cookie> cookies = client.getCookieStore().getCookies();
|
||||
for(Cookie cookie: cookies) {
|
||||
|
|
@ -102,14 +102,14 @@ public class CustomMwApi {
|
|||
}
|
||||
|
||||
public String getUserID() throws IOException {
|
||||
if(this.userID == null || this.userID.equals("0")) {
|
||||
if (this.userID == null || this.userID.equals("0")) {
|
||||
this.validateLogin();
|
||||
}
|
||||
return userID;
|
||||
}
|
||||
|
||||
public String getUserName() throws IOException {
|
||||
if(this.userID == null || this.userID.equals("0")) {
|
||||
if (this.userID == null || this.userID.equals("0")) {
|
||||
this.validateLogin();
|
||||
}
|
||||
return userName;
|
||||
|
|
@ -122,7 +122,7 @@ public class CustomMwApi {
|
|||
String token = tokenData.getString("/api/login/@token");
|
||||
CustomApiResult confirmData = this.action("login").param("lgname", username).param("lgpassword", password).param("lgtoken", token).post();
|
||||
String finalResult = confirmData.getString("/api/login/@result");
|
||||
if(finalResult.equals("Success")) {
|
||||
if (finalResult.equals("Success")) {
|
||||
isLoggedIn = true;
|
||||
}
|
||||
return finalResult;
|
||||
|
|
@ -149,7 +149,7 @@ public class CustomMwApi {
|
|||
.data("comment", comment)
|
||||
.data("filename", filename)
|
||||
.sendProgressListener(uploadProgressListener);
|
||||
if(length != -1) {
|
||||
if (length != -1) {
|
||||
builder.file("file", filename, file, length);
|
||||
} else {
|
||||
builder.file("file", filename, file);
|
||||
|
|
@ -177,4 +177,4 @@ public class CustomMwApi {
|
|||
return CustomApiResult.fromRequestBuilder(builder, client);
|
||||
}
|
||||
}
|
||||
;
|
||||
;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue