fix(news): stop IHAVE when duplicate lookup fails (#89)
Some checks failed
CI / build (push) Has been cancelled
deploy / deploy (push) Has been cancelled
test / test (push) Has been cancelled

Co-authored-by: SabFabDev <SabFabDev@users.noreply.github.com>
This commit is contained in:
SabFabDev 2026-07-12 09:43:24 +02:00 committed by GitHub
parent c2a06f1cdf
commit 21630c2d17
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 49 additions and 4 deletions

View file

@ -88,7 +88,6 @@ type Server struct {
// ErrLog, when non-nil, receives connection-level errors. Protocol verbs
// are never logged (a public server should not log every command).
ErrLog *log.Logger
group *nntp.Group
}
// NewServer builds a server bound to a backend.
@ -371,6 +370,9 @@ func handleIHave(args []string, s *session, c *textproto.Conn) error {
return ErrSyntax
}
article, err := s.backend.GetArticle(nil, args[0])
if err != nil && err != ErrInvalidMessageID && err != ErrInvalidArticleNumber {
return err
}
if article != nil {
return ErrNotWanted
}