mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-24 02:12:15 -05:00
changed parseFlags to directly manimpulate member
This commit is contained in:
parent
7c007d19fb
commit
474f32ad02
@ -923,7 +923,7 @@ public class ImapStore extends Store {
|
|||||||
if (flags != null) {
|
if (flags != null) {
|
||||||
// parse: * OK [PERMANENTFLAGS (\Answered \Flagged \Deleted
|
// parse: * OK [PERMANENTFLAGS (\Answered \Flagged \Deleted
|
||||||
// \Seen \Draft NonJunk $label1 \*)] Flags permitted.
|
// \Seen \Draft NonJunk $label1 \*)] Flags permitted.
|
||||||
parseFlags(flags, mPermanentFlagsIndex);
|
parseFlags(flags);
|
||||||
} else {
|
} else {
|
||||||
Object keyObj = bracketed.get(0);
|
Object keyObj = bracketed.get(0);
|
||||||
if (keyObj instanceof String) {
|
if (keyObj instanceof String) {
|
||||||
@ -953,26 +953,24 @@ public class ImapStore extends Store {
|
|||||||
/**
|
/**
|
||||||
* Parses an string like PERMANENTFLAGS (\Answered \Flagged \Deleted // \Seen \Draft NonJunk
|
* Parses an string like PERMANENTFLAGS (\Answered \Flagged \Deleted // \Seen \Draft NonJunk
|
||||||
* $label1 \*)
|
* $label1 \*)
|
||||||
|
*
|
||||||
|
* the parsed flags are stored in the mPermanentFlagsIndex
|
||||||
* @param flags
|
* @param flags
|
||||||
* the imapflags as strings
|
* the imapflags as strings
|
||||||
* @param out
|
|
||||||
* an already initialized Set which is used return the found flags
|
|
||||||
*/
|
*/
|
||||||
private void parseFlags(ImapList flags, Set<Flag> out) {
|
private void parseFlags(ImapList flags) {
|
||||||
for (Object flag : flags) {
|
for (Object flag : flags) {
|
||||||
flag = flag.toString().toLowerCase();
|
flag = flag.toString().toLowerCase();
|
||||||
if (flag.equals("permanentflags")) {
|
if (flag.equals("\\deleted")) {
|
||||||
continue;
|
mPermanentFlagsIndex.add(Flag.DELETED);
|
||||||
} else if (flag.equals("\\deleted")) {
|
|
||||||
out.add(Flag.DELETED);
|
|
||||||
} else if (flag.equals("\\answered")) {
|
} else if (flag.equals("\\answered")) {
|
||||||
out.add(Flag.ANSWERED);
|
mPermanentFlagsIndex.add(Flag.ANSWERED);
|
||||||
} else if (flag.equals("\\seen")) {
|
} else if (flag.equals("\\seen")) {
|
||||||
out.add(Flag.SEEN);
|
mPermanentFlagsIndex.add(Flag.SEEN);
|
||||||
} else if (flag.equals("\\flagged")) {
|
} else if (flag.equals("\\flagged")) {
|
||||||
out.add(Flag.FLAGGED);
|
mPermanentFlagsIndex.add(Flag.FLAGGED);
|
||||||
} else if (flag.equals("$forwarded")) {
|
} else if (flag.equals("$forwarded")) {
|
||||||
out.add(Flag.FORWARDED);
|
mPermanentFlagsIndex.add(Flag.FORWARDED);
|
||||||
} else if (flag.equals("\\*")) {
|
} else if (flag.equals("\\*")) {
|
||||||
mCanCreateKeywords = true;
|
mCanCreateKeywords = true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user