~ted/pidgin-libnotify/indicate.patch

« back to all changes in this revision

Viewing changes to src/pidgin-libnotify.c

  • Committer: Ted Gould
  • Date: 2009-09-15 21:59:21 UTC
  • Revision ID: ted@canonical.com-20090915215921-0ppc8h1ys1f0jktx
Checking for a window by the name of the server that we're connecting to.

Show diffs side-by-side

added added

removed removed

Lines of Context:
264
264
   names that we're looking out for.  These shouldn't result
265
265
   in either notifications or indicators. */
266
266
static gboolean
267
 
name_blacklisted (const gchar * name)
 
267
name_blacklisted (PurpleAccount * account, const gchar * name)
268
268
{
 
269
        if (account != NULL) {
 
270
                const gchar * username = purple_account_get_username(account);
 
271
                gchar ** userparts = g_strsplit(username, "@", 2);
 
272
                if (g_strcmp0(name, userparts[1]) == 0) {
 
273
                        g_strfreev(userparts);
 
274
                        return TRUE;
 
275
                }
 
276
                g_strfreev(userparts);
 
277
        }
 
278
 
269
279
        GList * blacklist = purple_prefs_get_string_list("/plugins/gtk/libnotify/blocked_nicks");
270
280
        GList * pnt;
271
281
        for (pnt = blacklist; pnt != NULL; pnt = g_list_next(pnt)) {
604
614
        if (!purple_prefs_get_bool ("/plugins/gtk/libnotify/newmsg"))
605
615
                return;
606
616
 
607
 
        if (name_blacklisted(sender)) return;
 
617
        if (name_blacklisted(account, sender)) return;
608
618
 
609
619
        conv = purple_find_conversation_with_account (PURPLE_CONV_TYPE_IM, sender, account);
610
620
 
663
673
                return;
664
674
        }}}
665
675
 
666
 
        if (name_blacklisted(sender)) return;
 
676
        if (name_blacklisted(account, sender)) return;
667
677
 
668
678
        notify_msg_sent (account, sender, message, conv);
669
679
}
792
802
        PurpleBuddyIcon * buddy_icon = NULL;
793
803
 
794
804
        /* g_debug("Entering indicate_chat_nick"); */
795
 
        if (name_blacklisted(sender)) return;
 
805
        if (name_blacklisted(account, sender)) return;
796
806
 
797
807
        if (conv == NULL) {
798
808
                purple_debug_warning(PLUGIN_ID, "Conversation is NULL, not sure what to do with that!");
1222
1232
        nicklist = g_list_append(nicklist, "NickServ");
1223
1233
        nicklist = g_list_append(nicklist, "ChanServ");
1224
1234
        nicklist = g_list_append(nicklist, "MsgServ");
 
1235
        nicklist = g_list_append(nicklist, "freenode-connect");
1225
1236
 
1226
1237
        purple_prefs_add_string_list ("/plugins/gtk/libnotify/blocked_nicks", nicklist);
1227
1238
        g_list_free(nicklist);