summaryrefslogtreecommitdiff
path: root/smsmatrix.scm
diff options
context:
space:
mode:
Diffstat (limited to 'smsmatrix.scm')
-rw-r--r--smsmatrix.scm15
1 files changed, 12 insertions, 3 deletions
diff --git a/smsmatrix.scm b/smsmatrix.scm
index fd68fff..77c2441 100644
--- a/smsmatrix.scm
+++ b/smsmatrix.scm
@@ -225,10 +225,11 @@
(error 'message-status
"Sanity check failed: message ID differs from the one requested!"
(alist-ref 'id res) message-id))
- (values (string->number (alist-ref 'response res)) ; May be omitted
+ (values (string->number (alist-ref 'response res eq? "")) ; May be omitted
(string->number (alist-ref 'timestamp res))
(alist-ref 'timezone res)
- status status-text))))
+ (string->number status)
+ status-text))))
;; Not really part of the "API" as such since it returns something completely
;; different than =-separated lists of key/value pairs and "email" vs "username"
@@ -264,6 +265,14 @@
(error-on-bad-result-code
'send-sms status status-text pin)))
res))
- res)))
+ (map (lambda (entry)
+ (map (lambda (key/value)
+ (let ((key (car key/value))
+ (value (cdr key/value)))
+ (case key
+ ((statuscode timestamp) (cons key (string->number value)))
+ (else key/value))))
+ entry)
+ res)))))
) \ No newline at end of file