# HG changeset patch # User Ethan Blanton # Date 1209865380 0 # Node ID 1fbc49b46e09bee4b54db4e75d513b0a6bd9ef2a # Parent 7492fdcdbcea0e4d79bb759ea08fd7b645765550 Fix IRC handling of PART without a part message on Undernet IRCds. diff -r 7492fdcdbcea -r 1fbc49b46e09 ChangeLog --- a/ChangeLog Sun May 04 00:51:46 2008 +0000 +++ b/ChangeLog Sun May 04 01:43:00 2008 +0000 @@ -7,6 +7,8 @@ * IRC now displays ban lists in-channel for joined channels. * Fixed a bug where the list of loaded plugins would get removed when switching between different operating systems. + * Fix reception of IRC PART without a part message on Undernet + (fixes a problem with litter in the channel user list). Pidgin: * The typing notification in the conversation history can be disabled or diff -r 7492fdcdbcea -r 1fbc49b46e09 libpurple/protocols/irc/msgs.c --- a/libpurple/protocols/irc/msgs.c Sun May 04 00:51:46 2008 +0000 +++ b/libpurple/protocols/irc/msgs.c Sun May 04 01:43:00 2008 +0000 @@ -1015,14 +1015,18 @@ { PurpleConnection *gc = purple_account_get_connection(irc->account); PurpleConversation *convo; - char *nick, *msg; + char *nick, *msg, *channel; if (!args || !args[0] || !gc) return; - convo = purple_find_conversation_with_account(PURPLE_CONV_TYPE_CHAT, args[0], irc->account); + /* Undernet likes to :-quote the channel name, for no good reason + * that I can see. This catches that. */ + channel = (args[0][0] == ':') ? &args[0][1] : args[0]; + + convo = purple_find_conversation_with_account(PURPLE_CONV_TYPE_CHAT, channel, irc->account); if (!convo) { - purple_debug(PURPLE_DEBUG_INFO, "irc", "Got a PART on %s, which doesn't exist -- probably closed\n", args[0]); + purple_debug(PURPLE_DEBUG_INFO, "irc", "Got a PART on %s, which doesn't exist -- probably closed\n", channel); return; } @@ -1033,7 +1037,7 @@ (args[1] && *args[1]) ? ": " : "", (escaped && *escaped) ? escaped : ""); g_free(escaped); - purple_conv_chat_write(PURPLE_CONV_CHAT(convo), args[0], msg, PURPLE_MESSAGE_SYSTEM, time(NULL)); + purple_conv_chat_write(PURPLE_CONV_CHAT(convo), channel, msg, PURPLE_MESSAGE_SYSTEM, time(NULL)); g_free(msg); serv_got_chat_left(gc, purple_conv_chat_get_id(PURPLE_CONV_CHAT(convo))); } else {