unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#50749: 28.0.50; three gnus-icalendar issues w.r.t. RFC5546 and party crashers
@ 2021-09-23  7:47 Alexandre Duret-Lutz
  2021-09-23 21:49 ` Lars Ingebrigtsen
  2021-09-24 14:35 ` Jan Tatarik
  0 siblings, 2 replies; 12+ messages in thread
From: Alexandre Duret-Lutz @ 2021-09-23  7:47 UTC (permalink / raw)
  To: 50749; +Cc: Jan Tatarik

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

Hi,

At my job, some colleagues regularly send iCal invitations to mailing
lists, and expect the recipients of these mailing lists to accept the
invitation individually to indicate whether they are coming or not.

The iCal invitations only lists the mailing list has an "attendee", not
the all final recipients.

When I receive such an invitation in Gnus,
gnus-icalendar-event->gnus-calendar will tell me that
"You are not listed as an attendee", and rightly so.

However the code in gnus-icalendar-event:inline-reply-buttons
prevents me from replying to the invitation by hiding the
buttons.  This is not desired: I still want to reply.

RFC5546 specifically allows users not listed as attendee to reply to an
invitation.  Section 3.2.3 refers to those as a party crashers.

Patch 0002 fixes this issue, which is the most important to me.  In that
patch, I was hesitant to remove the (lwarn...) message.  I have tested
that party crashing work with invitations sent to me (indirectly) by
Outlook users.  It does not work with Google Calendar, but I think the
issue is on their side (someone else reported this on stackoverflow
at https://stackoverflow.com/questions/66519665/ )

While working on that and discovering RFC5546 (which is completely new to
me), I found two other issues in the gnus-icalendar code.

One is that when replying to an iCal invitation, the mail should be sent
to the "organizer" of that event, not to the sender of the email.  This
matters for forwarded invitations, for instance (and forwarded
invitations in turn are related to supporting party crashers).  Also
some calendar systems can use dedicated email addresses to handle those
events: Google Calendar, for instance, uses mail addresses in
"...@group.calendar.google.com" for secondary calendars, and lists those
as organizers of events in these calendars (but so far, mail replies to
those event seems simply ignored, I'll try to find a place where to
report that).

Patch 0001 fixes the recipient of the invitation response.


Finally, while displaying the mail sent for party-crasher responses
(after patch 0002), I noticed that gnus-icalendar-event->gnus-calendar
was still telling me that "You are not listed as an attendee", despite
actually being the only attendee listed.  This is because the code
assumes that a missing ROLE parameter on the ATTENDEE line signifies
NON-PARTICIPANT.  That's not what RFC5546 specifies in section 4.2.1:
the default value for the "ROLE" parameter is "REQ-PARTICIPANT" and it
need not be enumerated.  Patch 0003 fixes that.




[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-reply-to-the-organizer-of-an-ical-event.patch --]
[-- Type: text/x-diff, Size: 2551 bytes --]

From 04ed215bfa211620b6bd157fa745cd59f6a891ed Mon Sep 17 00:00:00 2001
From: Alexandre Duret-Lutz <adl@lrde.epita.fr>
Date: Wed, 22 Sep 2021 16:30:21 +0200
Subject: [PATCH 1/3] reply to the organizer of an ical event

RFC5546 specifies that participant status (accepted, tentative,
declined) should be sent to the organizer of the event.  That
organizer is not necessarily the sender of the invitation; for
instance Google Calendar uses custom email addresses to receive these
notifications.

* lisp/gnus/gnus-icalendar.el (gnus-icalendar-send-buffer-by-mail):
Replace the default recipient of the reply by the organizer of the
event.
(gnus-icalendar-reply) Pass that organizer to the previous function.
---
 lisp/gnus/gnus-icalendar.el | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/lisp/gnus/gnus-icalendar.el b/lisp/gnus/gnus-icalendar.el
index b6e5e7f786..514feff284 100644
--- a/lisp/gnus/gnus-icalendar.el
+++ b/lisp/gnus/gnus-icalendar.el
@@ -847,10 +847,14 @@ gnus-icalendar-insert-button
        button t
        gnus-data ,data))))
 
-(defun gnus-icalendar-send-buffer-by-mail (buffer-name subject)
+(defun gnus-icalendar-send-buffer-by-mail (buffer-name subject organizer)
   (let ((message-signature nil))
     (with-current-buffer gnus-summary-buffer
       (gnus-summary-reply)
+      ;; Reply to the organizer, not to whoever sent the invitation. person
+      ;; Some calendar systems use specific email address as organizer to
+      ;; receive these responses.
+      (message-replace-header "To" organizer)
       (message-goto-body)
       (mml-insert-multipart "alternative")
       (mml-insert-empty-tag 'part 'type "text/plain")
@@ -866,7 +870,8 @@ gnus-icalendar-reply
          (event (caddr data))
          (reply (gnus-icalendar-with-decoded-handle handle
                   (gnus-icalendar-event-reply-from-buffer
-                   (current-buffer) status (gnus-icalendar-identities)))))
+                   (current-buffer) status (gnus-icalendar-identities))))
+         (organizer (gnus-icalendar-event:organizer event)))
 
     (when reply
       (cl-labels
@@ -883,7 +888,7 @@ gnus-icalendar-reply
             (delete-region (point-min) (point-max))
             (insert reply)
             (fold-icalendar-buffer)
-            (gnus-icalendar-send-buffer-by-mail (buffer-name) subject))
+            (gnus-icalendar-send-buffer-by-mail (buffer-name) subject organizer))
 
           ;; Back in article buffer
           (setq-local gnus-icalendar-reply-status status)
-- 
2.33.0


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: 0002-allow-party-crashers-to-respond-to-ical-events.patch --]
[-- Type: text/x-diff, Size: 3201 bytes --]

From bd4dcf7273107d5855240ee6c9fad4eb9607bd33 Mon Sep 17 00:00:00 2001
From: Alexandre Duret-Lutz <adl@lrde.epita.fr>
Date: Wed, 22 Sep 2021 16:38:42 +0200
Subject: [PATCH 2/3] allow party crashers to respond to ical events

If an ical invitation is sent to a mailing list, the recipients
are probably not listed as attendees.  However there are
legitimate situations where these unlisted (or indirectly listed)
recipients are still expected to respond.  RFC5546 allows that,
calling those respondents "party crashers".

* lisp/gnus/gnus-icalendar.el
(gnus-icalendar-event:inline-reply-buttons): Display the response
buttons even if the user was not found in the list of attendees,
but change the labels of those buttons to make clear they are
not explicitly invited.
(gnus-icalendar-event--build-reply-event-body): Add an attendee
line for the user in case one was not found.
---
 lisp/gnus/gnus-icalendar.el | 22 +++++++++++++++++-----
 1 file changed, 17 insertions(+), 5 deletions(-)

diff --git a/lisp/gnus/gnus-icalendar.el b/lisp/gnus/gnus-icalendar.el
index 514feff284..348da12db1 100644
--- a/lisp/gnus/gnus-icalendar.el
+++ b/lisp/gnus/gnus-icalendar.el
@@ -345,10 +345,16 @@ gnus-icalendar-event--build-reply-event-body
 
       (mapc #'process-event-line (split-string ical-request "\n"))
 
+      ;; RFC5546 refers to uninvited attendees as "party crashers".
+      ;; This situation is common if the invitation is sent to a group
+      ;; of people via a mailing list.
       (unless (gnus-icalendar-find-if (lambda (x) (string-match "^ATTENDEE" x))
 				      reply-event-lines)
         (lwarn 'gnus-icalendar :warning
-               "Could not find an event attendee matching given identity"))
+               "Could not find an event attendee matching given identity")
+        (push (format "ATTENDEE;RSVP=TRUE;PARTSTAT=%s;CN=%s:MAILTO:%s"
+                      attendee-status user-full-name user-mail-address)
+              reply-event-lines))
 
       (mapconcat #'identity `("BEGIN:VEVENT"
                               ,@(nreverse reply-event-lines)
@@ -902,10 +908,16 @@ gnus-icalendar-sync-event-to-org
   (gnus-icalendar-event:sync-to-org event gnus-icalendar-reply-status))
 
 (cl-defmethod gnus-icalendar-event:inline-reply-buttons ((event gnus-icalendar-event) handle)
-  (when (gnus-icalendar-event:rsvp event)
-    `(("Accept" gnus-icalendar-reply (,handle accepted ,event))
-      ("Tentative" gnus-icalendar-reply (,handle tentative ,event))
-      ("Decline" gnus-icalendar-reply (,handle declined ,event)))))
+  (let ((accept-btn "Accept")
+        (tentative-btn "Tentative")
+        (decline-btn "Decline"))
+    (unless (gnus-icalendar-event:rsvp event)
+      (setq accept-btn "Uninvited Accept"
+            tentative-btn "Uninvited Tentative"
+            decline-btn "Uninvited Decline"))
+    `((,accept-btn gnus-icalendar-reply (,handle accepted ,event))
+      (,tentative-btn gnus-icalendar-reply (,handle tentative ,event))
+      (,decline-btn gnus-icalendar-reply (,handle declined ,event)))))
 
 (cl-defmethod gnus-icalendar-event:inline-reply-buttons ((_event gnus-icalendar-event-reply) _handle)
   "No buttons for REPLY events."
-- 
2.33.0


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #4: 0003-default-role-for-attendees-is-REQ-PARTICIPANT.patch --]
[-- Type: text/x-diff, Size: 1717 bytes --]

From 04e042d3ea9ba8760071e6fee4a648a54027138f Mon Sep 17 00:00:00 2001
From: Alexandre Duret-Lutz <adl@lrde.epita.fr>
Date: Wed, 22 Sep 2021 22:28:28 +0200
Subject: [PATCH 3/3] default role for attendees is REQ-PARTICIPANT

* lisp/gnus/gnus-icalendar.el
(gnus-icalendar-event--get-attendee-names,
gnus-icalendar-event-from-ical): When the ROLE property
is missing from an ATTENDEE line, follow RFC5546 and default
to REQ-PARTICIPANT.
---
 lisp/gnus/gnus-icalendar.el | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/lisp/gnus/gnus-icalendar.el b/lisp/gnus/gnus-icalendar.el
index 348da12db1..a2ae2a9668 100644
--- a/lisp/gnus/gnus-icalendar.el
+++ b/lisp/gnus/gnus-icalendar.el
@@ -194,7 +194,9 @@ gnus-icalendar-event--get-attendee-names
                           (caddr event))))
 
     (cl-labels
-	((attendee-role (prop) (plist-get (cadr prop) 'ROLE))
+	((attendee-role (prop)
+                        ;; RFC5546: default ROLE is REQ-PARTICIPANT
+                        (or (plist-get (cadr prop) 'ROLE) "REQ-PARTICIPANT"))
 	 (attendee-name
 	  (prop)
 	  (or (plist-get (cadr prop) 'CN)
@@ -225,7 +227,8 @@ gnus-icalendar-event-from-ical
                      (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))
+         ;; RFC5546: default ROLE is REQ-PARTICIPANT
+         (role (or (plist-get (cadr attendee) 'ROLE) "REQ-PARTICIPANT"))
          (participation-type (pcase role
                                ("REQ-PARTICIPANT" 'required)
                                ("OPT-PARTICIPANT" 'optional)
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* bug#50749: 28.0.50; three gnus-icalendar issues w.r.t. RFC5546 and party crashers
  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-24 14:35 ` Jan Tatarik
  1 sibling, 1 reply; 12+ messages in thread
From: Lars Ingebrigtsen @ 2021-09-23 21:49 UTC (permalink / raw)
  To: Alexandre Duret-Lutz; +Cc: 50749, Jan Tatarik

Alexandre Duret-Lutz <adl@lrde.epita.fr> writes:

> While working on that and discovering RFC5546 (which is completely new to
> me), I found two other issues in the gnus-icalendar code.

Thanks; skimming the patches, I they make sense to me, but perhaps Jan
has further comments here.

But I see that you have many FSF copyright assignments on file, but not
one for Emacs?  These patches are collectively too big to apply without
one -- would you be willing to sign one?

If so, here's the form to get started:


Please email the following information to assign@gnu.org, and we
will send you the assignment form for your past and future changes.

Please use your full legal name (in ASCII characters) as the subject
line of the message.
----------------------------------------------------------------------
REQUEST: SEND FORM FOR PAST AND FUTURE CHANGES

[What is the name of the program or package you're contributing to?]
Emacs

[Did you copy any files or text written by someone else in these changes?
Even if that material is free software, we need to know about it.]

[Do you have an employer who might have a basis to claim to own
your changes?  Do you attend a school which might make such a claim?]

[For the copyright registration, what country are you a citizen of?]

[What year were you born?]

[Please write your email address here.]

[Please write your postal address here.]

[Which files have you changed so far, and which new files have you written
so far?]





^ permalink raw reply	[flat|nested] 12+ messages in thread

* bug#50749: 28.0.50; three gnus-icalendar issues w.r.t. RFC5546 and party crashers
  2021-09-23 21:49 ` Lars Ingebrigtsen
@ 2021-09-23 23:57   ` Alexandre Duret-Lutz
  2021-09-25  0:45     ` Lars Ingebrigtsen
  0 siblings, 1 reply; 12+ messages in thread
From: Alexandre Duret-Lutz @ 2021-09-23 23:57 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 50749

Lars Ingebrigtsen <larsi@gnus.org> writes:
> But I see that you have many FSF copyright assignments on file, but not
> one for Emacs?  These patches are collectively too big to apply without
> one -- would you be willing to sign one?

I knew this was coming :-)  Form sent.





^ permalink raw reply	[flat|nested] 12+ messages in thread

* bug#50749: 28.0.50; three gnus-icalendar issues w.r.t. RFC5546 and party crashers
  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-24 14:35 ` Jan Tatarik
  1 sibling, 0 replies; 12+ messages in thread
From: Jan Tatarik @ 2021-09-24 14:35 UTC (permalink / raw)
  To: Alexandre Duret-Lutz; +Cc: 50749

On Thu, Sep 23 2021, Alexandre Duret-Lutz wrote:

> Hi,

> At my job, some colleagues regularly send iCal invitations to mailing
> lists, and expect the recipients of these mailing lists to accept the
> invitation individually to indicate whether they are coming or not.

> The iCal invitations only lists the mailing list has an "attendee", not
> the all final recipients.

> When I receive such an invitation in Gnus,
> gnus-icalendar-event->gnus-calendar will tell me that
> "You are not listed as an attendee", and rightly so.

> However the code in gnus-icalendar-event:inline-reply-buttons
> prevents me from replying to the invitation by hiding the
> buttons.  This is not desired: I still want to reply.

[...]

Looks ok to me, thank you.





^ permalink raw reply	[flat|nested] 12+ messages in thread

* bug#50749: 28.0.50; three gnus-icalendar issues w.r.t. RFC5546 and party crashers
  2021-09-23 23:57   ` Alexandre Duret-Lutz
@ 2021-09-25  0:45     ` Lars Ingebrigtsen
  2021-10-01  8:15       ` Alexandre Duret-Lutz
  0 siblings, 1 reply; 12+ messages in thread
From: Lars Ingebrigtsen @ 2021-09-25  0:45 UTC (permalink / raw)
  To: Alexandre Duret-Lutz; +Cc: 50749

Alexandre Duret-Lutz <adl@lrde.epita.fr> writes:

> I knew this was coming :-)  Form sent.

Great!   I'll mark this bug as "pending" as in "to be applied when the
paperwork is done".

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 12+ messages in thread

* bug#50749: 28.0.50; three gnus-icalendar issues w.r.t. RFC5546 and party crashers
  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
  0 siblings, 2 replies; 12+ messages in thread
From: Alexandre Duret-Lutz @ 2021-10-01  8:15 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 50749

> Great!   I'll mark this bug as "pending" as in "to be applied when the
> paperwork is done".

Assignment is now on file.





^ permalink raw reply	[flat|nested] 12+ messages in thread

* bug#50749: 28.0.50; three gnus-icalendar issues w.r.t. RFC5546 and party crashers
  2021-10-01  8:15       ` Alexandre Duret-Lutz
@ 2021-10-01 12:09         ` Lars Ingebrigtsen
  2021-10-01 12:15         ` Lars Ingebrigtsen
  1 sibling, 0 replies; 12+ messages in thread
From: Lars Ingebrigtsen @ 2021-10-01 12:09 UTC (permalink / raw)
  To: Alexandre Duret-Lutz; +Cc: 50749, Jan Tatarik

Alexandre Duret-Lutz <adl@lrde.epita.fr> writes:

>> Great!   I'll mark this bug as "pending" as in "to be applied when the
>> paperwork is done".
>
> Assignment is now on file.

Yup; so I've applied all three of your patches to the trunk (i.e., Emacs
29).

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 12+ messages in thread

* bug#50749: 28.0.50; three gnus-icalendar issues w.r.t. RFC5546 and party crashers
  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
  1 sibling, 1 reply; 12+ messages in thread
From: Lars Ingebrigtsen @ 2021-10-01 12:15 UTC (permalink / raw)
  To: Alexandre Duret-Lutz; +Cc: 50749

Alexandre Duret-Lutz <adl@lrde.epita.fr> writes:

>> Great!   I'll mark this bug as "pending" as in "to be applied when the
>> paperwork is done".
>
> Assignment is now on file.

I forgot to check whether there were any test regressions.
gnus-icalendar-parse fails, but the following change makes it pass.

I'm not very familiar with this code -- was this change intended?

diff --git a/test/lisp/gnus/gnus-icalendar-tests.el b/test/lisp/gnus/gnus-icalendar-tests.el
index 90c3a34a5c..61fe9701fe 100644
--- a/test/lisp/gnus/gnus-icalendar-tests.el
+++ b/test/lisp/gnus/gnus-icalendar-tests.el
@@ -103,7 +103,7 @@ gnus-icalendar-parse
                       (should (string= (format-time-string "%Y-%m-%d %H:%M" end-time) "2020-12-08 16:00"))
                       (should (string= uid "iipdt88slddpeu7hheuu09sfmd@google.com"))
                       (should (not rsvp))
-                      (should (eq participation-type 'non-participant))))
+                      (should (eq participation-type 'required))))
       (setenv "TZ" tz))))
 
 (ert-deftest gnus-icalendary-byday ()


-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply related	[flat|nested] 12+ messages in thread

* bug#50749: 28.0.50; three gnus-icalendar issues w.r.t. RFC5546 and party crashers
  2021-10-01 12:15         ` Lars Ingebrigtsen
@ 2021-10-01 15:39           ` Alexandre Duret-Lutz
  2021-10-01 16:00             ` Alexandre Duret-Lutz
  0 siblings, 1 reply; 12+ messages in thread
From: Alexandre Duret-Lutz @ 2021-10-01 15:39 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 50749

Lars Ingebrigtsen <larsi@gnus.org> writes:
> I forgot to check whether there were any test regressions.

Sorry, I should have known better a looked for that.

> gnus-icalendar-parse fails, but the following change makes it pass.
>
> I'm not very familiar with this code -- was this change intended?
>
> diff --git a/test/lisp/gnus/gnus-icalendar-tests.el b/test/lisp/gnus/gnus-icalendar-tests.el
> index 90c3a34a5c..61fe9701fe 100644
> --- a/test/lisp/gnus/gnus-icalendar-tests.el
> +++ b/test/lisp/gnus/gnus-icalendar-tests.el
> @@ -103,7 +103,7 @@ gnus-icalendar-parse
>                        (should (string= (format-time-string "%Y-%m-%d %H:%M" end-time) "2020-12-08 16:00"))
>                        (should (string= uid "iipdt88slddpeu7hheuu09sfmd@google.com"))
>                        (should (not rsvp))
> -                      (should (eq participation-type 'non-participant))))
> +                      (should (eq participation-type 'required))))
>        (setenv "TZ" tz))))

Reading the test case, it looks like an event that does not list any
attendee.  So I'd expect 'non-participant.

Looks my third patch is wrong then.

In 

    (let* (...
           (role (or (plist-get (cadr attendee) 'ROLE) "REQ-PARTICIPANT"))

I meant to set REQ-PARTICIPANT only when the attendee list is non-empty
but the 'ROLE property is not found (= I have been listed as an attendee
of the event without being given a role).  But the above code will set
REQ-PARTICIPANT even if attendee is empty (= I'm not listed, as in the
test case).

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.





^ permalink raw reply	[flat|nested] 12+ messages in thread

* bug#50749: 28.0.50; three gnus-icalendar issues w.r.t. RFC5546 and party crashers
  2021-10-01 15:39           ` Alexandre Duret-Lutz
@ 2021-10-01 16:00             ` Alexandre Duret-Lutz
  2021-10-02  8:56               ` Lars Ingebrigtsen
  0 siblings, 1 reply; 12+ messages in thread
From: Alexandre Duret-Lutz @ 2021-10-01 16:00 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 50749

[-- 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


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* bug#50749: 28.0.50; three gnus-icalendar issues w.r.t. RFC5546 and party crashers
  2021-10-01 16:00             ` Alexandre Duret-Lutz
@ 2021-10-02  8:56               ` Lars Ingebrigtsen
  2021-10-02  8:56                 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 12+ messages in thread
From: Lars Ingebrigtsen @ 2021-10-02  8:56 UTC (permalink / raw)
  To: Alexandre Duret-Lutz; +Cc: 50749

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.

Thanks; applied to Emacs 28.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 12+ messages in thread

* bug#50749: 28.0.50; three gnus-icalendar issues w.r.t. RFC5546 and party crashers
  2021-10-02  8:56               ` Lars Ingebrigtsen
@ 2021-10-02  8:56                 ` Lars Ingebrigtsen
  0 siblings, 0 replies; 12+ messages in thread
From: Lars Ingebrigtsen @ 2021-10-02  8:56 UTC (permalink / raw)
  To: Alexandre Duret-Lutz; +Cc: 50749

Lars Ingebrigtsen <larsi@gnus.org> writes:

> Thanks; applied to Emacs 28.

Sorry; I meant Emacs 29.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2021-10-02  8:56 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2021-10-02  8:56               ` Lars Ingebrigtsen
2021-10-02  8:56                 ` Lars Ingebrigtsen
2021-09-24 14:35 ` Jan Tatarik

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).