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"?>
<resources>
<string name="build_number">118</string>
<string name="build_number">149M</string>
</resources>

View File

@ -55,11 +55,11 @@
-->
<providers>
<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" />
</provider>
<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" />
</provider>
<provider id="aol" label="AOL" domain="aol.com">

View File

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