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

Needed for r326 Issue 91

This commit is contained in:
Daniel Applebaum 2009-01-24 18:54:47 +00:00
parent e1da49109f
commit b6e9910e00

View File

@ -998,9 +998,11 @@ public class ImapStore extends Store {
EOLConvertingOutputStream eolOut = new EOLConvertingOutputStream(out);
message.writeTo(eolOut);
eolOut.flush();
mConnection.sendCommand(
String.format("APPEND \"%s\" {%d}",
String.format("APPEND \"%s\" (%s) {%d}",
encodeFolderName(getPrefixedName()),
combineFlags(message.getFlags()),
out.getCount()), false);
ImapResponse response;
do {
@ -1028,6 +1030,8 @@ public class ImapStore extends Store {
{
message.setUid(newUid);
}
}
}
catch (IOException ioe) {
@ -1086,11 +1090,8 @@ public class ImapStore extends Store {
return null;
}
@Override
public void setFlags(Flag[] flags, boolean value)
throws MessagingException {
checkOpen();
private String combineFlags(Flag[] flags)
{
ArrayList<String> flagNames = new ArrayList<String>();
for (int i = 0, count = flags.length; i < count; i++) {
Flag flag = flags[i];
@ -1108,10 +1109,19 @@ public class ImapStore extends Store {
}
}
return Utility.combine(flagNames.toArray(new String[flagNames.size()]), ' ');
}
@Override
public void setFlags(Flag[] flags, boolean value)
throws MessagingException {
checkOpen();
try {
mConnection.executeSimpleCommand(String.format("UID STORE 1:* %sFLAGS.SILENT (%s)",
value ? "+" : "-",
Utility.combine(flagNames.toArray(new String[flagNames.size()]), ' ')));
value ? "+" : "-", combineFlags(flags) ));
}
catch (IOException ioe) {
throw ioExceptionHandler(mConnection, ioe);