X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=thread.c;h=36ed25e229088736f0ce3481ae1d64c6ee73d65f;hp=bdd676e54ea000cb474214afc56a6ff7d6e3681b;hb=ce31869e540c4f27d4a398482a44856f314883da;hpb=ba5e3af4ea19e1d20c80941c077039871ec84258 diff --git a/thread.c b/thread.c index bdd676e..36ed25e 100644 --- a/thread.c +++ b/thread.c @@ -13,6 +13,7 @@ #include "mutt.h" #include "sort.h" +#include "thread.h" #include "lib/mem.h" #include "lib/intl.h" @@ -512,7 +513,7 @@ void mutt_clear_threads (CONTEXT * ctx) hash_destroy (&ctx->thread_hash, free); } -int compare_threads (const void *a, const void *b) +static int compare_threads (const void *a, const void *b) { static sort_t *sort_func = NULL; @@ -1258,7 +1259,7 @@ static void clean_references (THREAD * brk, THREAD * cur) if (done) { HEADER *h = cur->message; - /* clearing the References: header from obsolete Message-Id(s) */ + /* clearing the References: header from obsolete Message-ID(s) */ mutt_free_list (&ref->next); h->env->refs_changed = h->changed = 1; @@ -1304,3 +1305,24 @@ int mutt_link_threads (HEADER * cur, HEADER * last, CONTEXT * ctx) return changed; } + +void mutt_adjust_subject (ENVELOPE* e) { + regmatch_t pmatch[1]; + + if (e && e->subject) { + if (regexec (ReplyRegexp.rx, e->subject, 1, pmatch, 0) == 0) + e->real_subj = e->subject + pmatch[0].rm_eo; + else + e->real_subj = e->subject; + } +} + +void mutt_adjust_all_subjects (void) { + int i = 0; + + if (!Context || !Context->msgcount) + return; + + for (i = 0; i < Context->msgcount; i++) + mutt_adjust_subject (Context->hdrs[i]->env); +}