Return-Path: kl@snafu.de
Delivery-Date: Tue Dec 29 16:40:28 1998
Received: from www.inx.de (root@www.inx.de [195.21.255.251])
	by nemesis.acronet.net (8.8.5/8.8.5) with SMTP id QAA04988
	for <jnelson@acronet.net>; Tue, 29 Dec 1998 16:40:23 -0600 (CST)
Received: by www.inx.de (Smail3.2.0.96inx)
	  id <m0zv7oL-000okjC>; Tue, 29 Dec 1998 23:40:21 +0100 (MET)
Message-ID: <19981229234021.A6246@berlin.snafu.de>
Date: Tue, 29 Dec 1998 23:40:21 +0100
From: Kaspar Landsberg <kl@snafu.de>
To: jnelson@acronet.net
Subject: EPIC: patch for epic3
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Mailer: Mutt 0.93.2i
Content-Length: 14453
Lines: 493

Hi,

the irc2.10 patch for epic3 is finally out. Something will be done by me
for epic4 (up to you to perfectionalize it then :).

I changed the version string to show that's an non original version (just
in case something's wrong with my patch).

Maybe you want to put that one somehere...

Bye, Kasi

--- cut here ---
diff -cr ./include/names.h ../ircii-EPIC3.004.new/include/names.h
*** ./include/names.h	Mon Dec  9 14:21:14 1996
--- ../ircii-EPIC3.004.new/include/names.h	Fri Oct 23 21:58:42 1998
***************
*** 24,31 ****
  #define MODE_MODERATED	((u_long) 0x0008)
  #define MODE_MSGS	((u_long) 0x0010)
  #define MODE_PRIVATE	((u_long) 0x0020)
! #define MODE_SECRET	((u_long) 0x0040)
! #define MODE_TOPIC	((u_long) 0x0080)
  
  /* ChannelList: structure for the list of channels you are current on */
  typedef	struct	channel_stru
--- 24,32 ----
  #define MODE_MODERATED	((u_long) 0x0008)
  #define MODE_MSGS	((u_long) 0x0010)
  #define MODE_PRIVATE	((u_long) 0x0020)
! #define MODE_REOP	((u_long) 0x0040)
! #define MODE_SECRET	((u_long) 0x0080)
! #define MODE_TOPIC	((u_long) 0x0100)
  
  /* ChannelList: structure for the list of channels you are current on */
  typedef	struct	channel_stru
***************
*** 47,52 ****
--- 48,54 ----
  extern	void		add_channel 		_((char *, int));
  extern	void		add_to_channel 		_((char *, char *, int, int, int));
  extern	void		change_server_channels 	_((int, int));
+ extern	char *		check_channel_type	_((char *));
  extern	char *		channel_key 		_((char *));
  extern	void		channel_server_delete 	_((int));
  extern	void		clear_channel_list 	_((int));
Only in ../ircii-EPIC3.004.new: my_test
diff -cr ./script/2.8script ../ircii-EPIC3.004.new/script/2.8script
*** ./script/2.8script	Tue Jan 14 17:40:33 1997
--- ../ircii-EPIC3.004.new/script/2.8script	Fri Dec 25 23:38:18 1998
***************
*** 21,27 ****
  			join $before(, $*)
  			join $after(, $*)
  		}
! 		(#*) (&*) (0) (-*) 
  			{ //join $* }
  		() 
  			{ //join -i }
--- 21,27 ----
  			join $before(, $*)
  			join $after(, $*)
  		}
! 		(#*) (!*) (&*) (0) (-*) 
  			{ //join $* }
  		() 
  			{ //join -i }
diff -cr ./source/edit.c ../ircii-EPIC3.004.new/source/edit.c
*** ./source/edit.c	Wed Jan 29 08:43:14 1997
--- ../ircii-EPIC3.004.new/source/edit.c	Fri Dec 25 23:40:07 1998
***************
*** 633,639 ****
  				{
  					is_current_channel(chan, 1);
  					say("You are now talking to channel %s", 
! 						set_channel_by_refnum(0, chan));
  					update_all_windows();
  				}
  			}
--- 633,639 ----
  				{
  					is_current_channel(chan, 1);
  					say("You are now talking to channel %s", 
! 						check_channel_type(set_channel_by_refnum(0, chan)));
  					update_all_windows();
  				}
  			}
Only in ../ircii-EPIC3.004.new/source: edit.c~
diff -cr ./source/funny.c ../ircii-EPIC3.004.new/source/funny.c
*** ./source/funny.c	Mon Dec 30 23:25:50 1996
--- ../ircii-EPIC3.004.new/source/funny.c	Sat Oct 17 18:02:36 1998
***************
*** 248,254 ****
  			if (*channel == '*')
  				put_it(format, "Prv", user_cnt, line);
  			else
! 				put_it(format, channel, user_cnt, line);
  		}
  	}
  }
--- 248,254 ----
  			if (*channel == '*')
  				put_it(format, "Prv", user_cnt, line);
  			else
! 				put_it(format, check_channel_type(channel), user_cnt, line);
  		}
  	}
  }
***************
*** 279,285 ****
  	{
  		if (do_hook(current_numeric, "%s %s %s %s", from, type, channel,
  			line) && get_int_var(SHOW_CHANNEL_NAMES_VAR))
! 			say("Users on %s: %s", channel, line);
  		while ((nick = next_arg(line, &line)) != NULL)
  			add_to_channel(channel, nick, from_server, 0, 0);
  		message_from(NULL, LOG_CURRENT);
--- 279,285 ----
  	{
  		if (do_hook(current_numeric, "%s %s %s %s", from, type, channel,
  			line) && get_int_var(SHOW_CHANNEL_NAMES_VAR))
! 			say("Users on %s: %s", check_channel_type(channel), line);
  		while ((nick = next_arg(line, &line)) != NULL)
  			add_to_channel(channel, nick, from_server, 0, 0);
  		message_from(NULL, LOG_CURRENT);
***************
*** 326,338 ****
  					channel[last_width-1] = '>';
  					channel[last_width] = (char) 0;
  				}
! 				put_it(format, "Pub", channel, line);
  				break;
  			case '*':
! 				put_it(format, "Prv", channel, line);
  				break;
  			case '@':
! 				put_it(format, "Sec", channel, line);
  				break;
  			}
  		}
--- 326,338 ----
  					channel[last_width-1] = '>';
  					channel[last_width] = (char) 0;
  				}
! 				put_it(format, "Pub", check_channel_type(channel), line);
  				break;
  			case '*':
! 				put_it(format, "Prv", check_channel_type(channel), line);
  				break;
  			case '@':
! 				put_it(format, "Sec", check_channel_type(channel), line);
  				break;
  			}
  		}
diff -cr ./source/irc.c ../ircii-EPIC3.004.new/source/irc.c
*** ./source/irc.c	Wed Jan 29 08:43:14 1997
--- ../ircii-EPIC3.004.new/source/irc.c	Fri Oct 23 22:19:22 1998
***************
*** 13,19 ****
  /*
   * irc_version is what $J returns, its the common-name for the version.
   */
! const char irc_version[] = "2.8.2-EPIC3.004";
  
  /*
   * internal_version is what $V returns, its the integer-id for the
--- 13,19 ----
  /*
   * irc_version is what $J returns, its the common-name for the version.
   */
! const char irc_version[] = "2.8.2-EPIC3.004+Kasi";
  
  /*
   * internal_version is what $V returns, its the integer-id for the
diff -cr ./source/names.c ../ircii-EPIC3.004.new/source/names.c
*** ./source/names.c	Mon Dec  9 14:32:43 1996
--- ../ircii-EPIC3.004.new/source/names.c	Fri Dec 25 12:18:17 1998
***************
*** 24,30 ****
  #include "list.h"
  #include "output.h"
  
! static	char	mode_str[] = "iklmnpst";
  
  static	void	add_to_mode_list _((char *, char *));
  static	void	check_mode_list_join _((char *));
--- 24,31 ----
  #include "list.h"
  #include "output.h"
  
! static	char	mode_str[] = "iklmnprst";
! static	char	new_channel_format[BIG_BUFFER_SIZE];
  
  static	void	add_to_mode_list _((char *, char *));
  static	void	check_mode_list_join _((char *));
***************
*** 98,103 ****
--- 99,144 ----
  }
  
  /*
+  * check_channel_type: checks if the given channel is a normal #channel or
+  * a new !channel from irc2.10. If the latter, then it reformats it a bit into
+  * a more user-friendly form.
+  */
+ #ifdef __STDC__
+ extern char * check_channel_type (char *channel)
+ #else
+ extern char * check_channel_type(channel)
+ 	char *channel;
+ #endif
+ {
+ 	int lindex1 = 0, lindex2 = 1;
+ 	
+ 	if (*channel != '!')
+ 		return(channel);
+ 		
+ 	new_channel_format[0] = '[';
+ 	
+ 	while (channel[lindex1] != '\0')
+ 	{
+ 		new_channel_format[lindex2] = channel[lindex1];
+ 		
+ 		if (lindex1 == 5)
+ 		{
+ 			lindex2++;
+ 			new_channel_format[lindex2] = ']';
+ 			lindex2++;
+ 			new_channel_format[lindex2] = ' ';
+ 		}
+ 		
+ 		lindex1++;
+ 		lindex2++;
+ 	}
+ 	
+ 	new_channel_format[lindex2] = '\0';
+ 
+ 	return(new_channel_format);
+ }
+  
+ /*
   * add_channel: adds the named channel to the channel list.  If the channel
   * is already in the list, nothing happens.   The added channel becomes the
   * current channel as well 
***************
*** 307,313 ****
  	char	*rest,
  		*the_key;
  	NickList *ThisNick;
! 	unsigned char	value = 0;
  
  	if (!(mode_str = next_arg(mode_str, &rest)))
  		return -1;
--- 348,354 ----
  	char	*rest,
  		*the_key;
  	NickList *ThisNick;
! 	unsigned 	value = 0;
  
  	if (!(mode_str = next_arg(mode_str, &rest)))
  		return -1;
***************
*** 347,352 ****
--- 388,396 ----
  			break;
  		case 'n':
  			value = MODE_MSGS;
+ 			break;
+ 		case 'r':
+ 			value = MODE_REOP;
  			break;
  		case 's':
  			value = MODE_SECRET;
diff -cr ./source/parse.c ../ircii-EPIC3.004.new/source/parse.c
*** ./source/parse.c	Fri Sep 20 05:45:44 1996
--- ../ircii-EPIC3.004.new/source/parse.c	Thu Oct 29 10:51:42 1998
***************
*** 41,46 ****
--- 41,47 ----
  #define STRING_CHANNEL '+'
  #define MULTI_CHANNEL '#'
  #define LOCAL_CHANNEL '&'
+ #define ID_CHANNEL '!'
  
  #define space ' '	/* Taken from rfc 1453 */
  #define	MAXPARA	15	/* Taken from rfc 1453 */
***************
*** 88,94 ****
  	int	Version;
  
  	Version = get_server_version(from_server);
! 	return ( (*to == MULTI_CHANNEL) 
  		|| (
  #ifdef COMPAT_27
  		    Version > Server2_7 &&
--- 89,95 ----
  	int	Version;
  
  	Version = get_server_version(from_server);
! 	return ( (*to == MULTI_CHANNEL) || (*to == ID_CHANNEL) 
  		|| (
  #ifdef COMPAT_27
  		    Version > Server2_7 &&
***************
*** 215,221 ****
  		message_from(ArgList[0], LOG_CRAP);
  		if (do_hook(TOPIC_LIST, "%s %s %s", from, ArgList[0], ArgList[1]))
  			say("%s has changed the topic on channel %s to %s",
! 				from, ArgList[0], ArgList[1]);
  		message_from((char *) 0, LOG_CURRENT);
  	}
  }
--- 216,222 ----
  		message_from(ArgList[0], LOG_CRAP);
  		if (do_hook(TOPIC_LIST, "%s %s %s", from, ArgList[0], ArgList[1]))
  			say("%s has changed the topic on channel %s to %s",
! 				from, check_channel_type(ArgList[0]), ArgList[1]);
  		message_from((char *) 0, LOG_CURRENT);
  	}
  }
***************
*** 490,500 ****
  		{
  		case PUBLIC_MSG_LIST:
  			if (no_flood && do_hook(list_type, "%s %s %s", from, to, ptr))
! 			    put_it("%s(%s/%s)%s %s", high, from, to, high, ptr);
  			break;
  		case MSG_GROUP_LIST:
  			if (no_flood && do_hook(list_type, "%s %s %s", from, to, ptr))
! 			    put_it("%s-%s:%s-%s %s", high, from, to, high, ptr);
  			break;
  		case MSG_LIST:
  		{
--- 491,501 ----
  		{
  		case PUBLIC_MSG_LIST:
  			if (no_flood && do_hook(list_type, "%s %s %s", from, to, ptr))
! 			    put_it("%s(%s/%s)%s %s", high, from, check_channel_type(to), high, ptr);
  			break;
  		case MSG_GROUP_LIST:
  			if (no_flood && do_hook(list_type, "%s %s %s", from, to, ptr))
! 			    put_it("%s-%s:%s-%s %s", high, from, check_channel_type(to), high, ptr);
  			break;
  		case MSG_LIST:
  		{
***************
*** 525,531 ****
  		case PUBLIC_OTHER_LIST:
  		{
  			if (no_flood && do_hook(list_type, "%s %s %s", from, to, ptr))
! 				put_it("%s<%s:%s>%s %s", high, from, to, high, ptr);
  			break;
  		}
  		}
--- 526,532 ----
  		case PUBLIC_OTHER_LIST:
  		{
  			if (no_flood && do_hook(list_type, "%s %s %s", from, to, ptr))
! 				put_it("%s<%s:%s>%s %s", high, from, check_channel_type(to), high, ptr);
  			break;
  		}
  		}
***************
*** 668,674 ****
  	{
  		message_from(channel, LOG_CRAP);
  		if (do_hook(JOIN_LIST, "%s %s %s", from, channel, FromUserHost))
! 			say("%s (%s) has joined channel %s", from, FromUserHost, channel);
  		message_from((char *) 0, LOG_CURRENT);
  	}
  
--- 669,676 ----
  	{
  		message_from(channel, LOG_CRAP);
  		if (do_hook(JOIN_LIST, "%s %s %s", from, channel, FromUserHost))
! 			say("%s (%s) has joined channel %s", from, FromUserHost, 
! 				check_channel_type(channel));
  		message_from((char *) 0, LOG_CURRENT);
  	}
  
***************
*** 882,888 ****
  			if (flag != IGNORED && do_hook(MODE_LIST, "%s %s %s",
  					from, channel, line))
  				say("Mode change \"%s\" on channel %s by %s",
! 						line, channel, from);
  			update_channel_mode(channel, line);
  		}
  		else
--- 884,890 ----
  			if (flag != IGNORED && do_hook(MODE_LIST, "%s %s %s",
  					from, channel, line))
  				say("Mode change \"%s\" on channel %s by %s",
! 						line, check_channel_type(channel), from);
  			update_channel_mode(channel, line);
  		}
  		else
***************
*** 996,1002 ****
  			update_all_status();
  
  			if (do_hook(KICK_LIST, "%s %s %s %s", who, from, channel, comment))
! 				say("You have been kicked off channel %s by %s (%s)", channel, from, comment);
  
  			if (get_int_var(AUTO_REJOIN_VAR))
  			{
--- 998,1005 ----
  			update_all_status();
  
  			if (do_hook(KICK_LIST, "%s %s %s %s", who, from, channel, comment))
! 				say("You have been kicked off channel %s by %s (%s)", 
! 					check_channel_type(channel), from, comment);
  
  			if (get_int_var(AUTO_REJOIN_VAR))
  			{
***************
*** 1018,1024 ****
  			remove_from_channel(channel, who, from_server);
  			if ((check_ignore_channel(from, FromUserHost, channel, IGNORE_CRAP) != IGNORED) && 
  			     do_hook(KICK_LIST, "%s %s %s %s", who, from, channel, comment))
! 				say("%s has been kicked off channel %s by %s (%s)", who, channel, from, comment);
  		}
  	}
  	message_from(NULL, LOG_CURRENT);
--- 1021,1028 ----
  			remove_from_channel(channel, who, from_server);
  			if ((check_ignore_channel(from, FromUserHost, channel, IGNORE_CRAP) != IGNORED) && 
  			     do_hook(KICK_LIST, "%s %s %s %s", who, from, channel, comment))
! 				say("%s has been kicked off channel %s by %s (%s)", who, 
! 					check_channel_type(channel), from, comment);
  		}
  	}
  	message_from(NULL, LOG_CURRENT);
diff -cr ./source/status.c ../ircii-EPIC3.004.new/source/status.c
*** ./source/status.c	Mon Dec 16 04:00:38 1996
--- ../ircii-EPIC3.004.new/source/status.c	Wed Oct 28 18:54:27 1998
***************
*** 1089,1095 ****
  		if ((num = get_int_var(CHANNEL_NAME_WIDTH_VAR)) && (strlen(channel) > num))
  			channel[num] = 0;
  
! 		sprintf(my_buffer, channel_format, channel);
  		return my_buffer;
  	}
  
--- 1089,1095 ----
  		if ((num = get_int_var(CHANNEL_NAME_WIDTH_VAR)) && (strlen(channel) > num))
  			channel[num] = 0;
  
! 		sprintf(my_buffer, channel_format, check_channel_type(channel));
  		return my_buffer;
  	}
  
diff -cr ./source/window.c ../ircii-EPIC3.004.new/source/window.c
*** ./source/window.c	Fri Dec 13 00:00:42 1996
--- ../ircii-EPIC3.004.new/source/window.c	Sat Oct 17 19:19:36 1998
***************
*** 2728,2741 ****
  					say("Channel %s is bound", arg);
  				else if (is_current_channel(arg, 1))
  				{
! 					say("You are now talking to channel %s", arg);
  					set_channel_by_refnum(0, arg);
  				}
  				else
  				{
  			if (is_on_channel(arg, nickname))
  			{
! 				say("You are now talking to channel %s", arg);
  				set_channel_by_refnum(0, arg);
  			}
  			else if (*arg == '0' && !*(args + 1))
--- 2728,2743 ----
  					say("Channel %s is bound", arg);
  				else if (is_current_channel(arg, 1))
  				{
! 					say("You are now talking to channel %s", 
! 						check_channel_type(arg));
  					set_channel_by_refnum(0, arg);
  				}
  				else
  				{
  			if (is_on_channel(arg, nickname))
  			{
! 				say("You are now talking to channel %s", 
! 					check_channel_type(arg));
  				set_channel_by_refnum(0, arg);
  			}
  			else if (*arg == '0' && !*(args + 1))
--- cut here ---

-- 
Kaspar Landsberg, <kl@snafu.de>
