Fix behaviour when NEWGROUPS finds no results
This commit is contained in:
parent
a25c304e5b
commit
06471551c5
1 changed files with 9 additions and 4 deletions
|
@ -285,9 +285,7 @@ class Session(Connection):
|
|||
|
||||
return self.end()
|
||||
|
||||
def print_newsgroup_summary(self, newsgroup: Newsgroup, since: Optional[datetime.datetime]=None):
|
||||
summary = self._newsgroup_summary(newsgroup, since)
|
||||
|
||||
def print_newsgroup_summary(self, summary: dict):
|
||||
return self.print("%s %d %d %s" % (
|
||||
summary['name'],
|
||||
summary['min'],
|
||||
|
@ -330,7 +328,9 @@ class Session(Connection):
|
|||
self.respond(ResponseCode.NNTP_INFORMATION_FOLLOWS)
|
||||
|
||||
for newsgroup in self.each_newsgroup():
|
||||
self.print_newsgroup_summary(newsgroup)
|
||||
summary = self._newsgroup_summary(newsgroup)
|
||||
|
||||
self.print_newsgroup_summary(summary)
|
||||
|
||||
return self.end()
|
||||
|
||||
|
@ -497,6 +497,11 @@ class Session(Connection):
|
|||
self.respond(ResponseCode.NNTP_GROUPS_NEW_FOLLOW)
|
||||
|
||||
for newsgroup in self.each_newsgroup():
|
||||
summary = self._newsgroup_summary(newsgroup, timestamp)
|
||||
|
||||
if summary['min'] is None:
|
||||
continue
|
||||
|
||||
self.print_newsgroup_summary(newsgroup, timestamp)
|
||||
|
||||
return self.end()
|
||||
|
|
Loading…
Add table
Reference in a new issue