everywhere: add email notifications

This commit is contained in:
Adhityaa Chandrasekar
2019-02-18 11:23:44 -05:00
parent 69aba94590
commit 06f0f6f014
33 changed files with 872 additions and 30 deletions

View File

@@ -11,14 +11,14 @@ func pageGet(domain string, path string) (page, error) {
}
statement := `
SELECT isLocked, commentCount, stickyCommentHex
SELECT isLocked, commentCount, stickyCommentHex, title
FROM pages
WHERE domain=$1 AND path=$2;
`
row := db.QueryRow(statement, domain, path)
p := page{Domain: domain, Path: path}
if err := row.Scan(&p.IsLocked, &p.CommentCount, &p.StickyCommentHex); err != nil {
if err := row.Scan(&p.IsLocked, &p.CommentCount, &p.StickyCommentHex, &p.Title); err != nil {
if err == sql.ErrNoRows {
// If there haven't been any comments, there won't be a record for this
// page. The sane thing to do is return defaults.
@@ -26,6 +26,7 @@ func pageGet(domain string, path string) (page, error) {
p.IsLocked = false
p.CommentCount = 0
p.StickyCommentHex = "none"
p.Title = ""
} else {
logger.Errorf("error scanning page: %v", err)
return page{}, errorInternal