From e434b1bbf8bd84b8478f4264bf1ced66b64f4df9 Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Fri, 9 Oct 2015 11:50:21 +0200 Subject: Create is_notify_enabled function The same code was used on two different occasions. I put it into a function. --- src/main.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'src/main.c') 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"); -- cgit 1.4.1-2-gfad0