From: pdmef Date: Mon, 7 Mar 2005 15:14:42 +0000 (+0000) Subject: Rocco Rutte: X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=commitdiff_plain;h=293606da1420e7020c068b0f311fa82a2b4f755d Rocco Rutte: fix editing threads for imap (patch by Thomas Glanzmann) git-svn-id: svn://svn.berlios.de/mutt-ng/trunk@151 e385b8ad-14ed-0310-8656-cc95a2468c6d --- diff --git a/copy.c b/copy.c index 49e19d7..3ce0f2e 100644 --- a/copy.c +++ b/copy.c @@ -379,15 +379,10 @@ mutt_copy_header (FILE *in, HEADER *h, FILE *out, int flags, const char *prefix) if (flags & CH_UPDATE) { if ((flags & CH_NOSTATUS) == 0) -#ifdef IMAP_EDIT_THREADS -#define NEW_ENV new_env -#else -#define NEW_ENV env -#endif { - if (h->irt_changed && h->NEW_ENV->in_reply_to) + if (h->irt_changed && h->new_env->in_reply_to) { - LIST *listp = h->NEW_ENV->in_reply_to; + LIST *listp = h->new_env->in_reply_to; if (fputs ("In-Reply-To: ", out) == EOF) return (-1); @@ -400,9 +395,9 @@ mutt_copy_header (FILE *in, HEADER *h, FILE *out, int flags, const char *prefix) return (-1); } - if (h->refs_changed && h->NEW_ENV->references) + if (h->refs_changed && h->new_env->references) { - LIST *listp = h->NEW_ENV->references, *refs = NULL, *t; + LIST *listp = h->new_env->references, *refs = NULL, *t; if (fputs ("References: ", out) == EOF) return (-1); @@ -427,7 +422,6 @@ mutt_copy_header (FILE *in, HEADER *h, FILE *out, int flags, const char *prefix) if (fputc ('\n', out) == EOF) return (-1); } -#undef NEW_ENV if (h->old || h->read) { diff --git a/curs_main.c b/curs_main.c index 28921a3..e5b9b63 100644 --- a/curs_main.c +++ b/curs_main.c @@ -1439,11 +1439,6 @@ CHECK_IMAP_ACL(IMAP_ACL_DELETE); if ((Sort & SORT_MASK) != SORT_THREADS) mutt_error _("Threading is not enabled."); - -#if defined (USE_IMAP) && ! defined (IMAP_EDIT_THREADS) - else if (Context->magic == M_IMAP) - mutt_error _("Compile Mutt with --enable-imap-edit-threads for break-thread support"); -#endif else { { @@ -1475,12 +1470,6 @@ CHECK_IMAP_ACL(IMAP_ACL_DELETE); if ((Sort & SORT_MASK) != SORT_THREADS) mutt_error _("Threading is not enabled."); - -#if defined (USE_IMAP) && ! defined (IMAP_EDIT_THREADS) - else if (Context->magic == M_IMAP) - mutt_error _("Compile Mutt with --enable-imap-edit-threads for link-threads support"); -#endif - else if (!CURHDR->env->message_id) mutt_error _("No Message-ID: header available to link thread"); else if (!tag && (!Context->last_tag || !Context->last_tag->tagged)) diff --git a/doc/manual.sgml.head b/doc/manual.sgml.head index e2bb882..6576bf4 100644 --- a/doc/manual.sgml.head +++ b/doc/manual.sgml.head @@ -2419,9 +2419,6 @@ either by misconfigured software or bad behaviour from some correspondents. This allows to clean your mailboxes formats) from these annoyances which make it hard to follow a discussion. -If you want to use these functions with IMAP, you need to compile Mutt -with the Linking threads

diff --git a/mutt.h b/mutt.h index 0eb6139..f632b08 100644 --- a/mutt.h +++ b/mutt.h @@ -816,9 +816,7 @@ typedef struct header char *tree; /* character string to print thread tree */ struct thread *thread; -#ifdef IMAP_EDIT_THREADS ENVELOPE *new_env; /* envelope information for rethreading */ -#endif #ifdef MIXMASTER LIST *chain; diff --git a/thread.c b/thread.c index 675f011..0012ec2 100644 --- a/thread.c +++ b/thread.c @@ -1377,14 +1377,12 @@ static void clean_references (THREAD *brk, THREAD *cur) /* clearing the References: header from obsolete Message-Id(s) */ mutt_free_list (&ref->next); -#ifdef IMAP_EDIT_THREADS if (h->new_env) mutt_free_list (&h->new_env->references); else h->new_env = mutt_new_envelope (); h->new_env->references = mutt_copy_list (h->env->references); -#endif h->refs_changed = h->changed = 1; } @@ -1397,7 +1395,6 @@ void mutt_break_thread (HEADER *hdr) mutt_free_list (&hdr->env->references); hdr->irt_changed = hdr->refs_changed = hdr->changed = 1; -#ifdef IMAP_EDIT_THREADS if (hdr->new_env) { mutt_free_list (&hdr->new_env->in_reply_to); @@ -1405,7 +1402,6 @@ void mutt_break_thread (HEADER *hdr) } else hdr->new_env = mutt_new_envelope (); -#endif clean_references (hdr->thread, hdr->thread->child); } @@ -1420,10 +1416,8 @@ static int link_threads (HEADER *parent, HEADER *child, CONTEXT *ctx) child->env->in_reply_to = mutt_new_list (); child->env->in_reply_to->data = safe_strdup (parent->env->message_id); -#ifdef IMAP_EDIT_THREADS child->new_env->in_reply_to = mutt_new_list (); child->new_env->in_reply_to->data = safe_strdup (parent->env->message_id); -#endif mutt_set_flag (ctx, child, M_TAG, 0);