# HG changeset patch # User Sadrul Habib Chowdhury # Date 1252996049 0 # Node ID 574fd92ff3e550372e2c485e18128594f03140da # Parent 08f8d45e3a14c962f7b10b5ddfae1e552bb83e35 '/debug plugins' will announce the list of loaded plugins. This should help users answer the 'What plugins are you using?' question. The list includes protocol plugins and plugin loaders, since often they are the source of the bug reports. diff -r 08f8d45e3a14 -r 574fd92ff3e5 ChangeLog --- a/ChangeLog Tue Sep 15 03:58:59 2009 +0000 +++ b/ChangeLog Tue Sep 15 06:27:29 2009 +0000 @@ -4,6 +4,10 @@ XMPP: * Fix a crash when attempting to validate an invalid JID. + General: + * New 'plugins' sub-command to 'debug' command (i.e. '/debug plugins') + to announce the list of loaded plugins (in both Finch and Pidgin). + version 2.6.2 (09/05/2009): libpurple: * Fix --disable-avahi to actually disable it in configure, as opposed diff -r 08f8d45e3a14 -r 574fd92ff3e5 finch/gntconv.c --- a/finch/gntconv.c Tue Sep 15 03:58:59 2009 +0000 +++ b/finch/gntconv.c Tue Sep 15 06:27:29 2009 +0000 @@ -29,6 +29,7 @@ #include #include +#include #include #include #include @@ -1181,22 +1182,43 @@ const char *cmd, char **args, char **error, void *data) { char *tmp, *markup; - PurpleCmdStatus status; if (!g_ascii_strcasecmp(args[0], "version")) { - tmp = g_strdup_printf("me is using Finch v%s.", DISPLAY_VERSION); - markup = g_markup_escape_text(tmp, -1); - - status = purple_cmd_do_command(conv, tmp, markup, error); + tmp = g_strdup_printf("Using Finch v%s with libpurple v%s.", + DISPLAY_VERSION, purple_core_get_version()); + } else if (!g_ascii_strcasecmp(args[0], "plugins")) { + /* Show all the loaded plugins, including the protocol plugins and plugin loaders. + * This is intentional, since third party prpls are often sources of bugs, and some + * plugin loaders (e.g. mono) can also be buggy. + */ + GString *str = g_string_new("Loaded Plugins: "); + const GList *plugins = purple_plugins_get_loaded(); + if (plugins) { + for (; plugins; plugins = plugins->next) { + str = g_string_append(str, purple_plugin_get_name(plugins->data)); + if (plugins->next) + str = g_string_append(str, ", "); + } + } else { + str = g_string_append(str, "(none)"); + } - g_free(tmp); - g_free(markup); - return status; + tmp = g_string_free(str, FALSE); } else { - purple_conversation_write(conv, NULL, _("Supported debug options are: version"), + purple_conversation_write(conv, NULL, _("Supported debug options are: plugins version"), PURPLE_MESSAGE_NO_LOG|PURPLE_MESSAGE_ERROR, time(NULL)); return PURPLE_CMD_STATUS_OK; } + + markup = g_markup_escape_text(tmp, -1); + if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_IM) + purple_conv_im_send(PURPLE_CONV_IM(conv), markup); + else if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT) + purple_conv_chat_send(PURPLE_CONV_CHAT(conv), markup); + + g_free(tmp); + g_free(markup); + return PURPLE_CMD_STATUS_OK; } /* Xerox */ diff -r 08f8d45e3a14 -r 574fd92ff3e5 pidgin/gtkconv.c --- a/pidgin/gtkconv.c Tue Sep 15 03:58:59 2009 +0000 +++ b/pidgin/gtkconv.c Tue Sep 15 06:27:29 2009 +0000 @@ -327,23 +327,43 @@ const char *cmd, char **args, char **error, void *data) { char *tmp, *markup; - PurpleCmdStatus status; if (!g_ascii_strcasecmp(args[0], "version")) { - tmp = g_strdup_printf("me is using Pidgin v%s with libpurple v%s.", + tmp = g_strdup_printf("Using Pidgin v%s with libpurple v%s.", DISPLAY_VERSION, purple_core_get_version()); - markup = g_markup_escape_text(tmp, -1); - - status = purple_cmd_do_command(conv, tmp, markup, error); - - g_free(tmp); - g_free(markup); - return status; + } else if (!g_ascii_strcasecmp(args[0], "plugins")) { + /* Show all the loaded plugins, including the protocol plugins and plugin loaders. + * This is intentional, since third party prpls are often sources of bugs, and some + * plugin loaders (e.g. mono) can also be buggy. + */ + GString *str = g_string_new("Loaded Plugins: "); + const GList *plugins = purple_plugins_get_loaded(); + if (plugins) { + for (; plugins; plugins = plugins->next) { + str = g_string_append(str, purple_plugin_get_name(plugins->data)); + if (plugins->next) + str = g_string_append(str, ", "); + } + } else { + str = g_string_append(str, "(none)"); + } + + tmp = g_string_free(str, FALSE); } else { - purple_conversation_write(conv, NULL, _("Supported debug options are: version"), + purple_conversation_write(conv, NULL, _("Supported debug options are: plugins version"), PURPLE_MESSAGE_NO_LOG|PURPLE_MESSAGE_ERROR, time(NULL)); return PURPLE_CMD_STATUS_OK; } + + markup = g_markup_escape_text(tmp, -1); + if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_IM) + purple_conv_im_send(PURPLE_CONV_IM(conv), markup); + else if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT) + purple_conv_chat_send(PURPLE_CONV_CHAT(conv), markup); + + g_free(tmp); + g_free(markup); + return PURPLE_CMD_STATUS_OK; } static void clear_conversation_scrollback(PurpleConversation *conv)