diff options
-rw-r--r-- | xmpp.scm | 14 |
1 files changed, 6 insertions, 8 deletions
@@ -124,14 +124,12 @@ handlers." (define (stanza-find-property property-name stanza) - "Return the given property of a stanza or #f if there is none." - (let ((properties (cadr stanza))) - (if (equal? '@ (car properties)) - (let ((res (find (lambda (prop) (eq? property-name (car prop))) - (cdr properties)))) - (if res - (cadr res) - #f))))) + "Return the value of a given stanza property or #f if there is +none." + (let ((property ((sxpath `(* @ ,property-name)) stanza))) + (if (null? property) + #f + (cadar property)))) ;; generate accessor functions for various stanza attributes (for-each |