#include "mutt.h"
#include "sort.h"
+#include "thread.h"
#include "lib/mem.h"
#include "lib/intl.h"
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;
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);
+}