Hi all,

I noticed that an IMAP search filter is not removed when closing the mailbox.  
To reproduce:
1. open an IMAP mailbox
2. enter a string in the search entry, so that only some messages are displayed
3. close the mailbox
4. re-open the mailbox

After step 4, the search entry is empty, but only the messages as selected by 
the value given is step 2 are visible, ehich is confusing.  Afaict, this effect 
does not happen with MBox or Maildir mailboxes.

Running Balsa in the debugger, I /think/ this is caused by not clearing the 
priv->view_filter item of the mailbox when it is closed.  The attached simple 
two-liner patch fixes this for IMAP.  It /seems/ as if does not have any advert 
effect on other mailboxes, but as I do not fully understand what happens it would 
be great if someone could double-check it.

Best,
Albrecht.
diff --git a/libbalsa/mailbox.c b/libbalsa/mailbox.c
index 70deec935..e66d512a8 100644
--- a/libbalsa/mailbox.c
+++ b/libbalsa/mailbox.c
@@ -644,6 +644,8 @@ libbalsa_mailbox_close(LibBalsaMailbox * mailbox, gboolean expunge)
         libbalsa_mailbox_free_mindex(mailbox);
         priv->stamp++;
 	priv->state = LB_MAILBOX_STATE_CLOSED;
+	libbalsa_condition_unref(priv->view_filter);
+	priv->view_filter = NULL;
     }
 
     libbalsa_unlock_mailbox(mailbox);

Attachment: pgpLxGZoboxV1.pgp
Description: PGP signature

_______________________________________________
balsa-list mailing list
[email protected]
https://mail.gnome.org/mailman/listinfo/balsa-list

Reply via email to