1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-23 09:52:16 -05:00

Fixed prefix separator issues. Separators are now pulled from the separator column of folder listings. Also switched the default gmail IMAP server to imap.googlemail.com (from imap.gmail.com).

This commit is contained in:
Brock Tice 2008-12-03 04:14:39 +00:00
parent 351c825433
commit 9d45b3604e
3 changed files with 21 additions and 8 deletions

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<string name="build_number">118</string> <string name="build_number">149M</string>
</resources> </resources>

View File

@ -55,11 +55,11 @@
--> -->
<providers> <providers>
<provider id="gmail" label="Gmail" domain="gmail.com"> <provider id="gmail" label="Gmail" domain="gmail.com">
<incoming uri="imap+ssl+://imap.gmail.com" username="$email" /> <incoming uri="imap+ssl+://imap.googlemail.com" username="$email" />
<outgoing uri="smtp+ssl+://smtp.gmail.com" username="$email" /> <outgoing uri="smtp+ssl+://smtp.gmail.com" username="$email" />
</provider> </provider>
<provider id="google" label="Google" domain="google.com"> <provider id="google" label="Google" domain="google.com">
<incoming uri="imap+ssl+://imap.gmail.com" username="$email" /> <incoming uri="imap+ssl+://imap.googlemail.com" username="$email" />
<outgoing uri="smtp+ssl+://smtp.gmail.com" username="$email" /> <outgoing uri="smtp+ssl+://smtp.gmail.com" username="$email" />
</provider> </provider>
<provider id="aol" label="AOL" domain="aol.com"> <provider id="aol" label="AOL" domain="aol.com">

View File

@ -85,6 +85,7 @@ public class ImapStore extends Store {
private String mPassword; private String mPassword;
private int mConnectionSecurity; private int mConnectionSecurity;
private String mPathPrefix; private String mPathPrefix;
private String mPathDelimeter;
private LinkedList<ImapConnection> mConnections = private LinkedList<ImapConnection> mConnections =
new LinkedList<ImapConnection>(); new LinkedList<ImapConnection>();
@ -188,7 +189,9 @@ public class ImapStore extends Store {
if (response.get(0).equals("LIST")) { if (response.get(0).equals("LIST")) {
boolean includeFolder = true; boolean includeFolder = true;
String folder = decodeFolderName(response.getString(3)); String folder = decodeFolderName(response.getString(3));
if(mPathDelimeter == null){ mPathDelimeter = response.getString(2); }
if (folder.equalsIgnoreCase(k9.INBOX)) { if (folder.equalsIgnoreCase(k9.INBOX)) {
continue; continue;
}else{ }else{
@ -309,8 +312,9 @@ public class ImapStore extends Store {
public String getPrefixedName() { public String getPrefixedName() {
String prefixedName = ""; String prefixedName = "";
if(mPathPrefix.length() > 0 && !mName.equalsIgnoreCase(k9.INBOX)){ if(mPathPrefix.length() > 0 && !mName.equalsIgnoreCase(k9.INBOX)){
prefixedName += mPathPrefix + "."; prefixedName += mPathPrefix + mPathDelimeter;
} }
prefixedName += mName; prefixedName += mName;
return prefixedName; return prefixedName;
} }
@ -340,9 +344,18 @@ public class ImapStore extends Store {
// * OK [UIDNEXT 57576] Predicted next UID // * OK [UIDNEXT 57576] Predicted next UID
// 2 OK [READ-WRITE] Select completed. // 2 OK [READ-WRITE] Select completed.
try { try {
List<ImapResponse> responses = mConnection.executeSimpleCommand(
String.format("SELECT \"%s\"", if(mPathDelimeter == null){
encodeFolderName(getPrefixedName()))); List<ImapResponse> nameResponses =
mConnection.executeSimpleCommand(String.format("LIST \"\" \"*%s\"", encodeFolderName(mName)));
if(nameResponses.size() > 0){
mPathDelimeter = nameResponses.get(0).getString(2);
}
}
List<ImapResponse> responses = mConnection.executeSimpleCommand(
String.format("SELECT \"%s\"",
encodeFolderName(getPrefixedName())));
/* /*
* If the command succeeds we expect the folder has been opened read-write * If the command succeeds we expect the folder has been opened read-write
* unless we are notified otherwise in the responses. * unless we are notified otherwise in the responses.