summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xmpp.scm14
1 files changed, 6 insertions, 8 deletions
diff --git a/xmpp.scm b/xmpp.scm
index bade3c1..936013f 100644
--- a/xmpp.scm
+++ b/xmpp.scm
@@ -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