changeset 1105:c964df5b2a84

[gaim-migrate @ 1115] Bugs, Schmugs. :) committer: Tailor Script <tailor@pidgin.im>
author Rob Flynn <gaim@robflynn.com>
date Sun, 19 Nov 2000 10:01:53 +0000
parents 46c10fa4e557
children 5bc8fdacd2cb
files plugins/irc.c
diffstat 1 files changed, 29 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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);