mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-27 19:52:17 -05:00
Astyle
This commit is contained in:
parent
4e48366243
commit
7cbbd72fac
@ -684,7 +684,7 @@ public class Account implements BaseAccount {
|
|||||||
successful = true;
|
successful = true;
|
||||||
} catch (MessagingException e) {
|
} catch (MessagingException e) {
|
||||||
Log.e(K9.LOG_TAG, "Switching local storage provider from " +
|
Log.e(K9.LOG_TAG, "Switching local storage provider from " +
|
||||||
mLocalStorageProviderId + " to " + id + " failed.", e);
|
mLocalStorageProviderId + " to " + id + " failed.", e);
|
||||||
} finally {
|
} finally {
|
||||||
// if migration to/from SD-card failed once, it will fail again.
|
// if migration to/from SD-card failed once, it will fail again.
|
||||||
if (!successful) {
|
if (!successful) {
|
||||||
|
@ -2021,23 +2021,23 @@ public class LocalStore extends Store implements Serializable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void destroyMessages(final Message[] messages) throws MessagingException {
|
public void destroyMessages(final Message[] messages) throws MessagingException {
|
||||||
try {
|
try {
|
||||||
database.execute(true, new DbCallback<Void>() {
|
database.execute(true, new DbCallback<Void>() {
|
||||||
@Override
|
@Override
|
||||||
public Void doDbWork(final SQLiteDatabase db) throws WrappedException, UnavailableStorageException {
|
public Void doDbWork(final SQLiteDatabase db) throws WrappedException, UnavailableStorageException {
|
||||||
for (Message message : messages) {
|
for (Message message : messages) {
|
||||||
try {
|
try {
|
||||||
message.destroy();
|
message.destroy();
|
||||||
} catch (MessagingException e) {
|
} catch (MessagingException e) {
|
||||||
throw new WrappedException(e);
|
throw new WrappedException(e);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
});
|
return null;
|
||||||
} catch (MessagingException e) {
|
}
|
||||||
throw new WrappedException(e);
|
});
|
||||||
}
|
} catch (MessagingException e) {
|
||||||
|
throw new WrappedException(e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -539,8 +539,7 @@ public class WebDavStore extends Store {
|
|||||||
info.requiredAuthType = AUTH_TYPE_BASIC;
|
info.requiredAuthType = AUTH_TYPE_BASIC;
|
||||||
} else if ((info.statusCode >= 200 && info.statusCode < 300) || // Success
|
} else if ((info.statusCode >= 200 && info.statusCode < 300) || // Success
|
||||||
(info.statusCode >= 300 && info.statusCode < 400) || // Redirect
|
(info.statusCode >= 300 && info.statusCode < 400) || // Redirect
|
||||||
(info.statusCode == 440)) // Unauthorized
|
(info.statusCode == 440)) { // Unauthorized
|
||||||
{
|
|
||||||
// We will handle all 3 situations the same. First we take an educated
|
// We will handle all 3 situations the same. First we take an educated
|
||||||
// guess at where the authorization DLL is located. If this is this
|
// guess at where the authorization DLL is located. If this is this
|
||||||
// doesn't work, then we'll use the redirection URL for OWA login given
|
// doesn't work, then we'll use the redirection URL for OWA login given
|
||||||
@ -666,7 +665,7 @@ public class WebDavStore extends Store {
|
|||||||
request = new HttpGeneric(loginUrl);
|
request = new HttpGeneric(loginUrl);
|
||||||
request.setMethod("POST");
|
request.setMethod("POST");
|
||||||
request.setEntity(formEntity);
|
request.setEntity(formEntity);
|
||||||
|
|
||||||
response = httpClient.executeOverride(request, mContext);
|
response = httpClient.executeOverride(request, mContext);
|
||||||
authenticated = testAuthenticationResponse(response);
|
authenticated = testAuthenticationResponse(response);
|
||||||
} catch (URISyntaxException e) {
|
} catch (URISyntaxException e) {
|
||||||
@ -720,8 +719,8 @@ public class WebDavStore extends Store {
|
|||||||
|
|
||||||
return formAction;
|
return formAction;
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean testAuthenticationResponse(HttpResponse response)
|
private boolean testAuthenticationResponse(HttpResponse response)
|
||||||
throws MessagingException {
|
throws MessagingException {
|
||||||
boolean authenticated = false;
|
boolean authenticated = false;
|
||||||
int statusCode = response.getStatusLine().getStatusCode();
|
int statusCode = response.getStatusLine().getStatusCode();
|
||||||
@ -743,14 +742,14 @@ public class WebDavStore extends Store {
|
|||||||
try {
|
try {
|
||||||
String thisPath = new URI(mUrl).getPath();
|
String thisPath = new URI(mUrl).getPath();
|
||||||
String redirectPath = new URI(info.redirectUrl).getPath();
|
String redirectPath = new URI(info.redirectUrl).getPath();
|
||||||
|
|
||||||
if (!thisPath.endsWith("/")) {
|
if (!thisPath.endsWith("/")) {
|
||||||
thisPath = thisPath.concat("/");
|
thisPath = thisPath.concat("/");
|
||||||
}
|
}
|
||||||
if (!redirectPath.endsWith("/")) {
|
if (!redirectPath.endsWith("/")) {
|
||||||
redirectPath = redirectPath.concat("/");
|
redirectPath = redirectPath.concat("/");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (redirectPath.equalsIgnoreCase(thisPath)) {
|
if (redirectPath.equalsIgnoreCase(thisPath)) {
|
||||||
authenticated = true;
|
authenticated = true;
|
||||||
} else {
|
} else {
|
||||||
@ -769,7 +768,7 @@ public class WebDavStore extends Store {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return authenticated;
|
return authenticated;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ public class MessageCryptoView extends LinearLayout {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void hide () {
|
public void hide() {
|
||||||
this.setVisibility(View.GONE);
|
this.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user