diff libpurple/protocols/irc/msgs.c @ 31027:1dcaaa68b245

Process 422 (ERR_NOMOTD) as a valid replacement for an actual MOTD during signin. Thanks to Thijs Alkemade for this patch. Fixes #8649 committer: Ethan Blanton <elb@pidgin.im>
author thijsalkemade@gmail.com
date Wed, 15 Dec 2010 00:35:10 +0000
parents 815bd8b41638
children e023b0378887
line wrap: on
line diff
--- 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) {