diff --git a/grendel/dog/mail/nntp/Newsgroup.java b/grendel/dog/mail/nntp/Newsgroup.java index 78a1afa7125..c8911675e3c 100644 --- a/grendel/dog/mail/nntp/Newsgroup.java +++ b/grendel/dog/mail/nntp/Newsgroup.java @@ -114,8 +114,8 @@ public class Newsgroup extends Folder { public void open(int mode) throws MessagingException { if (open) throw new MessagingException("Newsgroup is already open"); - if (mode!=READ_ONLY) - throw new MessagingException("Newsgroup is read-only"); + //if (mode!=READ_ONLY) + // throw new MessagingException("Newsgroup is read-only"); ((NNTPStore)store).open(this); open = true; notifyConnectionListeners(ConnectionEvent.OPENED); @@ -174,18 +174,18 @@ public class Newsgroup extends Folder { if (!open) throw new MessagingException("Newsgroup is not open"); NNTPStore s = (NNTPStore)store; - if (articles==null) + //if (articles==null) articles = s.getArticles(this); - else { // check for new articles - Article[] nm = s.getNewArticles(this, checkpoint); - if (nm.length>0) { - Article[] m2 = new Article[articles.length+nm.length]; - System.arraycopy(articles, 0, m2, 0, articles.length); - System.arraycopy(nm, 0, m2, articles.length, nm.length); - articles = m2; - } - } - checkpoint = new Date(); + //else { // check for new articles + // Article[] nm = s.getNewArticles(this, checkpoint); + // if (nm.length>0) { + // Article[] m2 = new Article[articles.length+nm.length]; + // System.arraycopy(articles, 0, m2, 0, articles.length); + // System.arraycopy(nm, 0, m2, articles.length, nm.length); + // articles = m2; + // } + //} + //checkpoint = new Date(); return articles; } diff --git a/grendel/storage/MessageExtraWrapper.java b/grendel/storage/MessageExtraWrapper.java index 06b2e8ba316..7c215ae4c6e 100644 --- a/grendel/storage/MessageExtraWrapper.java +++ b/grendel/storage/MessageExtraWrapper.java @@ -257,13 +257,17 @@ class MessageExtraWrapper implements MessageExtra { buf.append(Constants.BYTEBUFLINEBREAK); } buf.append(Constants.BYTEBUFLINEBREAK); + + ByteBuf buf2 = new ByteBuf(); try { - return new SequenceInputStream(buf.makeInputStream(), - m.getInputStream()); + buf2.append(m.getContent()); } catch (IOException ee) { throw new MessagingException("I/O error", ee); } + return new SequenceInputStream(buf.makeInputStream(), + buf2.makeInputStream()); + } }