summaryrefslogtreecommitdiff
path: root/chat/icbirc/patches/patch-ad
blob: 42ccd3d961f4ca68f34f88839f2204fab52a1ffe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
$NetBSD: patch-ad,v 1.2 2004/06/26 22:17:36 adrianp Exp $

--- irc.c.orig	Sat May 29 14:41:29 2004
+++ irc.c	Sat May 29 14:54:37 2004
@@ -52,6 +52,7 @@
 char irc_ident[256];
 char irc_nick[256];
 char irc_channel[256];
+int in_irc_channel;
 
 /*
  * irc_recv() receives read(2) chunks and assembles complete lines, which are
@@ -119,6 +120,8 @@
 			cmd++;
 		scan(&cmd, group, sizeof(group), " ", " ");
 		icb_send_group(server_fd, group);
+	} else if (!strncasecmp(cmd, "PART ", 5)) {
+		in_irc_channel = 0;
 	} else if (!strncasecmp(cmd, "PRIVMSG ", 8) ||
 	    !strncasecmp(cmd, "NOTICE ", 7)) {
 		char dst[128];
@@ -249,6 +252,7 @@
 
 	snprintf(cmd, sizeof(cmd), ":%s JOIN :%s\r\n", src, dst);
 	sync_write(fd, cmd, strlen(cmd));
+	in_irc_channel = 1;
 }
 
 void