emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] trunk r115273: lisp/gnus/gnus-icalendar.el: bugfix and imp


From: Katsumi Yamaoka
Subject: [Emacs-diffs] trunk r115273: lisp/gnus/gnus-icalendar.el: bugfix and improvements
Date: Thu, 28 Nov 2013 23:33:55 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 115273
revision-id: address@hidden
parent: address@hidden
author: Jan Tatarik <address@hidden>
committer: Katsumi Yamaoka <address@hidden>
branch nick: trunk
timestamp: Thu 2013-11-28 23:33:52 +0000
message:
  lisp/gnus/gnus-icalendar.el: bugfix and improvements
modified:
  lisp/gnus/ChangeLog            changelog-20091113204419-o5vbwnq5f7feedwu-1433
  lisp/gnus/gnus-icalendar.el    
gnusicalendar.el-20130801225830-k3bdrwt8427ren1n-1
=== modified file 'lisp/gnus/ChangeLog'
--- a/lisp/gnus/ChangeLog       2013-11-27 06:39:37 +0000
+++ b/lisp/gnus/ChangeLog       2013-11-28 23:33:52 +0000
@@ -1,3 +1,12 @@
+2013-11-28  Jan Tatarik  <address@hidden>
+
+       * gnus-icalendar.el (gnus-icalendar-event-from-ical)
+       (gnus-icalendar-event->org-entry)
+       (gnus-icalendar--update-org-event)
+       (gnus-icalendar-event->gnus-calendar): Distinguish between
+       required/optional/non-participant attendee status. Fix bug causing
+       the first required event participant to be omitted.
+
 2013-11-27  Katsumi Yamaoka  <address@hidden>
 
        * gnus-art.el (article-de-quoted-unreadable)

=== modified file 'lisp/gnus/gnus-icalendar.el'
--- a/lisp/gnus/gnus-icalendar.el       2013-11-21 22:55:59 +0000
+++ b/lisp/gnus/gnus-icalendar.el       2013-11-28 23:33:52 +0000
@@ -92,10 +92,10 @@
          :accessor gnus-icalendar-event:rsvp
          :initform nil
          :type (or null boolean))
-   (participation-required :initarg :participation-required
-         :accessor gnus-icalendar-event:participation-required
-         :initform t
-         :type (or null boolean))
+   (participation-type :initarg :participation-type
+         :accessor gnus-icalendar-event:participation-type
+         :initform 'non-participant
+         :type (or null t))
    (req-participants :initarg :req-participants
          :accessor gnus-icalendar-event:req-participants
          :initform nil
@@ -196,15 +196,18 @@
          (attendee (when attendee-name-or-email
                      (gnus-icalendar-event--find-attendee ical 
attendee-name-or-email)))
          (attendee-names (gnus-icalendar-event--get-attendee-names ical))
+         (role (plist-get (cadr attendee) 'ROLE))
+         (participation-type (pcase role
+                              ("REQ-PARTICIPANT" 'required)
+                              ("OPT-PARTICIPANT" 'optional)
+                              (_                 'non-participant)))
          (args (list :method method
                      :organizer organizer
                      :start-time (gnus-icalendar-event--decode-datefield event 
'DTSTART)
                      :end-time (gnus-icalendar-event--decode-datefield event 
'DTEND)
-                     :rsvp (string= (plist-get (cadr attendee) 'RSVP)
-                                    "TRUE")
-                     :participation-required (string= (plist-get (cadr 
attendee) 'ROLE)
-                                                      "REQ-PARTICIPANT")
-                     :req-participants (cdar attendee-names)
+                     :rsvp (string= (plist-get (cadr attendee) 'RSVP) "TRUE")
+                     :participation-type participation-type
+                     :req-participants (car attendee-names)
                      :opt-participants (cadr attendee-names)))
          (event-class (cond
                        ((string= method "REQUEST") 
'gnus-icalendar-event-request)
@@ -451,7 +454,7 @@
                       ("DT" . ,(gnus-icalendar-event:org-timestamp event))
                       ("ORGANIZER" . ,(gnus-icalendar-event:organizer event))
                       ("LOCATION" . ,(gnus-icalendar-event:location event))
-                      ("PARTICIPATION_REQUIRED" . ,(when 
(gnus-icalendar-event:participation-required event) "t"))
+                      ("PARTICIPATION_TYPE" . ,(symbol-name 
(gnus-icalendar-event:participation-type event)))
                       ("REQ_PARTICIPANTS" . 
,(gnus-icalendar--format-participant-list 
(gnus-icalendar-event:req-participants event)))
                       ("OPT_PARTICIPANTS" . 
,(gnus-icalendar--format-participant-list 
(gnus-icalendar-event:opt-participants event)))
                       ("RRULE" . ,(gnus-icalendar-event:recur event))
@@ -513,7 +516,7 @@
     (when file
       (with-current-buffer (find-file-noselect file)
         (with-slots (uid summary description organizer location recur
-                         participation-required req-participants 
opt-participants) event
+                         participation-type req-participants opt-participants) 
event
           (let ((event-pos (org-find-entry-with-id uid)))
             (when event-pos
               (goto-char event-pos)
@@ -555,7 +558,7 @@
                 (org-entry-put event-pos "DT" 
(gnus-icalendar-event:org-timestamp event))
                 (org-entry-put event-pos "ORGANIZER" organizer)
                 (org-entry-put event-pos "LOCATION" location)
-                (org-entry-put event-pos "PARTICIPATION_REQUIRED" (when 
participation-required "t"))
+                (org-entry-put event-pos "PARTICIPATION_TYPE" (symbol-name 
participation-type))
                 (org-entry-put event-pos "REQ_PARTICIPANTS" 
(gnus-icalendar--format-participant-list req-participants))
                 (org-entry-put event-pos "OPT_PARTICIPANTS" 
(gnus-icalendar--format-participant-list opt-participants))
                 (org-entry-put event-pos "RRULE" recur)
@@ -691,12 +694,14 @@
                     (cadr x))))
 
     (with-slots (organizer summary description location recur uid
-                           method rsvp participation-required) event
+                           method rsvp participation-type) event
       (let ((headers `(("Summary" ,summary)
                       ("Location" ,(or location ""))
                       ("Time" ,(gnus-icalendar-event:org-timestamp event))
                       ("Organizer" ,organizer)
-                      ("Attendance" ,(if participation-required "Required" 
"Optional"))
+                      ("Attendance" ,(if (eq participation-type 
'non-participant)
+                                         "You are not listed as an attendee"
+                                       (capitalize (symbol-name 
participation-type))))
                       ("Method" ,method))))
 
        (when (and (not (gnus-icalendar-event-reply-p event)) rsvp)


reply via email to

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