X-Git-Url: http://cgit.sxemacs.org/?a=blobdiff_plain;f=lisp%2Fgnus-icalendar.el;h=dc423d85d191d0151996bb04f21b32cb4d173f41;hb=78eb88a87d3730f2965cb4fe9a8ff53cb0990f53;hp=852ce537d9fd27ff30a0bebe10071e2d7f635dac;hpb=504bdfe73feca8d0222ca33789120c4ec6c4d1ca;p=gnus diff --git a/lisp/gnus-icalendar.el b/lisp/gnus-icalendar.el index 852ce537d..dc423d85d 100644 --- a/lisp/gnus-icalendar.el +++ b/lisp/gnus-icalendar.el @@ -1,6 +1,6 @@ ;;; gnus-icalendar.el --- reply to iCalendar meeting requests -;; Copyright (C) 2013-2014 Free Software Foundation, Inc. +;; Copyright (C) 2013-2015 Free Software Foundation, Inc. ;; Author: Jan Tatarik ;; Keywords: mail, icalendar, org @@ -38,6 +38,7 @@ (require 'gmm-utils) (require 'mm-decode) (require 'gnus-sum) +(require 'gnus-art) (eval-when-compile (require 'cl)) @@ -140,12 +141,13 @@ (defmethod gnus-icalendar-event:start ((event gnus-icalendar-event)) (format-time-string "%Y-%m-%d %H:%M" (gnus-icalendar-event:start-time event))) -(defun gnus-icalendar-event--decode-datefield (ical field) - (let* ((date (icalendar--get-event-property ical field)) - (date-props (icalendar--get-event-property-attributes ical field)) - (tz (plist-get date-props 'TZID))) - - (date-to-time (timezone-make-date-arpa-standard date nil tz)))) +(defun gnus-icalendar-event--decode-datefield (event field zone-map) + (let* ((dtdate (icalendar--get-event-property event field)) + (dtdate-zone (icalendar--find-time-zone + (icalendar--get-event-property-attributes + event field) zone-map)) + (dtdate-dec (icalendar--decode-isodatetime dtdate nil dtdate-zone))) + (apply 'encode-time dtdate-dec))) (defun gnus-icalendar-event--find-attendee (ical name-or-email) (let* ((event (car (icalendar--all-events ical))) @@ -203,10 +205,11 @@ ("REQ-PARTICIPANT" 'required) ("OPT-PARTICIPANT" 'optional) (_ 'non-participant))) + (zone-map (icalendar--convert-all-timezones ical)) (args (list :method method :organizer organizer - :start-time (gnus-icalendar-event--decode-datefield event 'DTSTART) - :end-time (gnus-icalendar-event--decode-datefield event 'DTEND) + :start-time (gnus-icalendar-event--decode-datefield event 'DTSTART zone-map) + :end-time (gnus-icalendar-event--decode-datefield event 'DTEND zone-map) :rsvp (string= (plist-get (cadr attendee) 'RSVP) "TRUE") :participation-type participation-type :req-participants (car attendee-names) @@ -675,8 +678,9 @@ Gnus will only offer you the Accept/Tentative/Decline buttons for calendar events if any of your identities matches at least one RSVP participant. -Your identity is guessed automatically from the variables `user-full-name', -`user-mail-address', and `gnus-ignored-from-addresses'. +Your identity is guessed automatically from the variables +`user-full-name', `user-mail-address', +`gnus-ignored-from-addresses' and `message-alternative-emails'. If you need even more aliases you can define them here. It really only makes sense to define names or email addresses." @@ -702,6 +706,7 @@ These will be used to retrieve the RSVP information from ical events." (list user-full-name (regexp-quote user-mail-address) ; NOTE: these can be lists gnus-ignored-from-addresses ; already regexp-quoted + message-alternative-emails ; (mapcar #'regexp-quote gnus-icalendar-additional-identities))))) ;; TODO: make the template customizable