# HG changeset patch # User mikanbako # Date 1211461189 -32400 # Node ID 3f9148c1dc60027c21084824d44aa56ce0576d74 # Parent 31374ae054b0eb315243ecd302aa3723d637cab9 added that to prevent notifications of incoming messages from twitter.com. diff -r 31374ae054b0 -r 3f9148c1dc60 pidgin-twitter.c --- a/pidgin-twitter.c Sat May 17 21:05:12 2008 +0900 +++ b/pidgin-twitter.c Thu May 22 21:59:49 2008 +0900 @@ -52,6 +52,7 @@ #define OPT_USERLIST_SENDER OPT_PIDGINTWITTER "/userlist_sender" #define OPT_COUNTER OPT_PIDGINTWITTER "/counter" #define OPT_SUPPRESS_OOPS OPT_PIDGINTWITTER "/suppress_oops" +#define OPT_PREVENT_NOTIFICATION OPT_PIDGINTWITTER "/prevent_notification" /* formats and templates */ #define RECIPIENT_FORMAT "@%s" @@ -681,6 +682,15 @@ twitter_debug("called\n"); twitter_debug("buffer = %s suppress_oops = %d\n", *buffer, suppress_oops); + /* Prevent notifications of incoming messages. + * Check that conv is not null to avoid a clash. + * conv is null when the conversation window has not opened yet. + */ + if(conv && is_twitter_conv(conv) && + purple_prefs_get_bool(OPT_PREVENT_NOTIFICATION)) { + *flags |= PURPLE_MESSAGE_SYSTEM; + } + if(!suppress_oops || !purple_prefs_get_bool(OPT_SUPPRESS_OOPS)) return FALSE; @@ -881,6 +891,17 @@ purple_plugin_pref_frame_add(frame, pref); + /************************/ + /* notification heading */ + /************************/ + pref = purple_plugin_pref_new_with_label("Notification Configuration"); + purple_plugin_pref_frame_add(frame, pref); + + /* notification setting */ + pref = purple_plugin_pref_new_with_name_and_label(OPT_PREVENT_NOTIFICATION, + "Prevent notifications of incoming messages"); + purple_plugin_pref_frame_add(frame, pref); + return frame; } @@ -933,6 +954,8 @@ purple_prefs_add_bool(OPT_COUNTER, TRUE); purple_prefs_add_bool(OPT_SUPPRESS_OOPS, TRUE); + + purple_prefs_add_bool(OPT_PREVENT_NOTIFICATION, FALSE); } PURPLE_INIT_PLUGIN(pidgin_twitter, init_plugin, info)