From 0e72027a446f99f42e565f7a856c063f75c1d77a Mon Sep 17 00:00:00 2001 From: Michael Elkins Date: Mon, 11 Nov 2002 19:55:58 +0000 Subject: [PATCH] Fix #1379 - update the total mailbox size when an attachment is deleted. --- PATCHES | 1 + copy.c | 12 +++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/PATCHES b/PATCHES index 1b6b41949..9983ec622 100644 --- 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 514e128e5..62a4f3542 100644 --- a/copy.c +++ b/copy.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1996-2000 Michael R. Elkins + * Copyright (C) 1996-2000,2002 Michael R. Elkins * * 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); } -- 2.40.0