unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Alexandre Duret-Lutz <adl@lrde.epita.fr>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: 50749@debbugs.gnu.org
Subject: bug#50749: 28.0.50; three gnus-icalendar issues w.r.t. RFC5546 and party crashers
Date: Fri, 01 Oct 2021 18:00:20 +0200	[thread overview]
Message-ID: <87czood9bf.fsf@lrde.epita.fr> (raw)
In-Reply-To: <87h7e0da9o.fsf@lrde.epita.fr> (Alexandre Duret-Lutz's message of "Fri, 01 Oct 2021 17:39:47 +0200")

[-- Attachment #1: Type: text/plain, Size: 187 bytes --]

Alexandre Duret-Lutz <adl@lrde.epita.fr> writes:
> Let me learn from my mistake and see if I can find how to run these tests
> and add a test case for for what I intended to fix.

Here.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-missing-attendees-are-not-REQ-PARTICIPANT.patch --]
[-- Type: text/x-diff, Size: 2831 bytes --]

From 3d0f1809109f6d1450ba9f93e1fd866312fb2f38 Mon Sep 17 00:00:00 2001
From: Alexandre Duret-Lutz <adl@lrde.epita.fr>
Date: Fri, 1 Oct 2021 17:52:12 +0200
Subject: [PATCH] missing attendees are not REQ-PARTICIPANT

Fix a bug introduced by 6c0824f71 where REQ-PARTICIPANT should only be
the default for people actually listed as attendees, not for unlisted
participants.

* 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
---
 lisp/gnus/gnus-icalendar.el            | 6 ++++--
 test/lisp/gnus/gnus-icalendar-tests.el | 2 +-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/lisp/gnus/gnus-icalendar.el b/lisp/gnus/gnus-icalendar.el
index a2ae2a9668..0e297a8016 100644
--- a/lisp/gnus/gnus-icalendar.el
+++ b/lisp/gnus/gnus-icalendar.el
@@ -196,7 +196,8 @@ gnus-icalendar-event--get-attendee-names
     (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 +229,8 @@ gnus-icalendar-event-from-ical
                       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 90c3a34a5c..1206a976f6 100644
--- a/test/lisp/gnus/gnus-icalendar-tests.el
+++ b/test/lisp/gnus/gnus-icalendar-tests.el
@@ -216,7 +216,7 @@ gnus-icalendary-weekly-byday
 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
-- 
2.33.0


  reply	other threads:[~2021-10-01 16:00 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-23  7:47 bug#50749: 28.0.50; three gnus-icalendar issues w.r.t. RFC5546 and party crashers Alexandre Duret-Lutz
2021-09-23 21:49 ` Lars Ingebrigtsen
2021-09-23 23:57   ` Alexandre Duret-Lutz
2021-09-25  0:45     ` Lars Ingebrigtsen
2021-10-01  8:15       ` Alexandre Duret-Lutz
2021-10-01 12:09         ` Lars Ingebrigtsen
2021-10-01 12:15         ` Lars Ingebrigtsen
2021-10-01 15:39           ` Alexandre Duret-Lutz
2021-10-01 16:00             ` Alexandre Duret-Lutz [this message]
2021-10-02  8:56               ` Lars Ingebrigtsen
2021-10-02  8:56                 ` Lars Ingebrigtsen
2021-09-24 14:35 ` Jan Tatarik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87czood9bf.fsf@lrde.epita.fr \
    --to=adl@lrde.epita.fr \
    --cc=50749@debbugs.gnu.org \
    --cc=larsi@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).