about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2012-09-23 20:38:26 +0100
committerJames Booth <boothj5@gmail.com>2012-09-23 20:38:26 +0100
commitd888a378d3083eaac159c6372729a3435e4c2cf0 (patch)
treea90da5ee5fa623ec43a762d8e2a8f52f8ccb7f9e /src
parent78e4524de04930f6f12982d88048872cea2f0cd7 (diff)
downloadprofani-tty-d888a378d3083eaac159c6372729a3435e4c2cf0.tar.gz
Only remind when period != 0 seconds and more than 0 messages
Diffstat (limited to 'src')
-rw-r--r--src/profanity.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/profanity.c b/src/profanity.c
index b047e364..2c7bf08e 100644
--- a/src/profanity.c
+++ b/src/profanity.c
@@ -41,7 +41,7 @@ static log_level_t _get_log_level(char *log_level);
 gboolean _process_input(char *inp);
 static void _create_config_directory();
 
-static gdouble unread_period = 5;
+static gdouble remind_period = 0;
 
 void
 profanity_run(void)
@@ -63,9 +63,12 @@ profanity_run(void)
 
             gdouble elapsed = g_timer_elapsed(timer, NULL);
 
-            if (elapsed >= unread_period) {
-                log_info("Unread : %d", win_get_unread());
-                g_timer_start(timer);
+            // 0 means to not remind
+            if (remind_period > 0 && elapsed >= remind_period) {
+                if (win_get_unread() > 0) {
+                    log_info("Unread : %d", win_get_unread());
+                    g_timer_start(timer);
+                }
             }
 
             win_handle_special_keys(&ch);