aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSylvain Chouleur2014-10-16 22:12:03 +0000
committerKatsumi Yamaoka2014-10-16 22:12:03 +0000
commit417cf674853d76489eedb77ac856e21a087b955c (patch)
tree18dd3cb865eb8aeccf3cdecb6ce69c07c6e98da9
parent01c1b1a8ae6431f9f3d6dd74b8fdc4753537e836 (diff)
downloademacs-417cf674853d76489eedb77ac856e21a087b955c.tar.gz
emacs-417cf674853d76489eedb77ac856e21a087b955c.zip
lisp/gnus/gnus-icalendar.el: Support vcal format timezones
-rw-r--r--lisp/gnus/ChangeLog7
-rw-r--r--lisp/gnus/gnus-icalendar.el18
2 files changed, 17 insertions, 8 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 30eda3d2bf0..7dab8dec90d 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,10 @@
12014-10-15 Sylvain Chouleur <sylvain.chouleur@gmail.com>
2
3 * gnus-icalendar.el: Support vcal format timezones
4 (gnus-icalendar-event--decode-datefield): use icalendar functions to
5 compute dates with associated timezone
6 (gnus-icalendar-event-from-ical): compute all timezones
7
12014-10-14 Teodor Zlatanov <tzz@lifelogs.com> 82014-10-14 Teodor Zlatanov <tzz@lifelogs.com>
2 9
3 * gnus-start.el (gnus-save-newsrc-file-check-timestamp): New option to 10 * gnus-start.el (gnus-save-newsrc-file-check-timestamp): New option to
diff --git a/lisp/gnus/gnus-icalendar.el b/lisp/gnus/gnus-icalendar.el
index 3362cc87811..a9e4a24c93b 100644
--- a/lisp/gnus/gnus-icalendar.el
+++ b/lisp/gnus/gnus-icalendar.el
@@ -141,12 +141,13 @@
141(defmethod gnus-icalendar-event:start ((event gnus-icalendar-event)) 141(defmethod gnus-icalendar-event:start ((event gnus-icalendar-event))
142 (format-time-string "%Y-%m-%d %H:%M" (gnus-icalendar-event:start-time event))) 142 (format-time-string "%Y-%m-%d %H:%M" (gnus-icalendar-event:start-time event)))
143 143
144(defun gnus-icalendar-event--decode-datefield (ical field) 144(defun gnus-icalendar-event--decode-datefield (event field zone-map)
145 (let* ((date (icalendar--get-event-property ical field)) 145 (let* ((dtdate (icalendar--get-event-property event field))
146 (date-props (icalendar--get-event-property-attributes ical field)) 146 (dtdate-zone (icalendar--find-time-zone
147 (tz (plist-get date-props 'TZID))) 147 (icalendar--get-event-property-attributes
148 148 event field) zone-map))
149 (date-to-time (timezone-make-date-arpa-standard date nil tz)))) 149 (dtdate-dec (icalendar--decode-isodatetime dtdate nil dtdate-zone)))
150 (apply 'encode-time dtdate-dec)))
150 151
151(defun gnus-icalendar-event--find-attendee (ical name-or-email) 152(defun gnus-icalendar-event--find-attendee (ical name-or-email)
152 (let* ((event (car (icalendar--all-events ical))) 153 (let* ((event (car (icalendar--all-events ical)))
@@ -204,10 +205,11 @@
204 ("REQ-PARTICIPANT" 'required) 205 ("REQ-PARTICIPANT" 'required)
205 ("OPT-PARTICIPANT" 'optional) 206 ("OPT-PARTICIPANT" 'optional)
206 (_ 'non-participant))) 207 (_ 'non-participant)))
208 (zone-map (icalendar--convert-all-timezones ical))
207 (args (list :method method 209 (args (list :method method
208 :organizer organizer 210 :organizer organizer
209 :start-time (gnus-icalendar-event--decode-datefield event 'DTSTART) 211 :start-time (gnus-icalendar-event--decode-datefield event 'DTSTART zone-map)
210 :end-time (gnus-icalendar-event--decode-datefield event 'DTEND) 212 :end-time (gnus-icalendar-event--decode-datefield event 'DTEND zone-map)
211 :rsvp (string= (plist-get (cadr attendee) 'RSVP) "TRUE") 213 :rsvp (string= (plist-get (cadr attendee) 'RSVP) "TRUE")
212 :participation-type participation-type 214 :participation-type participation-type
213 :req-participants (car attendee-names) 215 :req-participants (car attendee-names)