about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2012-12-11 23:48:12 +0000
committerJames Booth <boothj5@gmail.com>2012-12-11 23:48:12 +0000
commit253eb453f25b46863c3c7072d8bc5dc1e2ce2be5 (patch)
treeaf69086fed38688601d2cedfdfd980ca9a787ec4 /src
parentbcfe39e5937413f2dcda564450bfc4fd183d5fad (diff)
downloadprofani-tty-253eb453f25b46863c3c7072d8bc5dc1e2ce2be5.tar.gz
Moved libnotify checks to _notify
Diffstat (limited to 'src')
-rw-r--r--src/windows.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/src/windows.c b/src/windows.c
index 62e1d018..9f8bac3a 100644
--- a/src/windows.c
+++ b/src/windows.c
@@ -106,13 +106,11 @@ static void _win_show_history(WINDOW *win, int win_index,
 static gboolean _new_release(char *found_version);
 static void _ui_draw_win_title(void);
 
-#ifdef HAVE_LIBNOTIFY
 static void _notify(const char * const message, int timeout,
     const char * const category);
 static void _notify_remind(gint unread);
 static void _notify_message(const char * const short_from);
 static void _notify_typing(const char * const from);
-#endif
 
 void
 ui_init(void)
@@ -288,10 +286,8 @@ ui_show_typing(const char * const from)
        }
     }
 
-#ifdef HAVE_LIBNOTIFY
     if (prefs_get_notify_typing())
         _notify_typing(from);
-#endif
 }
 
 void
@@ -440,10 +436,8 @@ ui_show_incoming_msg(const char * const from, const char * const message,
 
     if (prefs_get_beep())
         beep();
-#ifdef HAVE_LIBNOTIFY
     if (prefs_get_notify_message())
         _notify_message(from);
-#endif
 }
 
 void
@@ -1022,11 +1016,9 @@ win_show_room_message(const char * const room_jid, const char * const nick,
         if (prefs_get_beep()) {
             beep();
         }
-#ifdef HAVE_LIBNOTIFY
         if (prefs_get_notify_message()) {
             _notify_message(nick);
         }
-#endif
     }
 }
 
@@ -1658,19 +1650,17 @@ cons_check_version(gboolean not_available_msg)
 void
 notify_remind(void)
 {
-#ifdef HAVE_LIBNOTIFY
     gint unread = _win_get_unread();
     if (unread > 0) {
         _notify_remind(unread);
     }
-#endif
 }
 
-#ifdef HAVE_LIBNOTIFY
 static void
 _notify(const char * const message, int timeout,
     const char * const category)
 {
+#ifdef HAVE_LIBNOTIFY
     gboolean notify_initted = notify_is_initted();
 
     if (!notify_initted) {
@@ -1695,6 +1685,7 @@ _notify(const char * const message, int timeout,
     } else {
         log_error("Libnotify initialisation error.");
     }
+#endif
 }
 
 static void
@@ -1727,7 +1718,6 @@ _notify_typing(const char * const from)
 
     _notify(message, 10000, "Incoming message");
 }
-#endif
 
 static void
 _create_windows(void)