changeset 1012:7e8dcc609b30

[gaim-migrate @ 1022] Small little bug fix. Man there's so much more that needs to be done. committer: Tailor Script <tailor@pidgin.im>
author Rob Flynn <gaim@robflynn.com>
date Fri, 20 Oct 2000 08:01:59 +0000
parents 4867280dbdc7
children 966845e5ad29
files plugins/irc.c
diffstat 1 files changed, 11 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/irc.c	Fri Oct 20 07:51:03 2000 +0000
+++ b/plugins/irc.c	Fri Oct 20 08:01:59 2000 +0000
@@ -262,11 +262,19 @@
 	if ( (strstr(buf, " JOIN ")) && (buf[0] == ':') && (!strstr(buf, " NOTICE "))) {
 
 		gchar u_channel[128];
+		gchar u_nick[128];
+		
 		struct irc_channel *channel;
 		int id;
 		int j;
 
-		for (j = 0, i = 1; buf[i] != '#'; j++, i++) {
+		for (j = 0, i = 1; buf[i] != '!'; j++, i++) {
+			u_nick[j] = buf[i];
+		}
+
+		u_nick[j] = '\0'; i++;
+
+		for (j = 0; buf[i] != '#'; j++, i++) {
 		}
 		
 		i++;
@@ -293,6 +301,7 @@
 			printf("IIII: I joined '%s' with a strlen() of '%d'\n", u_channel, strlen(u_channel));
 		} else {
 			/* Someone else joined. */
+			printf("%s has joined #%s\n", u_nick, u_channel);
 		}
 
 		return;
@@ -351,7 +360,7 @@
 		return;
 	}
 	
-	if ( (strstr(buf, "PRIVMSG ")) && (buf[0] == ':')) {
+	if ( (strstr(buf, " PRIVMSG ")) && (buf[0] == ':')) {
 		gchar u_nick[128];
 		gchar u_host[255];
 		gchar u_command[32];
@@ -415,7 +424,6 @@
 		}
 		else {
 			/* Nope. Let's treat it as a private message */
-			printf("JUST GOT AN IM!!\n");
 			serv_got_im(gc, u_nick, u_message, 0);
 		}