Prepare for syncing other mailinglists.

This commit is contained in:
Dominik Pantůček 2023-11-16 18:11:51 +01:00
parent 28fa8e45a9
commit fbe3f02128
2 changed files with 15 additions and 10 deletions

View file

@ -226,7 +226,7 @@
#f)) #f))
;; Load ML(s) and merge them ;; Load ML(s) and merge them
(define-values (MB1 internal-ml) (define-values (MB1 internal-ml MLS)
(if MB0 (if MB0
(let () (let ()
(define mls (load-mailman-lists)) (define mls (load-mailman-lists))
@ -234,8 +234,9 @@
(mbase-merge-mailman mb ml)) (mbase-merge-mailman mb ml))
MB0 MB0
mls) mls)
(find-mailman-list mls "internal"))) (find-mailman-list mls "internal")
(values #f #f))) MLS))
(values #f #f #f)))
;; Load DokuWiki users ;; Load DokuWiki users
(define MB (if MB1 (define MB (if MB1
@ -371,9 +372,10 @@
(newline) (newline)
(print-unpaired-table MB)) (print-unpaired-table MB))
((mlsync) ((mlsync)
(if (-normal-month-) (cond ((-normal-month-)
(mailman-sync-members internal-ml (mbase-active-emails MB #:suspended #t)) (mailman-sync-members internal-ml (mbase-active-emails MB #:suspended #t)))
(print "Mailman synchronization disabled with manually specified current month."))) (else
(print "Mailman synchronization disabled with manually specified current month."))))
((notify) ((notify)
(let ((nmembers (members-to-notify MB (-notify-months-)))) (let ((nmembers (members-to-notify MB (-notify-months-))))
(newline) (newline)

View file

@ -262,6 +262,7 @@
;; alphabetically ;; alphabetically
(define* (mbase-active-emails mb (define* (mbase-active-emails mb
#:active (active #t) #:active (active #t)
#:pred? (pred? #f)
#:suspended (suspended #f)) #:suspended (suspended #f))
(sort (sort
(filter (filter
@ -272,10 +273,12 @@
(bdict-filter-values (bdict-filter-values
(mbase-members mb) (mbase-members mb)
(lambda (id mr) (lambda (id mr)
(or (and active (and (or (not pred?)
(brmember-active? mr)) (pred? mr))
(and suspended (or (and active
(brmember-suspended? mr))))))) (brmember-active? mr))
(and suspended
(brmember-suspended? mr))))))))
string-ci<?)) string-ci<?))
;; Merges given ML members into members base ;; Merges given ML members into members base