aboutsummaryrefslogtreecommitdiff
path: root/message.c
AgeCommit message (Collapse)Author
2009-10-20Rename private notmuch_message_t to notmuch_message_file_tCarl Worth
This is in preparation for a new, public notmuch_message_t. Eventually, the public notmuch_message_t is going to grow enough features to need to be file-backed and will likely need everything that's now in message-file.c. So we may fold these back into one object/implementation in the future.
2009-10-20message: Use g_hash_table_destroy instead of g_hash_table_unrefCarl Worth
I'm trying to chase down 3 still-reachable pointers to glib hash tables. This change didn't help with that, but I think destroy might be a better semantic match for what I actually want. (It shouldn't matter though since I never take any additional references.)
2009-10-20message.c: Free leaked memory in notmuch_message objectCarl Worth
We were careful to free this memory when we finished parsing the headers, but we missed it for the case of closing the message without ever parsing all of the headers.
2009-10-20notmuch_message_get_header: Fix bogus return of NULL header.Carl Worth
A simple bug meant that the correct value was being inserted into the hash table, but a NULL value would be returned in some cases. (If the value was already in the hash table at the beginning of the call the the correct value would be returned, but if the function had to parse to reach it then it would return NULL.) This was tripping up the recently-added code to ignore messages with NULL From:, Subject:, and To: headers, (which is fortunate since otherwise the broken parsing might have stayed hidden for longer).
2009-10-19notmuch: Ignore files that don't look like email messages.Carl Worth
This is helpful for things like indexes that other mail programs may have left around. It also means we can make the initial instructions much easier, (the user need not worry about moving away auxiliary files from some other email program).
2009-10-19Rework message parsing to use getline rather than mmap.Carl Worth
The line-based parsing can be a bit awkward when wanting to peek ahead, (say, for folded header values), but it's so convenient to be able to trust that a string terminator exists on every line so it cleans up the code considerably.
2009-10-19Don't hash headers we won't end up using.Carl Worth
Just saving a little work here.
2009-10-19Document which pieces of glib we're still using.Carl Worth
Looks like we can copy in a hash-table implementation, (from cairo, say), and then a few _ascii_ functions from glib, (we'll need to switch a few current uses if things like isspace, etc. to locale- independent versions as well). So not too hard to free ourselves of glib for now, (until we add GMime back in later, of course).
2009-10-19notmuch: Switch from gmime to custom, ad-hoc parsing of headers.Carl Worth
Since we're currently just trying to stitch together In-Reply-To and References headers we don't need that much sophistication. It's when we later add full-text searching that GMime will be useful. So for now, even though my own code here is surely very buggy compared to GMime it's also a lot faster. And speed is what we're after for the initial index creation.