# HG changeset patch # User Rob Flynn # Date 974628113 0 # Node ID c964df5b2a84f8ab481b8473ae2d2bc004b4f9be # Parent 46c10fa4e55778fa1063b530b3020d6bb551a179 [gaim-migrate @ 1115] Bugs, Schmugs. :) committer: Tailor Script diff -r 46c10fa4e557 -r c964df5b2a84 plugins/irc.c --- a/plugins/irc.c Sat Nov 18 02:17:07 2000 +0000 +++ b/plugins/irc.c Sun Nov 19 10:01:53 2000 +0000 @@ -121,6 +121,11 @@ idata->recblocks = 0; idata->totalblocks = 1; + /* First, let's check to see if we have anyone on our buddylist */ + if (!grp) { + return; + } + /* Send the first part of our request */ write(idata->fd, "ISON", 4); @@ -358,7 +363,7 @@ if (!status) { - exit(1); + return; } buf[i] = c; i++; @@ -374,6 +379,26 @@ printf("IRC:'%'s\n", buf); + + /* Check for errors */ + + if (((strstr(buf, "ERROR :") && (!strstr(buf, "PRIVMSG ")) && + (!strstr(buf, "NOTICE ")) && (strlen(buf) > 7)))) { + + gchar *u_errormsg; + + /* Let's get our error message */ + u_errormsg = strdup(buf + 7); + + /* We got our error message. Now, let's reaise an + * error dialog */ + + do_error_dialog(u_errormsg, "Gaim: IRC Error"); + + /* And our necessary garbage collection */ + free(u_errormsg); + } + /* Parse the list of names that we receive when we first sign on to * a channel */ @@ -866,10 +891,11 @@ /* FIXME: This should be their servername, not their username. im just lazy right now */ - g_snprintf(buf, 4096, "NICK %s\nUSER %s localhost %s :GAIM (www.marko.net/gaim)\n", gc->username, gc->username, gc->username); + g_snprintf(buf, 4096, "NICK %s\n USER %s localhost %s :GAIM (www.marko.net/gaim)\n", gc->username, getenv("USER"), user->proto_opt[0]); + + printf("Sending: %s\n", buf); write(idata->fd, buf, strlen(buf)); - /* Now lets sign ourselves on */ account_online(gc); serv_finish_login(gc);