]> granicus.if.org Git - neomutt/commitdiff
fix mutt_buffy_notify() to properly update BuffyNotify
authorStefan Assmann <sassmann@kpanic.de>
Wed, 27 Jun 2018 08:15:05 +0000 (10:15 +0200)
committerRichard Russon <rich@flatcap.org>
Wed, 27 Jun 2018 11:10:06 +0000 (12:10 +0100)
In commit
184244053 doxy: document buffy.c
the check for whether to call mutt_buffy_list() was changed from
if (mutt_buffy_check(false) && BuffyNotify)
to
if (BuffyNotify && (mutt_buffy_check(false) != 0))

By reversing the check mutt_buffy_check() never executes when
BuffyNotify is zero. However, it is essential to run mutt_buffy_check()
before checking BuffyNotify, as mutt_buffy_check() updates BuffyNotify.

Therefore return the check to its inital form

Fixes #1279

buffy.c

diff --git a/buffy.c b/buffy.c
index ea227faeb48ea8bbc37dcf3b2297a9a13693897e..4d063c7a84c3aaded359858bc524a8f600d7a4a4 100644 (file)
--- a/buffy.c
+++ b/buffy.c
@@ -889,7 +889,7 @@ void mutt_buffy_setnotified(const char *path)
  */
 bool mutt_buffy_notify(void)
 {
-  if (BuffyNotify && (mutt_buffy_check(false) != 0))
+  if (mutt_buffy_check(false) && BuffyNotify)
   {
     return mutt_buffy_list();
   }