--- a/libpurple/protocols/irc/msgs.c Tue Dec 14 06:19:13 2010 +0000 +++ b/libpurple/protocols/irc/msgs.c Wed Dec 15 00:35:10 2010 +0000 @@ -597,9 +597,6 @@ if (!args || !args[0]) return; - if (!irc->motd) - irc->motd = g_string_new(""); - if (!strcmp(name, "375")) { if (irc->motd) g_string_free(irc->motd, TRUE); @@ -610,6 +607,15 @@ * finalize the connection here if it is not already done. */ irc_connected(irc, args[0]); return; + } else if (!strcmp(name, "422")) { + /* in case there is no 251, and no MOTD set, finalize the connection. + * (and clear the motd for good measure). */ + + if (irc->motd) + g_string_free(irc->motd, TRUE); + + irc_connected(irc, args[0]); + return; } if (!irc->motd) {