diff --git a/lib/nntp/tiny/session.py b/lib/nntp/tiny/session.py index 017d780..f3d7f19 100644 --- a/lib/nntp/tiny/session.py +++ b/lib/nntp/tiny/session.py @@ -536,7 +536,7 @@ class Session(): return self.end() - def _each_message_by_id(self, identifier: str): + def _each_message_by_id(self, identifier: str, success: ResponseCode=ResponseCode.NNTP_INFORMATION_FOLLOWS): if identifier is None: if self.newsgroup is None: self.respond(ResponseCode.NNTP_NEWSGROUP_NOT_SELECTED) @@ -552,7 +552,7 @@ class Session(): self.respond(ResponseCode.NNTP_ARTICLE_INVALID_NUMBER) return - self.respond(ResponseCode.NNTP_INFORMATION_FOLLOWS) + self.respond(success) yield message elif identifier[0] == '<': @@ -564,7 +564,7 @@ class Session(): self.respond(ResponseCode.NNTP_ARTICLE_NOT_FOUND_ID) return - self.respond(ResponseCode.NNTP_INFORMATION_FOLLOWS) + self.respond(success) yield message else: @@ -584,7 +584,7 @@ class Session(): for message in cr.each(): if first: first = False - self.respond(ResponseCode.NNTP_INFORMATION_FOLLOWS) + self.respond(success) yield message @@ -690,7 +690,7 @@ class Session(): ]) def _cmd_over(self, identifier: Optional[str]=None): - for message in self._each_message_by_id(identifier): + for message in self._each_message_by_id(identifier, ResponseCode.NNTP_OVERVIEW_FOLLOWS): overview = self._message_overview(message) self.print('\t'.join(overview))