pidgin/pidgin

d184ca7f413e
Parents cda0ef7d24fb
Children 86e7c9ca0bcd
irc: show protocol debug if PURPLE_VERBOSE_DEBUG=1
--- a/libpurple/protocols/irc/irc.c Thu Mar 01 20:38:21 2018 -0600
+++ b/libpurple/protocols/irc/irc.c Mon Mar 05 02:41:47 2018 -0300
@@ -165,6 +165,13 @@
buflen = strlen(tosend);
}
+ if (purple_debug_is_verbose()) {
+ char *clean = purple_utf8_salvage(tosend);
+ clean = g_strstrip(clean);
+ purple_debug_misc("irc", "<< %s\n", clean);
+ g_free(clean);
+ }
+
/* If we're not buffering writes, try to send immediately */
if (!irc->writeh)
ret = do_send(irc, tosend, buflen);
--- a/libpurple/protocols/irc/parse.c Thu Mar 01 20:38:21 2018 -0600
+++ b/libpurple/protocols/irc/parse.c Mon Mar 05 02:41:47 2018 -0300
@@ -680,6 +680,13 @@
*/
purple_signal_emit(_irc_plugin, "irc-receiving-text", gc, &input);
+ if (purple_debug_is_verbose()) {
+ char *clean = purple_utf8_salvage(input);
+ clean = g_strstrip(clean);
+ purple_debug_misc("irc", ">> %s\n", clean);
+ g_free(clean);
+ }
+
if (!strncmp(input, "PING ", 5)) {
msg = irc_format(irc, "vv", "PONG", input + 5);
irc_send(irc, msg);