Archived
1
0
This commit is contained in:
Jeff 2019-01-28 13:39:03 -05:00
parent 1a18d20a1a
commit 31b6f814d4
2 changed files with 18 additions and 16 deletions

View File

@ -903,21 +903,21 @@ func (self *NNTPDaemon) processMessage(msgid string) {
if self.expire != nil {
// expire posts
log.Println("expire", group, "for", rollover, "threads")
self.expire.ExpireGroup(group, rollover)
go self.expire.ExpireGroup(group, rollover)
}
// send to mod panel
if group == "ctl" {
log.Println("process mod message", msgid)
self.mod.HandleMessage(msgid)
go self.mod.HandleMessage(msgid)
}
// inform callback hooks
go self.informHooks(group, msgid, ref)
// federate
self.sendAllFeeds(ArticleEntry{msgid, group})
go self.sendAllFeeds(ArticleEntry{msgid, group})
// send to frontend
if self.frontend != nil {
if self.frontend.AllowNewsgroup(group) {
self.frontend.HandleNewPost(frontendPost{msgid, ref, group})
go self.frontend.HandleNewPost(frontendPost{msgid, ref, group})
}
}
}

View File

@ -125,7 +125,7 @@ func (lc *liveChan) SendBanned() {
msg, _ := json.Marshal(map[string]string{
"Type": "ban",
// TODO: real ban message
"Reason": "your an faget, your IP was: " + lc.IP,
"Reason": "your an fagt, your IP was: " + lc.IP,
})
if lc.datachnl != nil {
lc.datachnl <- msg
@ -324,10 +324,10 @@ func (self *httpFrontend) poll_liveui() {
th := threads[c-idx-1]
th.Update(self.daemon.database)
// send root post
live.Inform(th.OP())
go live.Inform(th.OP())
// send replies
for _, post := range th.Replies() {
live.Inform(post)
go live.Inform(post)
}
}
}
@ -392,6 +392,7 @@ func (self *httpFrontend) HandleNewPost(nntp frontendPost) {
if len(ref) > 0 {
msgid = ref
}
go func() {
entry := ArticleEntry{msgid, group}
// regnerate thread
self.Regen(entry)
@ -401,6 +402,7 @@ func (self *httpFrontend) HandleNewPost(nntp frontendPost) {
}
// regen front page
self.RegenFrontPage()
}()
}
// create a new captcha, return as json object