Authentication-Results: mail-b.sr.ht; dkim=pass header.d=poldrack.dev header.i=@poldrack.dev Received: from mail.moritz.sh (mail.moritz.sh [202.61.225.209]) by mail-b.sr.ht (Postfix) with ESMTPS id A28E211EEC2 for <~rjarry/aerc-devel@lists.sr.ht>; Sat, 20 Aug 2022 07:34:21 +0000 (UTC) X-Virus-Scanned: Yes Content-Type: multipart/signed; boundary=e6dce83e6a6012a10b7df630f04dc5b0f3321beabb68ca3e2cae9e1a2aa6; micalg=pgp-sha256; protocol="application/pgp-signature" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=poldrack.dev; s=mail; t=1660980633; bh=psylzK2HQ9H1y5NeEEFCBG/LtcTT2Nxn8l3S2C29WYk=; h=From:To:Subject:References:In-Reply-To; b=JJH80PxkZxGtjjqu7cuuXR/pNIGjWVhYpTd7FiGlI0PCEdXfY2Mr0lOZQLlo5rfgC vwycp/K8xKYBOsEAmCvu8FgdgPEYIfbkTkD7YBBNQarQ7/+Xv/eWUv7IMvYT/4WF0T UEjfrR2BQhR7DnrxjgkEI5AgsAb7I/aB9zsbW4+isLdELJIgpIpCJfejd4N8pEckHt XjnkAErv5abffwNOExgo9KAflTXBN0wBN2jQrckmqguGHHBjvWe74AF+epTofBjRDs tlJNmU1tpL33BI3/2/OnouTFOFWLxZ0E/qYRy5DsAaoLXzZRH7dBvkvBIutUIOl7Bj nq1WCJ+6Hf7fiH9aBQ8PoTIev9F/BGHVDAPvSgDHwFhxvhmMXAbkWYBwcLltcdO9i1 uPsOhzBn9tn94b5OnEibZ1W+hUc2XfGDtXlEErS64xjYJNJhRTRehVk7snEKXpQHUI fkuiNJPBkErl+0lk8wqHwSLBCPJrNzKLzW2PTfk2i/wAFH16g6kpKmL31Ajikz1M14 NjErlEGTEqXqI9A25MdJda9xasAjufFgEPnOGfJ7OGyVoaZBY/W0aQAEMadeKNOIlZ red4HyBMkaRH+1xDHJLM10gEDFseI2oIEDuXF0wkJqtBRcvkk22B+RtNoB0F1ypy4E wSb2tibfVbmHcreN5duED4Sg= From: "Moritz Poldrack" To: "James Cook" , <~rjarry/aerc-devel@lists.sr.ht> Subject: Re: [PATCH aerc] Use IMAP PEEK and allow not marking messages read. Date: Sat, 20 Aug 2022 09:29:17 +0200 Message-Id: X-Greeting: Hi mom! Look, I'm in somebodys mail client! References: <20220820002218.43914-1-falsifian@falsifian.org> In-Reply-To: <20220820002218.43914-1-falsifian@falsifian.org> --e6dce83e6a6012a10b7df630f04dc5b0f3321beabb68ca3e2cae9e1a2aa6 Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 On Sat Aug 20, 2022 at 2:22 AM CEST, James Cook wrote: > This commit adds a new configuration option, auto-mark-read, which > defaults to true. When set to false, emails are not marked as seen when > viewed. > > We also fetch BODY.PEEK[...] instead of BODY when fetching messages with > IMAP. This means messages are only marked as read when we deliberately > set the flag (which we automatically anyway, as long as > auto-mark-read=3Dtrue). > > I imagine before this change the export-mbox command caused all messages > in an IMAP folder to be marked as seen. > > Fixes: https://todo.sr.ht/~rjarry/aerc/48 > Signed-off-by: James Cook > > Squashed commit of the following: > > commit 9ca6eda82438c0ee0836afb91ec2be9cdce2b393 > Author: James Cook > Date: Fri Aug 19 23:51:26 2022 +0000 > > Use PEEK with IMAP. > > commit a49578363c989825fd2e1af1e404adcc8cf60d5a > Author: James Cook > Date: Fri Aug 19 22:55:48 2022 +0000 > > Post-merge fix: Pass UI config. > > commit b13b7be79c85a408dcb6c509fb7b6284e29ff9ee > Merge: 8bfe752 1b91b68 > Author: James Cook > Date: Fri Aug 19 22:50:05 2022 +0000 > > Merge branch 'master' into unread > > commit 8bfe752c2807efaf37507c87fe00a568239e23b7 > Author: James Cook > Date: Tue Jul 5 05:38:38 2022 +0000 > --- Thanks for your patchset, could you please remove what temporary commits made it from the commit message? > commands/account/view.go | 2 +- > commands/msg/delete.go | 1 + > commands/msg/recall.go | 2 +- > commands/msgview/next.go | 2 +- > config/aerc.conf | 6 ++++++ > config/config.go | 2 ++ > doc/aerc-config.5.scd | 5 +++++ > lib/messageview.go | 7 +++++-- > widgets/msglist.go | 2 +- > worker/imap/fetch.go | 5 ++++- > 10 files changed, 27 insertions(+), 7 deletions(-) > > diff --git a/worker/imap/fetch.go b/worker/imap/fetch.go > index f21c6e9..0d2bb16 100644 > --- a/worker/imap/fetch.go > +++ b/worker/imap/fetch.go > @@ -91,6 +91,7 @@ func (imapw *IMAPWorker) handleFetchMessageBodyPart( > partHeaderSection.Path =3D msg.Part > =20 > var partBodySection imap.BodySectionName > + partBodySection.Peek =3D true > if len(msg.Part) > 0 { > partBodySection.Specifier =3D imap.EntireSpecifier > } else { > @@ -150,7 +151,9 @@ func (imapw *IMAPWorker) handleFetchFullMessages( > msg *types.FetchFullMessages, > ) { > logging.Infof("Fetching full messages: %v", msg.Uids) > - section :=3D &imap.BodySectionName{} > + section :=3D &imap.BodySectionName{ > + Peek: true, Would it be useful to set this value (and the above partBodySection.Peek) to only peek when needed? This way we'd use the most appropriate method for getting the body. I fail to find a satisfactory answer in your follow up email. > + } > items :=3D []imap.FetchItem{ > imap.FetchEnvelope, > imap.FetchFlags, > --=20 > 2.37.2 --e6dce83e6a6012a10b7df630f04dc5b0f3321beabb68ca3e2cae9e1a2aa6 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJIBAABCAAyFiEEM9A2ln/PD3ETNLB5aoj0JQirT8YFAmMAjnkUHG1vcml0ekBw b2xkcmFjay5kZXYACgkQaoj0JQirT8aP/hAAmt/sOWdO1Zk0J7xBmUWMWTc+qG/M IIfiI4Ge6h2f7UyHY8jyj4hWlByeNEnS/pzWakhYQOXKt4RGEdh5DaGQpwFzKXJG 8C8lBm+UwDTrQGN+F6DBswj/9dHCL64fN4KFYkn+iNmVM408E9AuXFTNDDsahBCc yX8rr9OUBP0EGMxmJ+9flT4xLMeM3Kp4h3TFgfXkCKob/ygQG5ltqD58k+4TxU5y lGJIBp/rsLXl0BpIYNw+YFd9InfiKs/T1DBHnqSnCicyus/Bwqe65QR776IOwgfJ 51Ztl9D1CzXfT+H204hO0CwrpRIdYwEv5q3HO+3C4Hch0yEJbjXWcciV2IYDf8M8 MF/8z3p5nFbtHfXc80miRhVqprxfg2xgDB4I9GkbirE8BIf2pYW1CBSKIrzxqoBI hrPskieOPzlePQ8qTtl9NstFvwVGPAv8gdIqH4a7f91741+r/p4f7YaTCq+9s2H4 VGkRAiLymS8wE3YA4/FnsvihuTpmUrDj2A4u4pKh8ImFcgot3sDteYa7sSs+qE5R jThjkqTy6tBO+Wjo6961imOk1tA/xEqegv/BCvCynzZwOvXgxuJbmPmHR3NV4hyW 7OxMzv525JH3/MqxyGZuXrDmvwOLPuhf7/0c3Z/eb5xh86xt3WLVW6a0npgNtWCa zBeMlxGX2Xqq3q4= =dmkC -----END PGP SIGNATURE----- --e6dce83e6a6012a10b7df630f04dc5b0f3321beabb68ca3e2cae9e1a2aa6--