Archived
1
0

Merge branch 'master' of ssh://github.com/majestrate/nntpchan

This commit is contained in:
Jeff Becker 2018-11-06 15:06:14 -05:00
commit 95448d82f0
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05

View File

@ -759,18 +759,23 @@ func (self *nntpConnection) handleLine(daemon *NNTPDaemon, code int, line string
} }
} }
} }
if ValidMessageID(msgid) && daemon.store.HasArticle(msgid) { if ValidMessageID(msgid) {
// we have it yeh if daemon.database.ArticleBanned(msgid) {
f, err := daemon.store.OpenMessage(msgid) // article banned
if err == nil { conn.PrintfLine("439 %s article banned from server", msgid)
conn.PrintfLine("220 %s", msgid) } else if daemon.store.HasArticle(msgid) {
dw := conn.DotWriter() // we have it yeh
_, err = io.Copy(dw, f) f, err := daemon.store.OpenMessage(msgid)
dw.Close() if err == nil {
f.Close() conn.PrintfLine("220 %s", msgid)
} else { dw := conn.DotWriter()
// wtf?! _, err = io.Copy(dw, f)
conn.PrintfLine("503 idkwtf happened: %s", err.Error()) dw.Close()
f.Close()
} else {
// wtf?!
conn.PrintfLine("503 idkwtf happened: %s", err.Error())
}
} }
} else { } else {
// we dont got it // we dont got it