1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-08-13 17:03:48 -04:00

Fix usage of 'advanced' exchange settings.

This commit is contained in:
Jesse Vincent 2010-12-16 02:52:13 +00:00
parent 78bc6e07f8
commit 6a9ec14f33

View File

@ -197,18 +197,7 @@ public class WebDavStore extends Store
if (pathParts[0] != null && if (pathParts[0] != null &&
pathParts[0].length() > 1) pathParts[0].length() > 1)
{ {
if (!pathParts[0].substring(1).equals("")) mPath = pathParts[0];
{
mPath = pathParts[0].substring(1);
}
else
{
mPath = "";
}
}
else
{
mPath = "";
} }
} }
else if (i == 1) else if (i == 1)
@ -216,7 +205,7 @@ public class WebDavStore extends Store
if (pathParts[1] != null && if (pathParts[1] != null &&
pathParts[1].length() > 1) pathParts[1].length() > 1)
{ {
mAuthPath = "/" + pathParts[1]; mAuthPath = pathParts[1];
} }
} }
else if (i == 2) else if (i == 2)
@ -224,36 +213,42 @@ public class WebDavStore extends Store
if (pathParts[2] != null && if (pathParts[2] != null &&
pathParts[2].length() > 1) pathParts[2].length() > 1)
{ {
mMailboxPath = "/" + pathParts[2]; mMailboxPath = pathParts[2];
if (mPath == null ||
mPath.equals(""))
{
mPath = mMailboxPath;
}
} }
} }
} }
if (!this.mPath.equals("") && if (mPath == null || mPath.equals(""))
this.mPath.startsWith("/")) {
mPath = "/Exchange";
}
else if (!mPath.startsWith("/"))
{ {
mPath = "/" + mPath; mPath = "/" + mPath;
} }
if (this.mMailboxPath == null || if (mMailboxPath == null || mMailboxPath.equals(""))
this.mMailboxPath.equals(""))
{ {
this.mMailboxPath = "/Exchange/" + this.mAlias; mMailboxPath = "/" + mAlias;
} }
else if (!this.mMailboxPath.startsWith("/")) else if (!mMailboxPath.startsWith("/"))
{ {
mMailboxPath = "/" + mMailboxPath; mMailboxPath = "/" + mMailboxPath;
} }
this.mUrl = getRoot() + mPath + mMailboxPath; if (mAuthPath != null &&
!mAuthPath.equals("") &&
!mAuthPath.startsWith("/"))
{
mAuthPath = "/" + mAuthPath;
}
this.mSecure = mConnectionSecurity == CONNECTION_SECURITY_SSL_REQUIRED; // The URL typically looks like the following: "https://mail.domain.com/Exchange/alias".
this.mAuthString = "Basic " + Utility.base64Encode(mUsername + ":" + mPassword); // The inbox path would look like: "https://mail.domain.com/Exchange/alias/Inbox".
mUrl = getRoot() + mPath + mMailboxPath;
mSecure = mConnectionSecurity == CONNECTION_SECURITY_SSL_REQUIRED;
mAuthString = "Basic " + Utility.base64Encode(mUsername + ":" + mPassword);
} }
private String getRoot() private String getRoot()