emacs-diffs
[Top][All Lists]
Advanced

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

master 89d9f46: gnus-icalendar: Missing attendees are not REQ-PARTICIPAN


From: Lars Ingebrigtsen
Subject: master 89d9f46: gnus-icalendar: Missing attendees are not REQ-PARTICIPANT
Date: Sat, 2 Oct 2021 04:56:25 -0400 (EDT)

branch: master
commit 89d9f466ddd8a919acf173e185c3ac3a5697ad41
Author: Alexandre Duret-Lutz <adl@lrde.epita.fr>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    gnus-icalendar: Missing attendees are not REQ-PARTICIPANT
    
    * lisp/gnus/gnus-icalendar.el (gnus-icalendar-event--get-attendee-names)
    (gnus-icalendar-event-from-ical): Do not default to REQ-PARTICIPANT
    if the user was not found as an attendee.
    * test/lisp/gnus/gnus-icalendar-tests.el
    (gnus-icalendary-weekly-byday): Remove the ROLE property to test
    that it correctly defaults to REQ-PARTICIPANT.  The case where the
    user is not listed is covered by gnus-icalendar-parse already
    (bug#50749).
---
 lisp/gnus/gnus-icalendar.el            | 8 ++++++--
 test/lisp/gnus/gnus-icalendar-tests.el | 2 +-
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/lisp/gnus/gnus-icalendar.el b/lisp/gnus/gnus-icalendar.el
index a2ae2a9..15da356 100644
--- a/lisp/gnus/gnus-icalendar.el
+++ b/lisp/gnus/gnus-icalendar.el
@@ -196,7 +196,9 @@
     (cl-labels
        ((attendee-role (prop)
                         ;; RFC5546: default ROLE is REQ-PARTICIPANT
-                        (or (plist-get (cadr prop) 'ROLE) "REQ-PARTICIPANT"))
+                        (and prop
+                             (or (plist-get (cadr prop) 'ROLE)
+                                 "REQ-PARTICIPANT")))
         (attendee-name
          (prop)
          (or (plist-get (cadr prop) 'CN)
@@ -228,7 +230,9 @@
                       ical attendee-name-or-email)))
          (attendee-names (gnus-icalendar-event--get-attendee-names ical))
          ;; RFC5546: default ROLE is REQ-PARTICIPANT
-         (role (or (plist-get (cadr attendee) 'ROLE) "REQ-PARTICIPANT"))
+         (role (and attendee
+                    (or (plist-get (cadr attendee) 'ROLE)
+                        "REQ-PARTICIPANT")))
          (participation-type (pcase role
                                ("REQ-PARTICIPANT" 'required)
                                ("OPT-PARTICIPANT" 'optional)
diff --git a/test/lisp/gnus/gnus-icalendar-tests.el 
b/test/lisp/gnus/gnus-icalendar-tests.el
index 90c3a34..1206a97 100644
--- a/test/lisp/gnus/gnus-icalendar-tests.el
+++ b/test/lisp/gnus/gnus-icalendar-tests.el
@@ -216,7 +216,7 @@ RRULE:FREQ=WEEKLY;BYDAY=FR,MO,TH,TU,WE
 DTSTAMP:20200915T120627Z
 ORGANIZER;CN=anon@anoncompany.com:mailto:anon@anoncompany.com
 UID:7b6g3m7iftuo90ei4ul00feqn_R20200915T120000@google.com
-ATTENDEE;CUTYPE=INDIVIDUAL;ROLE=REQ-PARTICIPANT;PARTSTAT=ACCEPTED;RSVP=TRUE
+ATTENDEE;CUTYPE=INDIVIDUAL;PARTSTAT=ACCEPTED;RSVP=TRUE
  
;CN=participant@anoncompany.com;X-NUM-GUESTS=0:mailto:participant@anoncompany.com
 CREATED:20200325T095723Z
 DESCRIPTION:Coffee talk



reply via email to

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