Mercurial > pidgin-twitter
comparison pidgin-twitter.c @ 214:148fa8a8be8e
- trying a new way to suppress window blinking in WIN32
- tweaked prefs.ui
author | Yoshiki Yazawa <yaz@honeyplanet.jp> |
---|---|
date | Tue, 26 Aug 2008 18:56:06 +0900 |
parents | 8670e1572be8 |
children | 6b258bdd9c49 |
comparison
equal
deleted
inserted
replaced
213:68d2e1b46a15 | 214:148fa8a8be8e |
---|---|
32 static GHashTable *conv_hash = NULL; | 32 static GHashTable *conv_hash = NULL; |
33 static GList *statuseslist = NULL; | 33 static GList *statuseslist = NULL; |
34 static GList *postedlist = NULL; | 34 static GList *postedlist = NULL; |
35 static gchar *wassr_post = NULL; | 35 static gchar *wassr_post = NULL; |
36 static gchar *identica_post = NULL; | 36 static gchar *identica_post = NULL; |
37 #ifdef _WIN32 | |
38 static gboolean blink_state = FALSE; | |
39 static gboolean blink_modified = FALSE; | |
40 #endif | |
37 | 41 |
38 static struct _source { | 42 static struct _source { |
39 guint id; | 43 guint id; |
40 PurpleConversation *conv; | 44 PurpleConversation *conv; |
41 } source; | 45 } source; |
491 start = strstr(url_text, "<?xml"); | 495 start = strstr(url_text, "<?xml"); |
492 | 496 |
493 doc = xmlRecoverMemory(start, len - (start - url_text)); | 497 doc = xmlRecoverMemory(start, len - (start - url_text)); |
494 if(doc == NULL) | 498 if(doc == NULL) |
495 return; | 499 return; |
500 | |
501 #ifdef _WIN32 | |
502 /* suppress notification of incoming messages. */ | |
503 if(purple_prefs_get_bool(OPT_PREVENT_NOTIFICATION)) { | |
504 if(!blink_modified) { | |
505 blink_modified = TRUE; | |
506 blink_state = purple_prefs_get_bool(OPT_PIDGIN_BLINK_IM); | |
507 purple_prefs_set_bool(OPT_PIDGIN_BLINK_IM, FALSE); | |
508 } | |
509 } | |
510 #endif | |
496 | 511 |
497 for(nptr = doc->children; nptr != NULL; nptr = nptr->next) { | 512 for(nptr = doc->children; nptr != NULL; nptr = nptr->next) { |
498 if(nptr->type == XML_ELEMENT_NODE && | 513 if(nptr->type == XML_ELEMENT_NODE && |
499 !xmlStrcmp(nptr->name, (xmlChar *)"statuses")) { | 514 !xmlStrcmp(nptr->name, (xmlChar *)"statuses")) { |
500 | 515 |
1549 if(!strcmp(*candidate, "")) | 1564 if(!strcmp(*candidate, "")) |
1550 continue; | 1565 continue; |
1551 twitter_debug("candidate = %s\n", *candidate); | 1566 twitter_debug("candidate = %s\n", *candidate); |
1552 if(!strcmp(user, *candidate)) { | 1567 if(!strcmp(user, *candidate)) { |
1553 twitter_debug("match. filter %s\n", user); | 1568 twitter_debug("match. filter %s\n", user); |
1554 *flags |= PURPLE_MESSAGE_INVISIBLE; /* pidgin should handle this flag properly --yaz */ | 1569 // *flags |= PURPLE_MESSAGE_INVISIBLE; /* pidgin should handle this flag properly --yaz */ |
1555 #if 1 | 1570 #if 1 |
1556 /* temporal workaround */ | 1571 /* temporal workaround */ |
1557 g_free(*sender); *sender = NULL; | 1572 g_free(*sender); *sender = NULL; |
1558 g_free(*buffer); *buffer = NULL; | 1573 g_free(*buffer); *buffer = NULL; |
1559 #endif | 1574 #endif |
1577 twitter_debug("called\n"); | 1592 twitter_debug("called\n"); |
1578 twitter_debug("buffer = %s suppress_oops = %d\n", *buffer, suppress_oops); | 1593 twitter_debug("buffer = %s suppress_oops = %d\n", *buffer, suppress_oops); |
1579 | 1594 |
1580 gint service = get_service_type(conv); | 1595 gint service = get_service_type(conv); |
1581 | 1596 |
1597 #ifdef _WIN32 | |
1582 /* suppress notification of incoming messages. */ | 1598 /* suppress notification of incoming messages. */ |
1583 if(service != unknown_service && | 1599 if(service != unknown_service && |
1584 purple_prefs_get_bool(OPT_PREVENT_NOTIFICATION)) | 1600 purple_prefs_get_bool(OPT_PREVENT_NOTIFICATION)) { |
1585 *flags |= PURPLE_MESSAGE_SYSTEM; | 1601 if(!blink_modified) { |
1602 blink_modified = TRUE; | |
1603 blink_state = purple_prefs_get_bool(OPT_PIDGIN_BLINK_IM); | |
1604 purple_prefs_set_bool(OPT_PIDGIN_BLINK_IM, FALSE); | |
1605 } | |
1606 } | |
1607 else { | |
1608 if(blink_modified) { | |
1609 purple_prefs_set_bool(OPT_PIDGIN_BLINK_IM, blink_state); | |
1610 blink_modified = FALSE; | |
1611 } | |
1612 } | |
1613 #endif | |
1586 | 1614 |
1587 if(service == wassr_service) { | 1615 if(service == wassr_service) { |
1588 /* suppress annoying completion message from wassr */ | 1616 /* suppress annoying completion message from wassr */ |
1589 if(strstr(*buffer, "<body>投稿完了:") || | 1617 if(strstr(*buffer, "<body>投稿完了:") || |
1590 strstr(*buffer, "<body>チャンネル投稿完了:")) { | 1618 strstr(*buffer, "<body>チャンネル投稿完了:")) { |