Commits

Peter Bex committed 901a591

Map statuscode and timestamp to numbers, for convenience

Comments (0)

Files changed (1)

         (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"
                       (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)))))
 
 )