quick and dirty freenode connect fix
authorMarkus Bröker <mbroeker@largo.dyndns.tv>
Sat, 13 Dec 2008 15:38:29 +0100
changeset 1 5d249c79842d
parent 0 586472add385
child 2 6a2e88214b80
quick and dirty freenode connect fix committer: Markus Bröker <mbroeker@largo.homelinux.org>
debian/changelog
src/irc.c
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,9 +1,10 @@
-mcbot (0.93-2) unstable; urgency=low
+mcbot (0.93-3) unstable; urgency=low
 
   * Initial Release
   * the location of mcbot.cgi is stored in the db
   * never include malloc, use stdlib instead
   * mcbot.email and mcbot.user holds the admin information
   * Locale Settings changed to C
+  * freenode connect fix
 
  -- Markus Broeker <mbroeker@largo.homelinux.org>  Sun, 27 Apr 2008 09:05:54 +0200
--- a/src/irc.c
+++ b/src/irc.c
@@ -103,6 +103,10 @@
             break;
         }
 
+        if (strstr (msg, ":You are now logged in.") != NULL) {
+            break;
+        }
+
         if (strstr (msg, ":Password Incorrect") != NULL) {
             return IRC_LOGIN_ERROR;
         }
@@ -309,6 +313,11 @@
                 message->line = strtok (NULL, "\r\n");
                 return command;
                 break;
+			case 901: /* notify or some crap */
+				message->channel = strtok (message->line, " ");
+				message->line = strtok(NULL, "\r\n");
+				return command;
+				break;
             default:
                 printf ("DEBUG   %s", line);
                 printf ("Unknown Value: %d\n", value);