1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-24 02:12:15 -05:00

Support non-English Exchange installations.

This commit is contained in:
wongk 2011-02-15 19:05:08 -05:00
parent 8a778a0222
commit 5c6e86006d

View File

@ -4,6 +4,7 @@ import android.util.Log;
import com.fsck.k9.Account; import com.fsck.k9.Account;
import com.fsck.k9.K9; import com.fsck.k9.K9;
import com.fsck.k9.R;
import com.fsck.k9.controller.MessageRetrievalListener; import com.fsck.k9.controller.MessageRetrievalListener;
import com.fsck.k9.helper.Utility; import com.fsck.k9.helper.Utility;
import com.fsck.k9.mail.*; import com.fsck.k9.mail.*;
@ -236,6 +237,8 @@ public class WebDavStore extends Store {
String[] folderUrls; String[] folderUrls;
int urlLength; int urlLength;
String translatedInbox = K9.app.getString(R.string.special_mailbox_name_inbox);
/** /**
* We have to check authentication here so we have the proper URL stored * We have to check authentication here so we have the proper URL stored
*/ */
@ -253,8 +256,13 @@ public class WebDavStore extends Store {
String fullPathName = ""; String fullPathName = "";
WebDavFolder wdFolder; WebDavFolder wdFolder;
if (folderName.equalsIgnoreCase(K9.INBOX)) { // Check each Exchange folder name to see if it is the user's inbox.
folderName = "INBOX"; // We will check for the default English inbox ("Inbox"), and the user's
// translation for "Inbox", in case the user is using a non-English
// version of Exchange.
if (folderName.equalsIgnoreCase("Inbox") ||
folderName.equalsIgnoreCase(translatedInbox)) {
folderName = K9.INBOX;
} else { } else {
for (int j = 5, count = urlParts.length; j < count; j++) { for (int j = 5, count = urlParts.length; j < count; j++) {
if (j != 5) { if (j != 5) {
@ -1031,15 +1039,7 @@ public class WebDavStore extends Store {
encodedName = encodedName.replaceAll("\\+", "%20"); encodedName = encodedName.replaceAll("\\+", "%20");
/** if (encodedName.equals(K9.INBOX)) {
* In some instances, it is possible that our folder objects have been collected, but
* getPersonalNamespaces() isn't called again (ex. Android destroys the email client). Perform an
* authentication to get the appropriate URLs in place again
*/
// TODO: danapple0 - huh?
// getHttpClient();
if (encodedName.equals("INBOX")) {
encodedName = "Inbox"; encodedName = "Inbox";
} }
this.mFolderUrl = WebDavStore.this.mUrl; this.mFolderUrl = WebDavStore.this.mUrl;