[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/excorporate ff4e272 74/93: Excorporate: Simplify organi

From: Stefan Monnier
Subject: [elpa] externals/excorporate ff4e272 74/93: Excorporate: Simplify organizer handling in Org backend
Date: Sun, 29 Nov 2020 15:43:12 -0500 (EST)

branch: externals/excorporate
commit ff4e2720b1bd2379f7c33fb139743416fc8d894b
Author: Thomas Fitzsimmons <fitzsim@fitzsim.org>
Commit: Thomas Fitzsimmons <fitzsim@fitzsim.org>

    Excorporate: Simplify organizer handling in Org backend
    * packages/excorporate/excorporate-org.el
    (exco-org-insert-meeting): Use simpler organizer argument.
    (exco-org-insert-meetings): Simplify organizer argument.
    (exco-org-insert-meeting-headline): Adjust item-identifier
 excorporate-org.el | 47 ++++++++++++++++-------------------------------
 1 file changed, 16 insertions(+), 31 deletions(-)

diff --git a/excorporate-org.el b/excorporate-org.el
index 25b7986..a03ebff 100644
--- a/excorporate-org.el
+++ b/excorporate-org.el
@@ -180,8 +180,8 @@ operated on."
   "Insert and schedule a meeting.
 SUBJECT is the meeting's subject, START-TIME and END-TIME are the
 meeting's start and end times in the same format as is returned
-by `current-time'.  ITEM-IDENTIFIER is the item identifier in the
-form (ItemId (Id . ID-STRING) (ChangeKey . CHANGEKEY-STRING))."
+by `current-time'.  ITEM-IDENTIFIER is the opaque item
   (let* ((now (current-time))
         (keyword (if (time-less-p now end-time)
@@ -219,43 +219,26 @@ form (ItemId (Id . ID-STRING) (ChangeKey . 
 (defun exco-org-insert-meeting (subject start end location
                                main-invitees optional-invitees
-                               &optional item-identifier organizer identifier)
+                               &optional item-identifier organizer)
   "Insert a scheduled meeting.
 SUBJECT is a string, the subject of the meeting.  START is the
 meeting start time in Emacs internal date time format, and END is
 the end of the meeting in the same format.  LOCATION is a string
 representing the location.  MAIN-INVITEES and OPTIONAL-INVITEES
-are the requested participants.  ITEM-IDENTIFIER is the item
-identifier in the form
-\(ItemId (Id . ID-STRING) (ChangeKey . CHANGEKEY-STRING)).
-ORGANIZER is a string containing the organizer of the meeting, in
-server-internal form.  IDENTIFIER is the connection identifier."
-  ;; The Organizer email is in the server's internal format.  Resolve
-  ;; it synchronously, for simplicity.
-  (let ((organizer-email-address
-        (exco-extract-value
-         '(ResponseMessages
-           ResolveNamesResponseMessage
-           ResolutionSet
-           Resolution
-           Mailbox
-           EmailAddress)
-         (with-timeout
-             (1 (error "Server did not respond in time"))
-           (exco-operate-synchronously
-            identifier "ResolveNames"
-            `(((UnresolvedEntry . ,organizer)) nil nil nil))))))
-    (exco-org-insert-meeting-headline subject start end item-identifier)
+are the requested participants.  ITEM-IDENTIFIER is the opaque
+item identifier.  ORGANIZER is a string, the email address of the
+meeting organizer."
+  (exco-org-insert-meeting-headline subject start end item-identifier)
     (insert (format "+ Duration: %d minutes\n"
                    (round (/ (float-time (time-subtract end start)) 60.0))))
     (insert (format "+ Location: %s\n" location))
-    (insert (format "+ Organizer: %s\n" organizer-email-address))
+    (insert (format "+ Organizer: %s\n" organizer))
     (when main-invitees
       (insert "+ Invitees:\n")
       (exco-org-insert-invitees main-invitees))
     (when optional-invitees
       (insert "+ Optional invitees:\n")
-      (exco-org-insert-invitees optional-invitees))))
+      (exco-org-insert-invitees optional-invitees)))
 (defun exco-org-insert-meetings (identifier response)
   "Insert the connection IDENTIFIER's meetings from RESPONSE."
@@ -271,12 +254,14 @@ server-internal form.  IDENTIFIER is the connection 
        response (lambda (&rest arguments)
                  (with-current-buffer (exco-org--identifier-buffer identifier)
-                   (apply #'exco-org-insert-meeting
-                          ;; Gross, but keeps exco-org-insert-meeting
-                          ;; signature backward compatible.
-                          (append arguments (list identifier)))))
+                   (let ((new-arguments arguments))
+                     (setf (nth 7 new-arguments)
+                           (exco-organizer-smtp-email-address
+                            identifier organizer-structure))
+                     (apply #'exco-org-insert-meeting new-arguments))))
        subject start-internal end-internal
-       location main-invitees optional-invitees item-identifier organizer)
+       location main-invitees optional-invitees item-identifier
+       organizer-structure)
       (goto-char (point-min))
       (if (save-excursion (org-goto-first-child))
          (org-sort-entries t ?s)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]