Peter Bex  committed 901a591

Map statuscode and timestamp to numbers, for convenience

  • Participants
  • Parent commits a014cd2
  • Branches default

Comments (0)

Files changed (1)

File smsmatrix.scm

         (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"
                        'send-sms status status-text pin)))
-      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)))))