about summary refs log tree commit diff stats
path: root/src/main.c
diff options
context:
space:
mode:
authorMichael Vetter <jubalh@openmailbox.org>2015-10-09 11:50:21 +0200
committerMichael Vetter <jubalh@openmailbox.org>2015-10-12 09:29:04 +0200
commite434b1bbf8bd84b8478f4264bf1ced66b64f4df9 (patch)
tree0fedac7ec422f81437effda72b8caca9709f934b /src/main.c
parent4730dca546a6242b71cb9fcef1dc7d5adb1fe0a5 (diff)
downloadprofani-tty-e434b1bbf8bd84b8478f4264bf1ced66b64f4df9.tar.gz
Create is_notify_enabled function
The same code was used on two different occasions. I put it into a
function.
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/src/main.c b/src/main.c
index 49e1defc..32d6dd2c 100644
--- a/src/main.c
+++ b/src/main.c
@@ -40,6 +40,7 @@
 #endif
 
 #include "profanity.h"
+#include "common.h"
 #include "command/command.h"
 
 static gboolean disable_tls = FALSE;
@@ -105,18 +106,7 @@ main(int argc, char **argv)
         g_print("XMPP library: libstrophe\n");
 #endif
 
-        gboolean notify_enabled = FALSE;
-
-#ifdef HAVE_OSXNOTIFY
-        notify_enabled = TRUE;
-#endif
-#ifdef HAVE_LIBNOTIFY
-        notify_enabled = TRUE;
-#endif
-#ifdef PLATFORM_CYGWIN
-        notify_enabled = TRUE;
-#endif
-        if (notify_enabled) {
+        if (is_notify_enabled()) {
             g_print("Desktop notification support: Enabled\n");
         } else {
             g_print("Desktop notification support: Disabled\n");