Don Zickus [Fri, 11 Oct 2013 18:34:57 +0000 (11:34 -0700)]
mutt, Update 'unread' tag for all files mapped to msg
I ran into an issue where I would read an email in my inbox that was
sent to me and cc'd a mailing list and it would not remove the 'unread'
tag after syncing the mailbox.
Apparently, when nm_synci'ing the message, the local inbox copy would be
recognized as seen but the duplicate copy in the mailing list folder
would still be in the 'new' directory, so the 'unread' flag would not
be cleared.
The way the 'duplicate' messags where handled in 'rename_filename', it
appears after the add/remove the local copy of 'msg' was not updated
with the new paths. I fixed this by destorying the message and then
re-reading it from the notmuch database.
However, the tags were still off. I had to further call
'update_header_flags' to re-read the tags from the database (using
the updated paths) to clear the 'unread' tag.
Both of these changes seem to work as expected now.
Signed-off-by: Don Zickus <dzickus@redhat.com>
--
I am not too familar with this code, so my changes may not be
correct. I do know they seem to work after a couple of days of
testing.
fix getting count of new messages for non-trivial query
Currtly, we ask for count of new messages by appending tag:unread (or
whatever NotmuchUnreadTag has) to db query. It works if your query is
very simple: no 'OR', 'NOT', etc.
If you will ask new messages for query like
"to:foo@example.com or to:bar@example.net"
mutt will query db for count of
"to:foo@example.com or to:bar@example.net tag:unread"
and notmuch will understand it as
"to:foo@example.com or (to:bar@example.net tag:unread)"
which, obviously, is not what you wanted.
Optimizations like
if (strstr(db_query, NotmuchUnreadTag))
*new = all ? *all : count_query(db, db_query);
doesn't work for the same reason.
Let's fix all this by construct query with proper parenthesis:
"(to:foo@example.com or to:bar@example.net) tag:unread"
Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
Karel Zak [Mon, 14 Oct 2013 18:34:57 +0000 (11:34 -0700)]
add CH_VIRTUAL to allow to specify when use virtual headers
For example don't add "Tags:" header to the message when copy the
message to another folder. The virtual headers make sense only when
we display the message to user.
Karel Zak [Mon, 7 Oct 2013 18:34:57 +0000 (11:34 -0700)]
always use notmuch message ID
It's better to use notmuch message Id than rely on Id from parsed
message, because notmuch ensures that Id exists and it generates
a fake Id for broken messages without the Id.
Reported-by: Michael Zeltner <m@niij.org> Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Tue, 22 Oct 2013 18:34:57 +0000 (11:34 -0700)]
add nm_exclude_tags
Based on patch from: Raghavendra D Prabhu <rprabhu@wnohang.net>
This makes use of notmuch_query_add_tag_exclude in notmuch API, to
exclude messages tagged with tags from nm_exclude_tags from query
results by default unless specified explicitly.
Signed-off-by: Raghavendra D Prabhu <rprabhu@wnohang.net> Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Mon, 17 Sep 2012 07:31:54 +0000 (09:31 +0200)]
fix corrupt viewing of messages
The mutt records offset of email body when parse email header.
Unfortunately when we check notmuch DB changes when we don't ask for
email path in the same way. So it's possible that for emails that are
stored in multiple folders (you sent the same email with the same ID
to multiple mailing lists) we get a different path, then notmuch mutt
code updates the path, but no the offset... result is corrupted body.
David Sterba [Sat, 8 Sep 2012 07:31:54 +0000 (09:31 +0200)]
hide signed and encrypted tags by default
Mutt shows signed/encrypted status in another way and occupies only 1
char in index line. Hide the tags by default and leave more space for
other tags.
Tim Stoakes [Sat, 22 Sep 2012 07:31:54 +0000 (09:31 +0200)]
Plug a leaked notmuch DB handle in get_count()
nm_nonctx_get_count() was leaking its notmuch database handle if NOTMUCH_API_3
was in use. Looks like it missed the same treatment that the other call sites
got to do this.
Tim Stoakes [Sun, 16 Sep 2012 07:31:54 +0000 (09:31 +0200)]
Fix auto_tag=yes for modify-labels* and quasi-delete
When 'auto_tag' was 'yes', <modify-labels>* and <quasi-delete> still only
applied to the currently-selected message. Now they apply to all tagged
messages, as they should.
Luke Macken [Tue, 10 Apr 2012 15:25:31 +0000 (11:25 -0400)]
fix a bug with processing mailboxes when they are all virtual.
This bug occurs when there are only virtual mailboxes defined. Prior to this
change, the sidebar descriptions of the virtual mailboxes would be displayed as
the notmuch query itself, as opposed to the user-defined description.
David Sterba [Mon, 2 Apr 2012 21:28:18 +0000 (23:28 +0200)]
build-sys: fix compilation without --enable-notmuch
We can still leave mutt-kz compilable entirely without notmuch, just for the
case there are users out there not interested in notmuch enhancements, but I
seriously doubt that :)
Here's the patch which compiles fine without --enable-notmuch
Karel Zak [Wed, 14 Mar 2012 14:19:43 +0000 (15:19 +0100)]
add support for virtual folders, add sidebar-toggle command
* add support for virtual folders
* add sidebar-toggle function to toggle between virtual and normal
folders in sudebar
* virtual folders are used by default if 'virtual_spoolfile' is 'yes'
mutt_notmuch.c: In function ‘get_nm_message’:
mutt_notmuch.c:643:2: error: too few arguments to function ‘notmuch_database_find_message’
/usr/include/notmuch.h:371:1: note: declared here
make[2]: *** [mutt_notmuch.o] Error 1
The mutt-ks is made for notmuch version 0.8, but in version 0.9 the API
changed, in particular with this commit: