# HG changeset patch # User Elliott Sales de Andrade # Date 1314157926 0 # Node ID 4fa86d2d1778841976c84ef2127c15737d29f39a # Parent 56ef2369f330387a471c2249146683c571c05b75 Allow toggling debug and verbose debug from a conversation window. diff -r 56ef2369f330 -r 4fa86d2d1778 pidgin/gtkconv.c --- a/pidgin/gtkconv.c Wed Aug 24 03:30:47 2011 +0000 +++ b/pidgin/gtkconv.c Wed Aug 24 03:52:06 2011 +0000 @@ -356,8 +356,32 @@ } tmp = g_string_free(str, FALSE); + } else if (!g_ascii_strcasecmp(args[0], "unsafe")) { + if (purple_debug_is_unsafe()) { + purple_debug_set_unsafe(FALSE); + purple_conversation_write(conv, NULL, _("Unsafe debugging is now disabled."), + PURPLE_MESSAGE_NO_LOG|PURPLE_MESSAGE_SYSTEM, time(NULL)); + } else { + purple_debug_set_unsafe(TRUE); + purple_conversation_write(conv, NULL, _("Unsafe debugging is now enabled."), + PURPLE_MESSAGE_NO_LOG|PURPLE_MESSAGE_SYSTEM, time(NULL)); + } + + return PURPLE_CMD_RET_OK; + } else if (!g_ascii_strcasecmp(args[0], "verbose")) { + if (purple_debug_is_verbose()) { + purple_debug_set_verbose(FALSE); + purple_conversation_write(conv, NULL, _("Verbose debugging is now disabled."), + PURPLE_MESSAGE_NO_LOG|PURPLE_MESSAGE_SYSTEM, time(NULL)); + } else { + purple_debug_set_verbose(TRUE); + purple_conversation_write(conv, NULL, _("Verbose debugging is now enabled."), + PURPLE_MESSAGE_NO_LOG|PURPLE_MESSAGE_SYSTEM, time(NULL)); + } + + return PURPLE_CMD_RET_OK; } else { - purple_conversation_write(conv, NULL, _("Supported debug options are: plugins version"), + purple_conversation_write(conv, NULL, _("Supported debug options are: plugins version unsafe verbose"), PURPLE_MESSAGE_NO_LOG|PURPLE_MESSAGE_ERROR, time(NULL)); return PURPLE_CMD_RET_OK; }