mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 14:22:01 +00:00
Needed to get news working.
This commit is contained in:
parent
8ec4a2028c
commit
e72164fa47
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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());
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user