From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alexandre Duret-Lutz Newsgroups: gmane.emacs.bugs 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 Message-ID: <87czood9bf.fsf@lrde.epita.fr> References: <87czozag28.fsf@lrde.epita.fr> <875yurvu6d.fsf@gnus.org> <877df69773.fsf@lrde.epita.fr> <87lf3ltre9.fsf@gnus.org> <87v92hcg8x.fsf@lrde.epita.fr> <874ka1x7or.fsf@gnus.org> <87h7e0da9o.fsf@lrde.epita.fr> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21042"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: 50749@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Oct 01 18:04:21 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mWL1I-0005AR-9d for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 01 Oct 2021 18:04:20 +0200 Original-Received: from localhost ([::1]:38758 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mWL1G-0006nN-K1 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 01 Oct 2021 12:04:18 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39632) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mWKy7-00022v-Eu for bug-gnu-emacs@gnu.org; Fri, 01 Oct 2021 12:01:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:45631) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mWKy6-0005Mw-0d for bug-gnu-emacs@gnu.org; Fri, 01 Oct 2021 12:01:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mWKy5-00023l-R8 for bug-gnu-emacs@gnu.org; Fri, 01 Oct 2021 12:01:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alexandre Duret-Lutz Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 01 Oct 2021 16:01:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50749 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 50749-submit@debbugs.gnu.org id=B50749.16331040337868 (code B ref 50749); Fri, 01 Oct 2021 16:01:01 +0000 Original-Received: (at 50749) by debbugs.gnu.org; 1 Oct 2021 16:00:33 +0000 Original-Received: from localhost ([127.0.0.1]:57177 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mWKxc-00022q-Vp for submit@debbugs.gnu.org; Fri, 01 Oct 2021 12:00:33 -0400 Original-Received: from smtp.lrde.epita.fr ([91.243.117.225]:34966) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mWKxX-00022U-Nz for 50749@debbugs.gnu.org; Fri, 01 Oct 2021 12:00:31 -0400 Original-Received: from goulash (goulash.lrde.epita.fr [192.168.101.25]) by smtp.lrde.epita.fr (Postfix) with ESMTPSA id 265B543427; Fri, 1 Oct 2021 18:00:21 +0200 (CEST) In-Reply-To: <87h7e0da9o.fsf@lrde.epita.fr> (Alexandre Duret-Lutz's message of "Fri, 01 Oct 2021 17:39:47 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:216063 Archived-At: --=-=-= Content-Type: text/plain Alexandre Duret-Lutz 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. --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-missing-attendees-are-not-REQ-PARTICIPANT.patch >From 3d0f1809109f6d1450ba9f93e1fd866312fb2f38 Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz 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 --=-=-=--