aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/app/list/utils.go')
-rw-r--r--pkg/app/list/utils.go18
1 files changed, 0 insertions, 18 deletions
diff --git a/pkg/app/list/utils.go b/pkg/app/list/utils.go
index 07dbc65..8a9e964 100644
--- a/pkg/app/list/utils.go
+++ b/pkg/app/list/utils.go
@@ -3,9 +3,7 @@
package list
import (
- "archives/pkg/database"
"archives/pkg/models"
- "github.com/go-pg/pg/v10/orm"
"html/template"
"net/http"
)
@@ -119,19 +117,3 @@ func makeRange(min, max int) []int {
}
return a
}
-
-func countMessages(listName string) (int, error) {
- return database.DBCon.Model((*models.Message)(nil)).
- WhereGroup(func(q *orm.Query) (*orm.Query, error) {
- q = q.WhereOr(`(headers::jsonb->>'Subject')::jsonb->>0 LIKE '[` + listName + `]%'`).
- WhereOr(`(headers::jsonb->>'Subject')::jsonb->>0 LIKE 'Re: [` + listName + `]%'`)
- return q, nil
- }).
- WhereGroup(func(q *orm.Query) (*orm.Query, error) {
- q = q.WhereOr(`headers::jsonb->>'To' LIKE '%` + listName + `@lists.gentoo.org%'`).
- WhereOr(`headers::jsonb->>'Cc' LIKE '%` + listName + `@lists.gentoo.org%'`).
- WhereOr(`headers::jsonb->>'To' LIKE '%` + listName + `@gentoo.org%'`).
- WhereOr(`headers::jsonb->>'Cc' LIKE '%` + listName + `@gentoo.org%'`)
- return q, nil
- }).Count()
-}