diff options
author | Liliana Marie Prikler <liliana.prikler@gmail.com> | 2023-10-09 21:21:29 +0200 |
---|---|---|
committer | Liliana Marie Prikler <liliana.prikler@gmail.com> | 2023-10-09 21:21:29 +0200 |
commit | 24fee2615ce7a18a7fcd6054b73375a890556cf3 (patch) | |
tree | 353f9e87b8ec736f32eed840c58dc7d5651c19cf /gnu/services/telephony.scm | |
parent | 7d134b57b79188f8c878625d4e09f9bd6181e8c0 (diff) | |
parent | 7937c8827b8d23347a3159b4696335bd19fc17aa (diff) | |
download | guix-24fee2615ce7a18a7fcd6054b73375a890556cf3.tar guix-24fee2615ce7a18a7fcd6054b73375a890556cf3.tar.gz |
Merge branch 'master' into gnome-team
Diffstat (limited to 'gnu/services/telephony.scm')
-rw-r--r-- | gnu/services/telephony.scm | 49 |
1 files changed, 21 insertions, 28 deletions
diff --git a/gnu/services/telephony.scm b/gnu/services/telephony.scm index 23ccb8d403..c9b5d6cd99 100644 --- a/gnu/services/telephony.scm +++ b/gnu/services/telephony.scm @@ -37,6 +37,7 @@ #:use-module (srfi srfi-1) #:use-module (srfi srfi-2) #:use-module (srfi srfi-26) + #:use-module (srfi srfi-171) #:use-module (ice-9 format) #:use-module (ice-9 match) #:export (jami-account @@ -116,15 +117,10 @@ (or (string? val) (computed-file? val))) -(define (string-list? val) - (and (list? val) - (and-map string? val))) +(define account-fingerprint-list? + (list-of account-fingerprint?)) -(define (account-fingerprint-list? val) - (and (list? val) - (and-map account-fingerprint? val))) - -(define-maybe string-list) +(define-maybe list-of-strings) (define-maybe/no-serialization account-fingerprint-list) @@ -134,7 +130,7 @@ ;;; The following serializers are used to derive an account details alist from ;;; a <jami-account> record. -(define (serialize-string-list _ val) +(define (serialize-list-of-strings _ val) (string-join val ";")) (define (serialize-boolean _ val) @@ -187,7 +183,7 @@ maintain communication between devices on such network even when the connection to the the Internet has been lost. When left unspecified, the value from the account archive prevails.") (bootstrap-hostnames - maybe-string-list + maybe-list-of-strings "A list of hostnames or IPs pointing to OpenDHT nodes, that should be used to initially join the OpenDHT network. When left unspecified, the value from the account archive prevails.") @@ -204,26 +200,23 @@ SET-ACCOUNT-DETAILS." ('rendezvous-point? "Account.rendezVous") ('peer-discovery? "Account.peerDiscovery") ('bootstrap-hostnames "Account.hostname") - ('name-server-uri "RingNS.uri") - (_ #f))) + ('name-server-uri "RingNS.uri"))) - (filter-map (lambda (field) - (and-let* ((name (field-name->account-detail + (define jami-account-transducer + (compose (tremove empty-serializer?) + (tfilter-maybe-value jami-account-object) + (tmap (lambda (field) + (let* ((name (field-name->account-detail (configuration-field-name field))) - (value ((configuration-field-serializer field) - name ((configuration-field-getter field) - jami-account-object))) - ;; The define-maybe default serializer produces an - ;; empty string for unspecified values. - (value* (if (string-null? value) - #f - value))) - (cons name value*))) - jami-account-fields)) - -(define (jami-account-list? val) - (and (list? val) - (and-map jami-account? val))) + (value ((configuration-field-serializer field) + name ((configuration-field-getter field) + jami-account-object)))) + (cons name value)))))) + + (list-transduce jami-account-transducer rcons jami-account-fields)) + +(define jami-account-list? + (list-of jami-account?)) (define-maybe/no-serialization jami-account-list) |