<feed xmlns='http://www.w3.org/2005/Atom'>
<title>notmuch/lib/message.cc, branch 0.17_rc1</title>
<subtitle>thread-based email index, search, and tagging</subtitle>
<id>https://git.notmuchmail.org/git/notmuch/atom?h=0.17_rc1</id>
<link rel='self' href='https://git.notmuchmail.org/git/notmuch/atom?h=0.17_rc1'/>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/'/>
<updated>2013-09-03T23:41:51Z</updated>
<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>
<entry>
<title>lib: Move _filename_is_in_maildir</title>
<updated>2012-06-10T23:13:45Z</updated>
<author>
<name>Austin Clements</name>
<email>amdragon@MIT.EDU</email>
</author>
<published>2012-06-09T19:14:15Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=93ab4c7d119bb751c4d7297cb18a6f5eb50ae478'/>
<id>urn:sha1:93ab4c7d119bb751c4d7297cb18a6f5eb50ae478</id>
<content type='text'>
This way notmuch_message_maildir_flags_to_tags can call it.  It makes
more sense for this to be just above all of the maildir
synchronization code rather than mixed in the middle.
</content>
</entry>
<entry>
<title>lib: Don't needlessly create directory docs in _notmuch_message_remove_filename</title>
<updated>2012-05-24T01:32:12Z</updated>
<author>
<name>Austin Clements</name>
<email>amdragon@MIT.EDU</email>
</author>
<published>2012-05-18T04:13:42Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=d9f61c26a1344b123c1812392bc39c32634a099a'/>
<id>urn:sha1:d9f61c26a1344b123c1812392bc39c32634a099a</id>
<content type='text'>
Previously, if passed a filename with a directory that did not exist
in the database, _notmuch_message_remove_filename would needlessly
create that directory document.  Fix it so that doesn't happen.
</content>
</entry>
<entry>
<title>lib: Perform the same transformation to _notmuch_database_filename_to_direntry</title>
<updated>2012-05-24T01:30:43Z</updated>
<author>
<name>Austin Clements</name>
<email>amdragon@MIT.EDU</email>
</author>
<published>2012-05-18T04:13:36Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=67ae2377a9ec2da296a2e012352f962664a4d1a8'/>
<id>urn:sha1:67ae2377a9ec2da296a2e012352f962664a4d1a8</id>
<content type='text'>
Now _notmuch_database_filename_to_direntry takes a flags argument and
can indicate if the necessary directory documents do not exist.
Again, callers have been updated, but retain their original behavior.
</content>
</entry>
<entry>
<title>tags_to_maildir_flags: Cleanup double assignement</title>
<updated>2011-11-22T00:32:32Z</updated>
<author>
<name>Louis Rilling</name>
<email>l.rilling@av7.net</email>
</author>
<published>2011-09-14T22:23:19Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=b9360be2bd4d2db379cd701d4091420ce53cb564'/>
<id>urn:sha1:b9360be2bd4d2db379cd701d4091420ce53cb564</id>
<content type='text'>
The for loop right after already does the job.

Signed-off-by: Louis Rilling &lt;l.rilling@av7.net&gt;
</content>
</entry>
</feed>
