]> granicus.if.org Git - mutt/commitdiff
Fix #1379 - update the total mailbox size when an attachment is
authorMichael Elkins <me@sigpipe.org>
Mon, 11 Nov 2002 19:55:58 +0000 (19:55 +0000)
committerMichael Elkins <me@sigpipe.org>
Mon, 11 Nov 2002 19:55:58 +0000 (19:55 +0000)
deleted.

PATCHES
copy.c

diff --git a/PATCHES b/PATCHES
index 1b6b4194949ed5840ed39e6eea7002fb0479e177..9983ec622f33c7f8f8407212c0a69ada5910fda3 100644 (file)
--- a/PATCHES
+++ b/PATCHES
@@ -1 +1,2 @@
 patch-1.5.1-me.redraw.1
+patch-1.5.1.me.attachdel_size.1
diff --git a/copy.c b/copy.c
index 514e128e54f90c1af7dfad948abe3087109b0342..62a4f3542efe5d679c34c7eeee779d71bc00b937 100644 (file)
--- a/copy.c
+++ b/copy.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 1996-2000 Michael R. Elkins <me@cs.hmc.edu>
+ * Copyright (C) 1996-2000,2002 Michael R. Elkins <me@mutt.org>
  * 
  *     This program is free software; you can redistribute it and/or modify
  *     it under the terms of the GNU General Public License as published by
@@ -505,6 +505,16 @@ _mutt_copy_message (FILE *fpout, FILE *fpin, HEADER *hdr, BODY *body,
        hdr->attach_del = 0;
        hdr->lines = new_lines;
        body->offset = new_offset;
+
+       /* update the total size of the mailbox to reflect this deletion */
+       Context->size -= body->length - new_length;
+       /*
+        * if the message is visible, update the visible size of the mailbox
+        * as well.
+        */
+       if (Context->v2r[hdr->msgno] != -1)
+         Context->vsize -= body->length - new_length;
+
        body->length = new_length;
        mutt_free_body (&body->parts);
       }