<feed xmlns='http://www.w3.org/2005/Atom'>
<title>notmuch/lib/message.cc, branch 0.18_rc1</title>
<subtitle>thread-based email index, search, and tagging</subtitle>
<id>https://git.notmuchmail.org/git/notmuch/atom?h=0.18_rc1</id>
<link rel='self' href='https://git.notmuchmail.org/git/notmuch/atom?h=0.18_rc1'/>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/'/>
<updated>2014-03-11T22:51:22Z</updated>
<entry>
<title>lib: make folder: prefix literal</title>
<updated>2014-03-11T22:51:22Z</updated>
<author>
<name>Jani Nikula</name>
<email>jani@nikula.org</email>
</author>
<published>2014-02-08T19:20:42Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=1fa8e40561aafb0ac4f51e0aba171a702b66fd86'/>
<id>urn:sha1:1fa8e40561aafb0ac4f51e0aba171a702b66fd86</id>
<content type='text'>
In xapian terms, convert folder: prefix from probabilistic to boolean
prefix, matching the paths, relative from the maildir root, of the
message files, ignoring the maildir new and cur leaf directories.

folder:foo matches all message files in foo, foo/new, and foo/cur.

folder:foo/new does *not* match message files in foo/new.

folder:"" matches all message files in the top level maildir and its
new and cur subdirectories.

This change constitutes a database change: bump the database version
and add database upgrade support for folder: terms. The upgrade also
adds path: terms.

Finally, fix the folder search test for literal folder: search, as
some of the folder: matching capabilities are lost in the
probabilistic to boolean prefix change.
</content>
</entry>
<entry>
<title>lib: add support for path: prefix searches</title>
<updated>2014-03-11T22:51:22Z</updated>
<author>
<name>Jani Nikula</name>
<email>jani@nikula.org</email>
</author>
<published>2014-02-08T18:50:44Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=59823f964250be6d0ddbdfc45d4b07803bab267d'/>
<id>urn:sha1:59823f964250be6d0ddbdfc45d4b07803bab267d</id>
<content type='text'>
The path: prefix is a literal boolean prefix matching the paths,
relative from the maildir root, of the message files.

path:foo matches all message files in foo (but not in foo/new or
foo/cur).

path:foo/new matches all message files in foo/new.

path:"" matches all message files in the top level maildir.

path:foo/** matches all message files in foo and recursively in all
subdirectories of foo.

path:** matches all message files recursively, i.e. all messages.
</content>
</entry>
<entry>
<title>lib: refactor folder term update after filename removal</title>
<updated>2014-03-11T22:51:22Z</updated>
<author>
<name>Jani Nikula</name>
<email>jani@nikula.org</email>
</author>
<published>2014-02-08T17:48:16Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=4d150eba6775d9c34276547c7ae248a8ec4e6107'/>
<id>urn:sha1:4d150eba6775d9c34276547c7ae248a8ec4e6107</id>
<content type='text'>
Abstract some blocks of code for reuse. No functional changes.
</content>
</entry>
<entry>
<title>lib: fix error handling</title>
<updated>2014-01-18T18:47:35Z</updated>
<author>
<name>Tomi Valkeinen</name>
<email>tomi.valkeinen@iki.fi</email>
</author>
<published>2013-11-19T05:10:31Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=075d53dde5446fefe121e548156901cf72f7f8e3'/>
<id>urn:sha1:075d53dde5446fefe121e548156901cf72f7f8e3</id>
<content type='text'>
Currently if a Xapian exception happens in notmuch_message_get_header,
the exception is not caught leading to crash. In
notmuch_message_get_date the exception is caught, but an internal error
is raised, again leading to crash.

This patch fixes the error handling by making both functions catch the
Xapian exceptions, print an error and return NULL or 0.

The 'notmuch-&gt;exception_reported' is also set, as is done elsewhere,
even if I don't really get the idea of that field.

Signed-off-by: Tomi Valkeinen &lt;tomi.valkeinen@iki.fi&gt;
</content>
</entry>
<entry>
<title>tags_to_maildir_flags: Don't rename if no flags change</title>
<updated>2013-09-03T23:41:51Z</updated>
<author>
<name>Louis Rilling</name>
<email>l.rilling@av7.net</email>
</author>
<published>2012-12-19T21:32:27Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=a9b2135c75874f871fa8e97c8fca965654577772'/>
<id>urn:sha1:a9b2135c75874f871fa8e97c8fca965654577772</id>
<content type='text'>
notmuch_message_tags_to_maildir_flags() unconditionally moves messages from
maildir directory "new/" to maildir directory "cur/", which makes messages lose
their "new" status in the MUA. However some users want to keep this "new"
status after, for instance, an auto-tagging of new messages.

However, as Austin mentioned and according to the maildir specification,
messages living in "new/" are not allowed to have flags, even if mutt allows it
to happen. For this reason, this patch prevents moving messages from "new/" to
"cur/", only if no flags have to be changed. It's hopefully enough to satisfy
mutt (and maybe other MUAs showing the "new" status) users checking the "new"
status.

Changelog:
* v2: Fix bool type as well as NULL returned despite having no errors (Austin
      Clements)
* v4: Tag the related test (contributed by Michal Sojka) as working

Signed-off-by: Louis Rilling &lt;l.rilling@av7.net&gt;

[Condition for keeping messages in new/ was extended to satisfy all
 tests from the previous patch. -Michal Sojka]

[Added by David Bremner, to keep the tests passing at each commit]

update insert tests for new maildir synchronization rules

As of id:1355952747-27350-4-git-send-email-sojkam1@fel.cvut.cz
we are more conservative about moving messages from ./new to ./cur.
This updates the insert tests to match
</content>
</entry>
<entry>
<title>lib/message.cc: stale pointer bug (v3)</title>
<updated>2013-05-04T00:17:56Z</updated>
<author>
<name>Vladimir Marek</name>
<email>vlmarek@volny.cz</email>
</author>
<published>2013-05-02T14:31:42Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=51b073c6f27f4439b2d003df1be1177365e555fe'/>
<id>urn:sha1:51b073c6f27f4439b2d003df1be1177365e555fe</id>
<content type='text'>
Xapian::TermIterator::operator* returns std::string which is destroyed
as soon as (*i).c_str() finishes. The remembered pointer 'term' then
references invalid memory.

Signed-off-by: Vladimir Marek &lt;vlmarek@volny.cz&gt;
</content>
</entry>
<entry>
<title>lib: Separate list of all messages from top-level messages</title>
<updated>2013-02-19T00:20:24Z</updated>
<author>
<name>Austin Clements</name>
<email>amdragon@MIT.EDU</email>
</author>
<published>2012-11-25T04:57:03Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=5394924e6cf8f4758fdfb748b8b28b7ef9165ce7'/>
<id>urn:sha1:5394924e6cf8f4758fdfb748b8b28b7ef9165ce7</id>
<content type='text'>
Previously, thread.cc built up a list of all messages, then
proceeded to tear it apart to transform it into a list of
top-level messages.  Now we simply build a new list of top-level
messages.

This simplifies the interface to _notmuch_message_add_reply,
eliminates the pointer acrobatics from
_resolve_thread_relationships, and will enable us to do things
with the list of all messages in the following patches.
</content>
</entry>
<entry>
<title>lib: fix warnings when building with clang</title>
<updated>2012-12-01T12:10:32Z</updated>
<author>
<name>Jani Nikula</name>
<email>jani@nikula.org</email>
</author>
<published>2012-10-01T07:36:11Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=5505d55515594025fe319c5150fdb360b0ffcd60'/>
<id>urn:sha1:5505d55515594025fe319c5150fdb360b0ffcd60</id>
<content type='text'>
Building notmuch with CC=clang and CXX=clang++ produces the warnings:

CC -O2 lib/tags.o
lib/tags.c:43:5: warning: expression result unused [-Wunused-value]
    talloc_steal (tags, list);
    ^~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/talloc.h:345:143: note: expanded from:
  ...__location__); __talloc_steal_ret; })
                    ^~~~~~~~~~~~~~~~~~
1 warning generated.

CXX -O2 lib/message.o
lib/message.cc:791:5: warning: expression result unused [-Wunused-value]
    talloc_reference (message, message-&gt;tag_list);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/talloc.h:932:36: note: expanded from:
  ...(_TALLOC_TYPEOF(ptr))_talloc_reference_loc((ctx),(ptr), __location__)
     ^                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.

Check talloc_reference() return value, and explicitly ignore
talloc_steal() return value as it has no failure modes, to silence the
warnings.
</content>
</entry>
<entry>
<title>lib: Treat messages in new/ as maildir messages with no flags set</title>
<updated>2012-06-10T23:14:56Z</updated>
<author>
<name>Austin Clements</name>
<email>amdragon@MIT.EDU</email>
</author>
<published>2012-06-09T19:14:17Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=b88030bda6da084ef74e41f588589fd98e773ad7'/>
<id>urn:sha1:b88030bda6da084ef74e41f588589fd98e773ad7</id>
<content type='text'>
Previously, notmuch new only synchronized maildir flags to tags for
files with a maildir "info" part.  Since messages in new/ don't have
an info part, notmuch would ignore them for flag-to-tag
synchronization.

This patch makes notmuch consider messages in new/ to be legitimate
maildir messages that simply have no maildir flags set.  The most
visible effect of this is that such messages now automatically get the
unread tag.
</content>
</entry>
<entry>
<title>lib: Only synchronize maildir flags for messages in maildirs</title>
<updated>2012-06-10T23:13:58Z</updated>
<author>
<name>Austin Clements</name>
<email>amdragon@MIT.EDU</email>
</author>
<published>2012-06-09T19:14:16Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=750231bae8a0bdb3273c2f9a74da14327fbc5d52'/>
<id>urn:sha1:750231bae8a0bdb3273c2f9a74da14327fbc5d52</id>
<content type='text'>
Previously, we synchronized flags to tags for any message that looked
like it had maildir flags in its file name, regardless of whether it
was in a maildir-like directory structure.  This was asymmetric with
tag-to-flag synchronization, which only applied to messages in
directories named new/ and cur/ (introduced by 95dd5fe5).

This change makes our interpretation stricter and addresses this
asymmetry by only synchronizing flags to tags for messages in
directories named new/ or cur/.  It also prepares us to treat messages
in new/ as maildir messages, even though they lack maildir flags.
</content>
</entry>
</feed>
