# HG changeset patch # User Sadrul Habib Chowdhury # Date 1179488569 0 # Node ID e22968d3313155aa254537e65e6be2cfa04261e2 # Parent 2ea3c46a63fe76f4c908de21b4656d5b83f2622b Do not show the popup for focused conversations. diff -r 2ea3c46a63fe -r e22968d33131 finch/plugins/gntgf.c --- a/finch/plugins/gntgf.c Fri May 18 01:51:35 2007 +0000 +++ b/finch/plugins/gntgf.c Fri May 18 11:42:49 2007 +0000 @@ -56,7 +56,8 @@ #include #include -#include +#include "gntplugin.h" +#include "gntconv.h" typedef struct { @@ -154,7 +155,7 @@ #endif static void -notify(const char *fmt, ...) +notify(PurpleConversation *conv, const char *fmt, ...) { GntWidget *window; GntToast *toast; @@ -164,6 +165,13 @@ if (purple_prefs_get_bool(PREFS_BEEP)) beep(); + + if (conv != NULL) { + FinchConv *fc = conv->ui_data; + if (gnt_widget_has_focus(fc->window)) + return; + } + #ifdef HAVE_X11 if (purple_prefs_get_bool(PREFS_URGENT)) urgent(); @@ -220,14 +228,14 @@ buddy_signed_on(PurpleBuddy *buddy, gpointer null) { if (purple_prefs_get_bool(PREFS_EVENT_SIGNONF)) - notify(_("%s just signed on"), purple_buddy_get_alias(buddy)); + notify(NULL, _("%s just signed on"), purple_buddy_get_alias(buddy)); } static void buddy_signed_off(PurpleBuddy *buddy, gpointer null) { if (purple_prefs_get_bool(PREFS_EVENT_SIGNONF)) - notify(_("%s just signed off"), purple_buddy_get_alias(buddy)); + notify(NULL, _("%s just signed off"), purple_buddy_get_alias(buddy)); } static void @@ -235,7 +243,7 @@ PurpleConversation *conv, PurpleMessageFlags flags, gpointer null) { if (purple_prefs_get_bool(PREFS_EVENT_IM_MSG)) - notify(_("%s sent you a message"), sender); + notify(conv, _("%s sent you a message"), sender); } static void @@ -254,9 +262,9 @@ if (purple_prefs_get_bool(PREFS_EVENT_CHAT_NICK) && (purple_utf8_has_word(msg, nick))) - notify(_("%s said your nick in %s"), sender, purple_conversation_get_name(conv)); + notify(conv, _("%s said your nick in %s"), sender, purple_conversation_get_name(conv)); else if (purple_prefs_get_bool(PREFS_EVENT_CHAT_MSG)) - notify(_("%s sent a message in %s"), sender, purple_conversation_get_name(conv)); + notify(conv, _("%s sent a message in %s"), sender, purple_conversation_get_name(conv)); } static gboolean