1 ;;; mumi -- Mediocre, uh, mail interface
2 ;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
4 ;;; This program is free software: you can redistribute it and/or
5 ;;; modify it under the terms of the GNU Affero General Public License
6 ;;; as published by the Free Software Foundation, either version 3 of
7 ;;; the License, or (at your option) any later version.
9 ;;; This program is distributed in the hope that it will be useful,
10 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 ;;; Affero General Public License for more details.
14 ;;; You should have received a copy of the GNU Affero General Public
15 ;;; License along with this program. If not, see
16 ;;; <http://www.gnu.org/licenses/>.
18 (define-module (mumi queries
)
19 #:use-module
(mumi config
)
21 #:use-module
(srfi srfi-1
)
22 #:use-module
(srfi srfi-26
)
26 (define-public (group s
)
27 (string-append "(" s
")"))
29 (define-syntax-rule (query-and e ...
)
30 (group (string-join (list e ...
) " ")))
32 (define-syntax-rule (query-or e ...
)
33 (group (string-join (list e ...
) " OR ")))
35 (define-public (msgid id
)
36 (string-append "msgid:" id
))
38 (define-public (messages-in-thread id
)
40 (mu:message-list
(msgid id
))
42 (member id
(mu:references msg
)))
43 (mu:message-list
(assoc-ref %config
'list
)))))