]> code.delx.au - gnu-emacs-elpa/commitdiff
packages/excorporate: Improve exco-get-meetings-for-day
authorThomas Fitzsimmons <fitzsim@fitzsim.org>
Wed, 2 Mar 2016 04:59:11 +0000 (23:59 -0500)
committerThomas Fitzsimmons <fitzsim@fitzsim.org>
Wed, 16 Mar 2016 13:03:08 +0000 (09:03 -0400)
* packages/excorporate/excorporate.el (exco-get-meetings-for-day):
Add RequestVersion header to FindItem request.  Use
soap-operation-arity to calculate how many nil arguments to send.

packages/excorporate/excorporate.el

index 8168dd38b97950e77116e68c1ac29f17f0b2a250..6051fdd62cef9644d39eae9436db33468644f156 100644 (file)
@@ -708,7 +708,12 @@ arguments, IDENTIFIER and the server's response."
      identifier
      "FindItem"
      `(;; Main arguments.
-       ((Traversal . "Shallow")
+       (;; RequestVersion is usually overridden by a fixed value in
+       ;; the WSDL (the RequestServerVersion element); provide the
+       ;; maximally-compatible Exchange2007 if the fixed value isn't
+       ;; present.
+       (RequestVersion (Version . "Exchange2007"))
+       (Traversal . "Shallow")
        (ItemShape
         (BaseShape . "AllProperties"))
        ;; To aid productivity, excorporate-calfw automatically prunes your
@@ -719,16 +724,13 @@ arguments, IDENTIFIER and the server's response."
        (ParentFolderIds
         (DistinguishedFolderId (Id . "calendar"))))
        ;; Empty arguments.
-       ,@(let ((server-major-version
-               (string-to-number
-                (substring (exco-server-version identifier) 8 12))))
-          (cond
-           ((<= server-major-version 2007)
-            '(nil nil nil nil))
-           ((< server-major-version 2013)
-            '(nil nil nil nil nil))
-           (t
-            '(nil nil nil nil nil nil)))))
+       ,@(let* ((wsdl (exco--with-fsm identifier
+                                     (plist-get (fsm-get-state-data fsm)
+                                                :service-wsdl)))
+               (arity (soap-operation-arity wsdl
+                                           "ExchangeServicePort"
+                                           "FindItem")))
+          (make-list (- arity 1) nil)))
      callback)))
 
 (defun exco-connection-iterate (initialize-function