Authentication-Results: mail-b.sr.ht; dkim=pass header.d=timculverhouse.com header.i=@timculverhouse.com; dkim=pass header.d=messagingengine.com header.i=@messagingengine.com Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by mail-b.sr.ht (Postfix) with ESMTPS id 01D4D11EE06 for <~rjarry/aerc-devel@lists.sr.ht>; Sun, 10 Jul 2022 17:26:09 +0000 (UTC) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id AD52C5C00AF; Sun, 10 Jul 2022 13:26:07 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Sun, 10 Jul 2022 13:26:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= timculverhouse.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:references:reply-to:sender :subject:subject:to:to; s=fm1; t=1657473967; x=1657560367; bh=no 6eX6Mjm/qumpdbcXamUA/3fc6ixvQDBs1fCUjgvH8=; b=wtwUadmjU2Hyuos5Rt s2MVCieSYrv32Fpk83Wwa2mGa0D1+W7YFpVOXXTwf3VLwFrQStXiEJX5VIwQHa4m BeIwBYfyuMEuArL3IB97g6d+LeLDHUhhok6HPQVvbK48Q0VPCi4vNwVBA+e3k7sr rsmOghSMU4JOPqk5AkmAUGUmPm4aK7VjkAOq86O3CdpmLGA9oGiYoGgYamQydBOB D9ACn3xr+9+3n9BmX0fhZvZCFOw5Uq6LeGtfr146QQD2XCyMpax5y42yC2Eif9fo l+NVROM45g1buen528wKWty1X+wtz6gMa49q+XQfi58ygCrMOtQwi90PMMXPBMU+ +znw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1657473967; x=1657560367; bh=no6eX6Mjm/qumpdbcXamUA/3fc6ixvQDBs1 fCUjgvH8=; b=24Q7o/rnqiSMnt3dfOLuq3Rjy8LLcKPq/a39M+2d+tYHqqa3VLP 7+fpCo+aqtcu86TK3zzmkBh3kv9NXQxsY70KqgSuYjcOo2kPN0Rx2M75s8lkSZsu 2EDHpWHCcoyIGjKJnauFt1Sg0dqJ+8p0ZnSLXy8+6TJB6VK59BvVVAby7zWngKld KDmCXPKYhMdqFEu4axa2pryJKLDVQapH2gnLM5bq7ASnugp2+iPJz8teDN8RAVUz kbHrtHM7Vf072wFt9LYaylBlFapynWt/DnP5m5xpwDdy7ZsvAof8tjftFFhc35Kf WnjD6K2S7W2HDwZk5MljfBmilqHYmabS8VQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrudejuddgudduhecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpegtfffkuffhvffofhgjveesghdtreerredtjeenucfhrhhomhepfdfvihhm ucevuhhlvhgvrhhhohhushgvfdcuoehtihhmsehtihhmtghulhhvvghrhhhouhhsvgdrtg homheqnecuggftrfgrthhtvghrnheptddttdefvdegieetveejkeekfeehieettdefgfef veetgefghefhfeejueegvddvnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpe hmrghilhhfrhhomhepthhimhesthhimhgtuhhlvhgvrhhhohhushgvrdgtohhm X-ME-Proxy: Feedback-ID: i3ad947a1:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 10 Jul 2022 13:26:07 -0400 (EDT) Content-Type: multipart/signed; boundary=b71e20569b855edcae31063bd2107e9e4dea14c830ae627f4da73ad6bd2b; micalg=pgp-sha256; protocol="application/pgp-signature" Date: Sun, 10 Jul 2022 12:26:05 -0500 Message-Id: Subject: Re: [PATCH aerc] Allow not marking viewed messages as seen. From: "Tim Culverhouse" To: "James Cook" , "Moritz Poldrack" , <~rjarry/aerc-devel@lists.sr.ht> X-Mailer: aerc 0.10.0-55-g97a20fc References: <20220705060618.68685-1-falsifian@falsifian.org> In-Reply-To: Cc: --b71e20569b855edcae31063bd2107e9e4dea14c830ae627f4da73ad6bd2b Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 On Sun Jul 10, 2022 at 11:34 AM CDT, James Cook wrote: > I can try adding the change to unset \Seen myself, but probably won't > have time until next weekend, so if you or someone else wants to do the > work, please go ahead. (We could also just say the setting is not > supported with IMAP.) First, I think we should support the feature for all workers. Second, I really think an approach like below is best. In both cases, it's = only one call to the imap server and is very few lines of code to implement. diff --git a/worker/imap/fetch.go b/worker/imap/fetch.go index 7d7b72f..5beb886 100644 --- a/worker/imap/fetch.go +++ b/worker/imap/fetch.go @@ -96,6 +96,9 @@ func (imapw *IMAPWorker) handleFetchMessageBodyPart( partBodySection.Specifier =3D imap.TextSpecifier } partBodySection.Path =3D msg.Part + if msg.Peek { + partBodySection.Peek =3D true + } =20 items :=3D []imap.FetchItem{ imap.FetchEnvelope, @@ -150,6 +153,9 @@ func (imapw *IMAPWorker) handleFetchFullMessages( =20 imapw.worker.Logger.Printf("Fetching full messages") section :=3D &imap.BodySectionName{} + if msg.Peek { + section.Peek =3D true + } items :=3D []imap.FetchItem{ imap.FetchEnvelope, imap.FetchFlags, diff --git a/worker/types/messages.go b/worker/types/messages.go index e303ade..67658c5 100644 --- a/worker/types/messages.go +++ b/worker/types/messages.go @@ -125,12 +125,14 @@ type FetchMessageHeaders struct { type FetchFullMessages struct { Message Uids []uint32 + Peek bool } =20 type FetchMessageBodyPart struct { Message Uid uint32 Part []int + Peek bool } =20 type FetchMessageFlags struct { --b71e20569b855edcae31063bd2107e9e4dea14c830ae627f4da73ad6bd2b Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEPEbs97ymvqQFTi1YPNHFcmbSSHIFAmLLC64ACgkQPNHFcmbS SHKvdA//QLJt2iXILAidTtF5wMC56YAwsxi3Urvfo+Pzv46L326MYp+5cRQEjM5D BpNehtHZ2IhGjVwcWgdsaGAhuesqQ87fxutOhZUiGKNw8ROOihWx0PgvRdA14VR4 lHPMMMRRp4fL+8y6lpjExYdoxBPnJvEKBXDW59Z3eayzwW/5m75Bbjf5SrGNPDoT Gmnc87dWP2In96PmUt463PiwPaTy1m2YW+b0X2sAy+0NUMSZj1DjOshzuXgAdZQL 9pqE7rqfcOGWaQ9qP8nA3far7CHjw2PIPX9PaZOwf5+06/AvGM9PCsFa/d39Aa9H M1WxU2iWrepNflnk47gcygdBnfBiRqrcinuSv1by2xZmZnxxnXPiSEn5rTQxn2fR 77pv7xbKHc4taI5mLH090bu2HjWhxlnK7rvBgXgAXglCXnmMvQmqDlvRi/GYVJf3 S+lviwj72ey/0hVYW0XTDAzobjmMVl1p1oKD+CARPo9ieOKmmAigBmXG58/wBWKs S2gXHUyQEmvUd3rMShvMndOsNiG5pPWRizin1CGFbKCS2dKQ+pmng6Cu9BcIk5BZ T2nnUvJ68Uewm27lMCeEGZ2zzmNJU5a7bWIdCN5ikWyeb17SXBfH677LVQF4gdQR UmWyAN/fab6H0jmQjMvFlLjKmBBtGLeT68jLiCPlscgcG3y/QC4= =dAyk -----END PGP SIGNATURE----- --b71e20569b855edcae31063bd2107e9e4dea14c830ae627f4da73ad6bd2b--