|
|
@ -909,25 +909,18 @@ public class FragmentFolders extends FragmentBase {
|
|
|
|
Message imessage = MessageHelper.from(context, message, null, isession, false);
|
|
|
|
Message imessage = MessageHelper.from(context, message, null, isession, false);
|
|
|
|
imessage.writeTo(new FilterOutputStream(out) {
|
|
|
|
imessage.writeTo(new FilterOutputStream(out) {
|
|
|
|
private boolean cr = false;
|
|
|
|
private boolean cr = false;
|
|
|
|
private boolean lf = false;
|
|
|
|
|
|
|
|
private ByteArrayOutputStream buffer = new ByteArrayOutputStream(998);
|
|
|
|
private ByteArrayOutputStream buffer = new ByteArrayOutputStream(998);
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void write(int b) throws IOException {
|
|
|
|
public void write(int b) throws IOException {
|
|
|
|
if (b == 13 /* CR */) {
|
|
|
|
if (b == 13 /* CR */) {
|
|
|
|
if (cr || lf)
|
|
|
|
if (cr) // another
|
|
|
|
line();
|
|
|
|
line();
|
|
|
|
cr = true;
|
|
|
|
cr = true;
|
|
|
|
} else if (b == 10 /* LF */) {
|
|
|
|
} else if (b == 10 /* LF */) {
|
|
|
|
if (cr)
|
|
|
|
|
|
|
|
line();
|
|
|
|
line();
|
|
|
|
else if (lf) {
|
|
|
|
|
|
|
|
line();
|
|
|
|
|
|
|
|
lf = true;
|
|
|
|
|
|
|
|
} else
|
|
|
|
|
|
|
|
lf = true;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
if (cr || lf)
|
|
|
|
if (cr) // dangling
|
|
|
|
line();
|
|
|
|
line();
|
|
|
|
buffer.write(b);
|
|
|
|
buffer.write(b);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -935,7 +928,7 @@ public class FragmentFolders extends FragmentBase {
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void flush() throws IOException {
|
|
|
|
public void flush() throws IOException {
|
|
|
|
if (buffer.size() > 0 || cr || lf)
|
|
|
|
if (buffer.size() > 0 || cr /* dangling */)
|
|
|
|
line();
|
|
|
|
line();
|
|
|
|
out.write(10);
|
|
|
|
out.write(10);
|
|
|
|
super.flush();
|
|
|
|
super.flush();
|
|
|
@ -964,7 +957,6 @@ public class FragmentFolders extends FragmentBase {
|
|
|
|
|
|
|
|
|
|
|
|
buffer.reset();
|
|
|
|
buffer.reset();
|
|
|
|
cr = false;
|
|
|
|
cr = false;
|
|
|
|
lf = false;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|