# HG changeset patch # User Ethan Blanton # Date 1238461709 0 # Node ID c67bf2e1e6c07e9120ceb0932c1844bff013280b # Parent 5e5494482f017f84a8532265b3faa4a3bd21f9ba Handle multiple 319 (channels joined) messages for IRC WHOIS. This additionally fixes a leak when multiple 319 messages were received. Fixes #8827 diff -r 5e5494482f01 -r c67bf2e1e6c0 libpurple/protocols/irc/irc.h --- a/libpurple/protocols/irc/irc.h Mon Mar 30 05:52:32 2009 +0000 +++ b/libpurple/protocols/irc/irc.h Tue Mar 31 01:08:29 2009 +0000 @@ -72,7 +72,7 @@ char *name; char *server; char *serverinfo; - char *channels; + GString *channels; int ircop; int identified; int idle; diff -r 5e5494482f01 -r c67bf2e1e6c0 libpurple/protocols/irc/msgs.c --- a/libpurple/protocols/irc/msgs.c Mon Mar 30 05:52:32 2009 +0000 +++ b/libpurple/protocols/irc/msgs.c Tue Mar 31 01:08:29 2009 +0000 @@ -336,7 +336,11 @@ if (args[3]) irc->whois.signon = (time_t)atoi(args[3]); } else if (!strcmp(name, "319")) { - irc->whois.channels = g_strdup(args[2]); + if (irc->whois.channels == NULL) { + irc->whois.channels = g_string_new(args[2]); + } else { + irc->whois.channels = g_string_append(irc->whois.channels, args[2]); + } } else if (!strcmp(name, "320")) { irc->whois.identified = 1; } @@ -391,8 +395,8 @@ g_free(irc->whois.serverinfo); } if (irc->whois.channels) { - purple_notify_user_info_add_pair(user_info, _("Currently on"), irc->whois.channels); - g_free(irc->whois.channels); + purple_notify_user_info_add_pair(user_info, _("Currently on"), irc->whois.channels->str); + g_string_free(irc->whois.channels, TRUE); } if (irc->whois.idle) { gchar *timex = purple_str_seconds_to_string(irc->whois.idle);