mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-29 06:04:11 +01:00
Export _parse_message_id to the library implementation.
Not exported through the public interface, but the thread code is going to want to be able to parse In-Reply-To headers so needs access to this code.
This commit is contained in:
parent
54be14098b
commit
9b1c6c250b
2 changed files with 8 additions and 5 deletions
|
@ -312,8 +312,8 @@ skip_space_and_comments (const char **str)
|
||||||
* Returns a newly talloc'ed string belonging to 'ctx'.
|
* Returns a newly talloc'ed string belonging to 'ctx'.
|
||||||
*
|
*
|
||||||
* Returns NULL if there is any error parsing the message-id. */
|
* Returns NULL if there is any error parsing the message-id. */
|
||||||
static char *
|
char *
|
||||||
parse_message_id (void *ctx, const char *message_id, const char **next)
|
_parse_message_id (void *ctx, const char *message_id, const char **next)
|
||||||
{
|
{
|
||||||
const char *s, *end;
|
const char *s, *end;
|
||||||
char *result;
|
char *result;
|
||||||
|
@ -383,7 +383,7 @@ parse_references (void *ctx,
|
||||||
return;
|
return;
|
||||||
|
|
||||||
while (*refs) {
|
while (*refs) {
|
||||||
ref = parse_message_id (ctx, refs, &refs);
|
ref = _parse_message_id (ctx, refs, &refs);
|
||||||
|
|
||||||
if (ref)
|
if (ref)
|
||||||
g_hash_table_insert (hash, ref, NULL);
|
g_hash_table_insert (hash, ref, NULL);
|
||||||
|
@ -710,7 +710,7 @@ _notmuch_database_link_message_to_parents (notmuch_database_t *notmuch,
|
||||||
in_reply_to = notmuch_message_file_get_header (message_file, "in-reply-to");
|
in_reply_to = notmuch_message_file_get_header (message_file, "in-reply-to");
|
||||||
parse_references (message, parents, in_reply_to);
|
parse_references (message, parents, in_reply_to);
|
||||||
_notmuch_message_add_term (message, "replyto",
|
_notmuch_message_add_term (message, "replyto",
|
||||||
parse_message_id (message, in_reply_to, NULL));
|
_parse_message_id (message, in_reply_to, NULL));
|
||||||
|
|
||||||
keys = g_hash_table_get_keys (parents);
|
keys = g_hash_table_get_keys (parents);
|
||||||
for (l = keys; l; l = l->next) {
|
for (l = keys; l; l = l->next) {
|
||||||
|
@ -886,7 +886,7 @@ notmuch_database_add_message (notmuch_database_t *notmuch,
|
||||||
|
|
||||||
header = notmuch_message_file_get_header (message_file, "message-id");
|
header = notmuch_message_file_get_header (message_file, "message-id");
|
||||||
if (header) {
|
if (header) {
|
||||||
message_id = parse_message_id (message_file, header, NULL);
|
message_id = _parse_message_id (message_file, header, NULL);
|
||||||
/* So the header value isn't RFC-compliant, but it's
|
/* So the header value isn't RFC-compliant, but it's
|
||||||
* better than no message-id at all. */
|
* better than no message-id at all. */
|
||||||
if (message_id == NULL)
|
if (message_id == NULL)
|
||||||
|
|
|
@ -147,6 +147,9 @@ typedef enum _notmuch_private_status {
|
||||||
const char *
|
const char *
|
||||||
_find_prefix (const char *name);
|
_find_prefix (const char *name);
|
||||||
|
|
||||||
|
char *
|
||||||
|
_parse_message_id (void *ctx, const char *message_id, const char **next);
|
||||||
|
|
||||||
/* thread.cc */
|
/* thread.cc */
|
||||||
|
|
||||||
notmuch_thread_t *
|
notmuch_thread_t *
|
||||||
|
|
Loading…
Reference in a new issue