[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/excorporate 890266e 67/93: Excorporate: Support creatin
From: |
Stefan Monnier |
Subject: |
[elpa] externals/excorporate 890266e 67/93: Excorporate: Support creating and cancelling meetings |
Date: |
Sun, 29 Nov 2020 15:43:11 -0500 (EST) |
branch: externals/excorporate
commit 890266e6fe86b9fc0b002f94b93191e61cff1b0f
Author: Thomas Fitzsimmons <fitzsim@fitzsim.org>
Commit: Thomas Fitzsimmons <fitzsim@fitzsim.org>
Excorporate: Support creating and cancelling meetings
* packages/excorporate/excorporate.el
(exco--create-attendee-structure): New function.
(exco-calendar-item-meeting-create): Likewise.
(exco-calendar-item-meeting-cancel): Likewise.
---
excorporate.el | 82 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 82 insertions(+)
diff --git a/excorporate.el b/excorporate.el
index 7402bf0..03cf969 100644
--- a/excorporate.el
+++ b/excorporate.el
@@ -674,6 +674,88 @@ PATH is an ordered list of node names."
(setq values (assoc path-element values)))
(cdr values)))
+(defun exco--create-attendee-structure (attendees required)
+ "Convert a list of email addresses to an Attendees structure or nil.
+ATTENDEES is a list of strings, attendee email addresses.
+REQUIRED is t if the structure should represent required
+attendees and nil for optional attendees.
+Return a structure, or nil, suitable for splicing into
+`exco-operate` parameters with ,@."
+ (when attendees
+ (let ((attendee-list '()))
+ (dolist (address attendees)
+ (push `(Attendee (Mailbox (EmailAddress . ,address))) attendee-list))
+ (list (cons (if required 'RequiredAttendees 'OptionalAttendees)
+ (nreverse attendee-list))))))
+
+(defun exco-calendar-item-meeting-create (identifier
+ subject body start end location
+ main-invitees optional-invitees
+ callback)
+ "Create a meeting calendar item.
+IDENTIFIER is the connection identifier.
+SUBJECT is a string, the subject of the appointment.
+BODY is a string, the message text of the appointment.
+START is the start date and time in Emacs internal representation.
+END is the end date and time in Emacs internal representation.
+LOCATION is a string representing the location of the meeting.
+MAIN-INVITEES is a list of strings representing required
+participants.
+OPTIONAL-INVITEES is a list of strings representing optional
+participants
+CALLBACK is a callback function called with two arguments,
+IDENTIFIER, the connection identifier for the responding
+connection, and RESPONSE, the server's response to the meeting
+creation."
+ (exco-operate
+ identifier
+ "CreateItem"
+ `(((SendMeetingInvitations . "SendToAllAndSaveCopy")
+ (Items
+ (CalendarItem
+ (Subject . ,subject)
+ (Body (BodyType . "Text") ,body)
+ (Start . ,(exco-format-date-time start))
+ (End . ,(exco-format-date-time end))
+ (Location . ,location)
+ ,@(exco--create-attendee-structure main-invitees t)
+ ,@(exco--create-attendee-structure optional-invitees nil))))
+ ;; Empty arguments.
+ ,@(let* ((wsdl (exco--with-fsm identifier
+ (plist-get (fsm-get-state-data fsm) :service-wsdl)))
+ (arity (soap-operation-arity wsdl
+ "ExchangeServicePort"
+ "CreateItem")))
+ (make-list (- arity 1) nil)))
+ callback))
+
+(defun exco-calendar-item-meeting-cancel (identifier
+ item-identifier message callback)
+ "Cancel a meeting.
+IDENTIFIER is the connection identifier. ITEM-IDENTIFIER is the
+meeting identifier. MESSAGE is the body of the cancellation
+message that will be sent to attendees. CALLBACK is a callback
+function called with two arguments, IDENTIFIER, the connection
+identifier for the responding connection, and RESPONSE, the
+server's response to the meeting cancellation."
+ (exco-operate
+ identifier
+ "CreateItem"
+ `(((MessageDisposition . "SendAndSaveCopy")
+ (Items
+ (CancelCalendarItem
+ (ReferenceItemId ,@(cdr item-identifier))
+ (NewBodyContent (BodyType . "Text") ,message))))
+ ;; Empty arguments.
+ ,@(let* ((wsdl (exco--with-fsm identifier
+ (plist-get (fsm-get-state-data fsm)
+ :service-wsdl)))
+ (arity (soap-operation-arity wsdl
+ "ExchangeServicePort"
+ "CreateItem")))
+ (make-list (- arity 1) nil)))
+ callback))
+
(defun exco-calendar-item-appointment-create (identifier
subject body start end callback)
"Create an appointment calendar item.
- [elpa] externals/excorporate 836db8c 35/93: packages/excorporate: Bump version to 0.8.1, (continued)
- [elpa] externals/excorporate 836db8c 35/93: packages/excorporate: Bump version to 0.8.1, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate 0d20739 41/93: excorporate-diary: Fix documentation string, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate 6d8fa65 19/93: packages/excorporate: Acknowledge Fabio Leimgruber, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate 3e13cee 24/93: excorporate-calfw.el: Rename from excorporate-calfw.el.txt, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate 33ee501 31/93: packages/excorporate: Update documentation for Diary support, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate 882f2e0 44/93: excorporate-diary: Suppress compilation warning, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate d0a8709 39/93: excorporate-diary: Always use diary-fancy-display, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate 44e056d 43/93: excorporate-org: Support multiple calendars, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate e343dc8 47/93: excorporate-diary: Fix read-only diary buffer, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate 47fb189 73/93: Excorporate: Add some helper functions to Org backend, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate 890266e 67/93: Excorporate: Support creating and cancelling meetings,
Stefan Monnier <=
- [elpa] externals/excorporate c9df5e5 76/93: Excorporate: Fix some byte compiler warnings, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate 5eeff27 89/93: Excorporate: Bump version to 0.9.0, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate a33cd79 91/93: Excorporate: Prompt for meeting reply messages, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate 48d34df 12/93: packages/excorporate: Add NEWS file, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate 618d12c 18/93: packages/excorporate: Bump version to 0.7.5, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate 8279180 20/93: packages/excorporate: Bump url-http-ntlm required version to 2.0.3, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate 90532e9 29/93: packages/excorporate: Support retrieving meeting details, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate f5abc2a 36/93: packages/excorporate: Fix comment typo., Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate d7b3ef3 48/93: packages/excorporate: Bump version to 0.8.2, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate 4b975b2 45/93: Excorporate: Support multiple connections, Stefan Monnier, 2020/11/29