X-Git-Url: https://git.r.bdr.sh/rbdr/mobius/blobdiff_plain/f3059b6aa517f9f8e204b2fa1913e2fdfccef570..32d7bb7e1d8c96f93c0d24884fe038c477c4df02:/hotline/transaction_handlers.go diff --git a/hotline/transaction_handlers.go b/hotline/transaction_handlers.go index 2d03b07..56f7afa 100644 --- a/hotline/transaction_handlers.go +++ b/hotline/transaction_handlers.go @@ -1034,14 +1034,14 @@ func HandleTranOldPostNews(cc *ClientConn, t *Transaction) (res []Transaction, e newsPost := fmt.Sprintf(newsTemplate+"\r", cc.UserName, time.Now().Format(newsDateTemplate), t.GetField(fieldData).Data) newsPost = strings.Replace(newsPost, "\n", "\r", -1) + // update news in memory + cc.Server.FlatNews = append([]byte(newsPost), cc.Server.FlatNews...) + // update news on disk if err := cc.Server.FS.WriteFile(filepath.Join(cc.Server.ConfigDir, "MessageBoard.txt"), cc.Server.FlatNews, 0644); err != nil { return res, err } - // update news in memory - cc.Server.FlatNews = append([]byte(newsPost), cc.Server.FlatNews...) - // Notify all clients of updated news cc.sendAll( tranNewMsg,