00001 #include "RNewsgroup.h"
00002
00003 void RNewsgroup::setsize(unsigned int f, unsigned int l)
00004 {
00005 if (f < _first || l < _last) {
00006 slog.p(Logger::Notice) << "watermark(s) decreased?!?\n";
00007 _OverviewDB.erase(_OverviewDB.begin(), _OverviewDB.end());
00008 _first = f;
00009 _last = l;
00010 _RemoteServer->overviewdb(this, f, l);
00011 } else {
00012 if (_first < f) {
00013 _OverviewDB.erase(_OverviewDB.begin(),
00014 _OverviewDB.lower_bound(f));
00015 }
00016 if (_last < l) {
00017 int old_last = _last;
00018 _first = f;
00019 _last = l;
00020 _RemoteServer->overviewdb(this, old_last + 1, l);
00021 }
00022 }
00023 }
00024
00025 void RNewsgroup::printarticle(ostream & os, unsigned int nbr)
00026 {
00027 try {
00028 Article article;
00029 _RemoteServer->article(_NewsgroupName, nbr, &article);
00030 os << article;
00031 } catch(...) {
00032 }
00033 }