[balsa] mailbox: Do not always cache message info



commit ea1e79b37fc0432ab8061d4ea50c957e1b0af160
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Wed Mar 4 12:59:01 2020 -0500

    mailbox: Do not always cache message info
    
    Do not cache message info if the mailbox is not being viewed.
    
    * libbalsa/mailbox.c (lbm_cache_message):

 ChangeLog          | 7 +++++++
 libbalsa/mailbox.c | 4 ++++
 2 files changed, 11 insertions(+)
---
diff --git a/ChangeLog b/ChangeLog
index 22dadd0f2..9834cb934 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2020-03-04  Peter Bloomfield  <pbloomfield bellsouth net>
+
+       mailbox: Do not cache message info if the mailbox is not being
+       viewed.
+
+       * libbalsa/mailbox.c (lbm_cache_message):
+
 2020-03-03  Peter Bloomfield  <pbloomfield bellsouth net>
 
        mailbox-local: Do not pass message to LibBalsaMailbox
diff --git a/libbalsa/mailbox.c b/libbalsa/mailbox.c
index d8cd283f3..dc0b890c9 100644
--- a/libbalsa/mailbox.c
+++ b/libbalsa/mailbox.c
@@ -2001,6 +2001,10 @@ lbm_cache_message(LibBalsaMailbox * mailbox, guint msgno,
     LibBalsaMailboxIndexEntry *entry;
     gboolean need_sort;
 
+    /* Do we need to cache the message info? */
+    if (priv->view == NULL || priv->view->position < 0)
+        return;
+
     if (priv->mindex->len < msgno)
         g_ptr_array_set_size(priv->mindex, msgno);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]