Rocco Rutte:
authorpdmef <pdmef@e385b8ad-14ed-0310-8656-cc95a2468c6d>
Mon, 7 Mar 2005 15:14:42 +0000 (15:14 +0000)
committerpdmef <pdmef@e385b8ad-14ed-0310-8656-cc95a2468c6d>
Mon, 7 Mar 2005 15:14:42 +0000 (15:14 +0000)
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

copy.c
curs_main.c
doc/manual.sgml.head
mutt.h
thread.c

diff --git a/copy.c b/copy.c
index 49e19d7..3ce0f2e 100644 (file)
--- 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)
   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);
 
        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);
       }
 
          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);
 
        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);
       }
        if (fputc ('\n', out) == EOF)
          return (-1);
       }
-#undef NEW_ENV
 
       if (h->old || h->read)
       {
 
       if (h->old || h->read)
       {
index 28921a3..e5b9b63 100644 (file)
@@ -1439,11 +1439,6 @@ CHECK_IMAP_ACL(IMAP_ACL_DELETE);
 
         if ((Sort & SORT_MASK) != SORT_THREADS)
           mutt_error _("Threading is not enabled.");
 
         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
         {
           {
         else
         {
           {
@@ -1475,12 +1470,6 @@ CHECK_IMAP_ACL(IMAP_ACL_DELETE);
 
         if ((Sort & SORT_MASK) != SORT_THREADS)
           mutt_error _("Threading is not enabled.");
 
         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))
         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))
index e2bb882..6576bf4 100644 (file)
@@ -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.
 
 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 <em/--enable-imap-edit-threads/ configure flag.
-
 <sect2>Linking threads
 <p>
 
 <sect2>Linking threads
 <p>
 
diff --git a/mutt.h b/mutt.h
index 0eb6139..f632b08 100644 (file)
--- a/mutt.h
+++ b/mutt.h
@@ -816,9 +816,7 @@ typedef struct header
   char *tree;                  /* character string to print thread tree */
   struct thread *thread;
 
   char *tree;                  /* character string to print thread tree */
   struct thread *thread;
 
-#ifdef IMAP_EDIT_THREADS
   ENVELOPE *new_env;   /* envelope information for rethreading */
   ENVELOPE *new_env;   /* envelope information for rethreading */
-#endif
 
 #ifdef MIXMASTER
   LIST *chain;
 
 #ifdef MIXMASTER
   LIST *chain;
index 675f011..0012ec2 100644 (file)
--- 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);
 
       /* 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);
       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;
     }
 
       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;
 
   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);
   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 ();
   }
   else
     hdr->new_env = mutt_new_envelope ();
-#endif
 
   clean_references (hdr->thread, hdr->thread->child);
 }
 
   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);
 
   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);
   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);
   
   
   mutt_set_flag (ctx, child, M_TAG, 0);