# HG changeset patch # User Yoshiki Yazawa # Date 1219744566 -32400 # Node ID 148fa8a8be8e4671ec202fdaca6c4129e22977fe # Parent 68d2e1b46a15ce965862d487014d27b4de0af952 - trying a new way to suppress window blinking in WIN32 - tweaked prefs.ui diff -r 68d2e1b46a15 -r 148fa8a8be8e pidgin-twitter.c --- a/pidgin-twitter.c Mon Aug 25 21:47:51 2008 +0900 +++ b/pidgin-twitter.c Tue Aug 26 18:56:06 2008 +0900 @@ -34,6 +34,10 @@ static GList *postedlist = NULL; static gchar *wassr_post = NULL; static gchar *identica_post = NULL; +#ifdef _WIN32 +static gboolean blink_state = FALSE; +static gboolean blink_modified = FALSE; +#endif static struct _source { guint id; @@ -494,6 +498,17 @@ if(doc == NULL) return; +#ifdef _WIN32 + /* suppress notification of incoming messages. */ + if(purple_prefs_get_bool(OPT_PREVENT_NOTIFICATION)) { + if(!blink_modified) { + blink_modified = TRUE; + blink_state = purple_prefs_get_bool(OPT_PIDGIN_BLINK_IM); + purple_prefs_set_bool(OPT_PIDGIN_BLINK_IM, FALSE); + } + } +#endif + for(nptr = doc->children; nptr != NULL; nptr = nptr->next) { if(nptr->type == XML_ELEMENT_NODE && !xmlStrcmp(nptr->name, (xmlChar *)"statuses")) { @@ -1551,7 +1566,7 @@ twitter_debug("candidate = %s\n", *candidate); if(!strcmp(user, *candidate)) { twitter_debug("match. filter %s\n", user); - *flags |= PURPLE_MESSAGE_INVISIBLE; /* pidgin should handle this flag properly --yaz */ +// *flags |= PURPLE_MESSAGE_INVISIBLE; /* pidgin should handle this flag properly --yaz */ #if 1 /* temporal workaround */ g_free(*sender); *sender = NULL; @@ -1579,10 +1594,23 @@ gint service = get_service_type(conv); +#ifdef _WIN32 /* suppress notification of incoming messages. */ if(service != unknown_service && - purple_prefs_get_bool(OPT_PREVENT_NOTIFICATION)) - *flags |= PURPLE_MESSAGE_SYSTEM; + purple_prefs_get_bool(OPT_PREVENT_NOTIFICATION)) { + if(!blink_modified) { + blink_modified = TRUE; + blink_state = purple_prefs_get_bool(OPT_PIDGIN_BLINK_IM); + purple_prefs_set_bool(OPT_PIDGIN_BLINK_IM, FALSE); + } + } + else { + if(blink_modified) { + purple_prefs_set_bool(OPT_PIDGIN_BLINK_IM, blink_state); + blink_modified = FALSE; + } + } +#endif if(service == wassr_service) { /* suppress annoying completion message from wassr */ diff -r 68d2e1b46a15 -r 148fa8a8be8e pidgin-twitter.h --- a/pidgin-twitter.h Mon Aug 25 21:47:51 2008 +0900 +++ b/pidgin-twitter.h Tue Aug 26 18:56:06 2008 +0900 @@ -125,6 +125,9 @@ #define OPT_FILTER_TWITTER OPT_PIDGINTWITTER "/filter_twitter" #define OPT_FILTER_WASSR OPT_PIDGINTWITTER "/filter_wassr" #define OPT_FILTER_IDENTICA OPT_PIDGINTWITTER "/filter_identica" +#ifdef _WIN32 +#define OPT_PIDGIN_BLINK_IM PIDGIN_PREFS_ROOT "/win32/blink_im" +#endif /* formats and templates */ #define RECIPIENT_FORMAT_TWITTER "@%s" diff -r 68d2e1b46a15 -r 148fa8a8be8e prefs.ui --- a/prefs.ui Mon Aug 25 21:47:51 2008 +0900 +++ b/prefs.ui Tue Aug 26 18:56:06 2008 +0900 @@ -485,7 +485,7 @@ True True - Apply filters + Apply filter 0 True @@ -509,7 +509,7 @@ True 0 - <b>User list for filtering</b> + <b>Users to be filtered</b> True @@ -1415,7 +1415,7 @@ True True - Do not notify incoming messages + Do not notify incoming messages (windows only) 0 True