# HG changeset patch # User Stu Tomlinson # Date 1182696720 0 # Node ID a2c488006756d08643c5cd6adb055c8c8d64d96f # Parent 8d425f1abf956a068dc1600c9f894ff14b6edda0 Make gtkbuddynote load itself if it finds buddynote was loaded and it is not, which will make things work better for people upgrading from a version that had no gtkbuddynote plugin. Also don't show empty buddy notes in the tooltip, and make the formatting of the tooltip more in line with other stuff in there diff -r 8d425f1abf95 -r a2c488006756 pidgin/plugins/gtkbuddynote.c --- a/pidgin/plugins/gtkbuddynote.c Sun Jun 24 14:10:03 2007 +0000 +++ b/pidgin/plugins/gtkbuddynote.c Sun Jun 24 14:52:00 2007 +0000 @@ -30,8 +30,8 @@ if (full) { const gchar *note = purple_blist_node_get_string(node, "notes"); - if (note != NULL) { - g_string_append_printf(text, _("\nBuddy Note: %s"), + if ((note != NULL) && (*note != '\0')) { + g_string_append_printf(text, _("\nBuddy Note: %s"), note); } } @@ -94,6 +94,7 @@ check_for_buddynote(gpointer data) { PurplePlugin *buddynote = NULL; + PurplePlugin *plugin = (PurplePlugin *)data; buddynote = purple_plugins_find_with_id("core-plugin_pack-buddynote"); @@ -108,6 +109,18 @@ info.dependencies = g_list_append(info.dependencies, "core-plugin_pack-buddynote"); + + /* If non-gtk buddy note plugin is loaded, but we are not, then load + * ourselves, otherwise people upgrading from pre-gtkbuddynote days + * will not have 'Buddy Notes' showing as loaded in the plugins list. + * We also trigger a save on the list of plugins because it's not been + * loaded through the UI. */ + if (purple_plugin_is_loaded(buddynote) && + !purple_plugin_is_loaded(plugin)) { + purple_plugin_load(plugin); + pidgin_plugins_save(); + } + } else { info.flags = PURPLE_PLUGIN_FLAG_INVISIBLE; }