[Top][All Lists]

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

[elpa] externals/excorporate 166b417 72/93: Excorporate: Add an organize

From: Stefan Monnier
Subject: [elpa] externals/excorporate 166b417 72/93: Excorporate: Add an organizer resolver function
Date: Sun, 29 Nov 2020 15:43:12 -0500 (EST)

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

    Excorporate: Add an organizer resolver function
    * packages/excorporate/excorporate.el
    (exco-organizer-smtp-email-address): New function.
 excorporate.el | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/excorporate.el b/excorporate.el
index ec9f793..84c404c 100644
--- a/excorporate.el
+++ b/excorporate.el
@@ -861,6 +861,38 @@ argument ICALENDAR-TEXT."
                                                  mime-path response)))
+;; The organizer email is in the server's internal "EX" format.
+;; Resolve it synchronously, for simplicity.
+(defun exco-organizer-smtp-email-address (identifier organizer-structure)
+  "Return the organizer's SMTP email address as a string.
+IDENTIFIER is the connection identifier to use to resolve
+should be treated as opaque."
+  (let* ((wrapped (list (list organizer-structure)))
+        (routing-type
+         (exco-extract-value '(Organizer Mailbox RoutingType) wrapped))
+        (email-address
+         (exco-extract-value '(Organizer Mailbox EmailAddress) wrapped)))
+    (cond
+     ((equal routing-type "EX")
+      (exco-extract-value
+       '(ResponseMessages
+        ResolveNamesResponseMessage
+        ResolutionSet
+        Resolution
+        Mailbox
+        EmailAddress)
+       (with-timeout
+          (2 (progn
+               (message (concat "exco-organizer-smtp-email-address:"
+                                " Server did not respond in time"))
+               nil))
+        (exco-operate-synchronously identifier
+                                    "ResolveNames"
+                                    `(((UnresolvedEntry . ,email-address))
+                                      nil nil nil)))))
+     ((equal routing-type "SMTP") email-address))))
 (defmacro exco--calendar-item-dolist (item items &rest forms)
   "Iterate through ITEMS.
 On each iteration, ITEM is set, and FORMS are run."

reply via email to

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