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

Remove duplicated combine flags code

This commit is contained in:
Andrew Gaul 2011-09-29 20:39:36 -07:00 committed by Andrew Gaul
parent 451ffc97c4
commit ce4b42f66b

View File

@ -1741,23 +1741,11 @@ public class ImapStore extends Store {
for (int i = 0, count = messages.length; i < count; i++) {
uids[i] = messages[i].getUid();
}
ArrayList<String> flagNames = new ArrayList<String>();
for (Flag flag : flags) {
if (flag == Flag.SEEN) {
flagNames.add("\\Seen");
} else if (flag == Flag.DELETED) {
flagNames.add("\\Deleted");
} else if (flag == Flag.ANSWERED) {
flagNames.add("\\Answered");
} else if (flag == Flag.FLAGGED) {
flagNames.add("\\Flagged");
}
}
try {
executeSimpleCommand(String.format("UID STORE %s %sFLAGS.SILENT (%s)",
Utility.combine(uids, ','),
value ? "+" : "-",
Utility.combine(flagNames.toArray(new String[flagNames.size()]), ' ')));
combineFlags(flags)));
} catch (IOException ioe) {
throw ioExceptionHandler(mConnection, ioe);
}