~sircmpwn/aerc

notmuch - Add support for new message notifications with a 'recent' tag. v1 PROPOSED

James Walmsley: 1
 notmuch - Add support for new message notifications with a 'recent' tag.

 2 files changed, 7 insertions(+), 0 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~sircmpwn/aerc/patches/16310/mbox | git am -3
Learn more about email & git
View this thread in the archives

[PATCH] notmuch - Add support for new message notifications with a 'recent' tag. Export this patch

- In .notmuch-config ensure new-mails have the 'recent' tag added.
`.notmuch-config`
```
[new]
tags=unread;inbox;recent
```
---
 worker/notmuch/message.go | 4 ++++
 worker/notmuch/worker.go  | 3 +++
 2 files changed, 7 insertions(+)

diff --git a/worker/notmuch/message.go b/worker/notmuch/message.go
index 82d00f3..4a7cd86 100644
--- a/worker/notmuch/message.go
+++ b/worker/notmuch/message.go
@@ -70,6 +70,8 @@ func (m *Message) SetFlag(flag models.Flag, enable bool) error {
	// Translate the flag into a notmuch tag, ignoring no-op flags.
	var tag string
	switch flag {
	case models.RecentFlag:
		tag = "recent"
	case models.SeenFlag:
		// Note: Inverted properly later
		tag = "unread"
@@ -152,6 +154,8 @@ func (m *Message) ModelFlags() ([]models.Flag, error) {
			flags = append(flags, models.FlaggedFlag)
		case "unread":
			seen = false
		case "recent":
			flags = append(flags, models.RecentFlag)
		default:
			continue
		}
diff --git a/worker/notmuch/worker.go b/worker/notmuch/worker.go
index 6281744..12f1f3c 100644
--- a/worker/notmuch/worker.go
+++ b/worker/notmuch/worker.go
@@ -536,6 +536,9 @@ func (w *worker) emitMessageInfo(m *Message,
	if err != nil {
		return fmt.Errorf("could not get MessageInfo: %v", err)
	}

	m.SetFlag(models.RecentFlag, false);

	w.w.PostMessage(&types.MessageInfo{
		Message: types.RespondTo(parent),
		Info:    info,
-- 
2.25.1