updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / pidgin-msn / pastie-649601.diff
bloba60f5916163f8448ea3951dcefec0f66e9a9cdee
1 # msnplus_patch.patch by daniele_athome, jgoguen
2 # Taken from http://developer.pidgin.im/ticket/4598
3 # Allows to activate Plus! plugin, to show colored nicks with MSN Plus! Tags
5 --- ./pidgin/gtkblist.c 2009-06-16 10:54:35.000000000 +0200
6 +++ ./pidgin/gtkblist.c 2009-06-18 16:37:38.000000000 +0200
7 @@ -4011,6 +4011,7 @@
8 PurplePresence *presence;
9 struct _pidgin_blist_node *gtkcontactnode = NULL;
10 char *idletime = NULL, *statustext = NULL, *nametext = NULL;
11 + char *ret = NULL;
12 PurpleConversation *conv = find_conversation_with_buddy(b);
13 gboolean hidden_conv = FALSE;
14 gboolean biglist = purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_buddy_icons");
15 @@ -4039,8 +4040,22 @@
16 else
17 name = purple_buddy_get_alias(b);
19 - nametext = g_markup_escape_text(name, strlen(name));
21 + /* Raise a contact pre-draw signal here. The callback will return an already
22 + * escaped version of name.
23 + */
24 + ret = purple_signal_emit_return_1(pidgin_blist_get_handle(), "drawing-buddy", b);
25 + if(ret != NULL)
26 + {
27 + purple_debug_warning("gtkblist", "drawing-buddy signal returned \"%s\"\n", ret);
28 + nametext = g_strdup(ret);
29 + }
30 + else
31 + {
32 + purple_debug_info("gtkblist", "using default escaped name\n");
33 + nametext = g_markup_escape_text(name, strlen(name));
34 + }
35 + g_free(ret);
37 presence = purple_buddy_get_presence(b);
39 /* Name is all that is needed */
40 @@ -7398,6 +7412,10 @@
41 purple_signal_connect(purple_blist_get_handle(), "buddy-signed-on", gtk_blist_handle, PURPLE_CALLBACK(buddy_signonoff_cb), NULL);
42 purple_signal_connect(purple_blist_get_handle(), "buddy-signed-off", gtk_blist_handle, PURPLE_CALLBACK(buddy_signonoff_cb), NULL);
43 purple_signal_connect(purple_blist_get_handle(), "buddy-privacy-changed", gtk_blist_handle, PURPLE_CALLBACK(pidgin_blist_update_privacy_cb), NULL);
44 + /* Signal for pre-markup buddy draw. */
45 + purple_signal_register(gtk_blist_handle, "drawing-buddy",
46 + purple_marshal_POINTER__POINTER_INT, purple_value_new(PURPLE_TYPE_STRING), 1,
47 + purple_value_new(PURPLE_TYPE_SUBTYPE, PURPLE_SUBTYPE_BLIST_BUDDY));
50 void