(Message inbox:26)
Return-Path: kl@berlin.Snafu.DE
Delivery-Date: Tue Jan  6 14:26:33 1998
Received: from mail.cs.tu-berlin.de (root@mail.cs.tu-berlin.de [130.149.17.13])
	by nemesis.acronet.net (8.8.5/8.8.5) with ESMTP id OAA15844
	for <jnelson@acronet.net>; Tue, 6 Jan 1998 14:26:29 -0600 (CST)
Received: from kasparl.isdn.cs.tu-berlin.de (root@kasparl.isdn.cs.tu-berlin.de [130.149.149.162])
	by mail.cs.tu-berlin.de (8.8.6/8.8.8) with SMTP id VAA13329
	for <jnelson@acronet.net>; Tue, 6 Jan 1998 21:31:48 +0100 (MET)
Received: by kasparl.isdn.cs.tu-berlin.de
	via sendmail with stdio
	id <m0xpfeH-0009ZFC@kasparl.isdn.cs.tu-berlin.de>
	for jnelson@acronet.net; Tue, 6 Jan 1998 21:30:53 +0100 (CET)
	(Smail-3.2 1996-Jul-4 #1 built 1997-Jun-2)
Message-Id: <m0xpfeH-0009ZFC@kasparl.isdn.cs.tu-berlin.de>
From: kl@berlin.Snafu.DE (Kaspar Landsberg)
Subject: EPIC: little patch
To: jnelson@acronet.net (Jeremy Nelson)
Date: Tue, 6 Jan 1998 21:30:53 +0100 (CET)
X-Mailer: ELM [version 2.4ME+ PL32 (25)]
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit

Hi,

this is the patch i'm distributing to everyone who complains to me about
the join+mode problem when using epic3.004 and 2.9.4 servers (or above). Feel
free to do whatever you want with it (if someone should complain to you, just
send it to him/her). I hope this one doesn't break anything... =)

Bye, Kasi

--- cut here ---
*** parse.c.orig	Fri Sep 20 05:45:44 1996
--- parse.c	Mon Jan  5 14:54:21 1998
***************
*** 625,631 ****
  #endif
  {
  	char	*c, *channel = NULL;
! 	int op = 0, vo = 0;
  
  	if (!strcmp(ArgList[0], "0"))
  		{fake();return;}
--- 625,632 ----
  #endif
  {
  	char	*c, *channel = NULL;
! 	int op = 0, vo = 0, its_me = 0;
! 	char	extra[20];
  
  	if (!strcmp(ArgList[0], "0"))
  		{fake();return;}
***************
*** 633,639 ****
  	channel = ArgList[0];
  	message_from(channel, LOG_CRAP);
  	malloc_strcpy(&joined_nick, from);
! 	notify_mark(from, 1, 0);
  
  	if (!my_stricmp(from, get_server_nickname(from_server)))
  	{
--- 634,655 ----
  	channel = ArgList[0];
  	message_from(channel, LOG_CRAP);
  	malloc_strcpy(&joined_nick, from);
! 
! 	/* Workaround for extremely gratuitous protocol change in irc2.9 */
! 	*extra = 0;
! 	if ((c = strchr(channel, '\007')))
! 	{
! 			for (*c++ = 0; *c; c++)
! 			{
! 					if (*c == 'o') op = 1;
! 			   else if (*c == 'v') vo = 1;
! 			}
! 			
! 			if (op)
! 					strcat(extra, " (+o)");
! 			if (vo)
! 					strcat(extra, " (+v)");
! 	}
  
  	if (!my_stricmp(from, get_server_nickname(from_server)))
  	{
***************
*** 641,663 ****
  		send_to_server("MODE %s", channel);
  /*		send_to_server("WHO %s", channel);	*/
  		funny_set_ignore_channel(channel);
  	}
  	else
- 	{
- 		/*
- 		 * Workaround for gratuitous protocol change in ef2.9
- 		 */
- 		if ((c = index(channel, '\007')))
- 		{
- 			for (*c++ = 0; *c; c++)
- 			{
- 				     if (*c == 'o') op = 1;
- 				else if (*c == 'v') vo = 1;
- 			}
- 		}
- 
  		add_to_channel(channel, from, from_server, op, vo);
- 	}
  
  #ifdef I_DONT_TRUST_MY_USERS
  	if (!get_channel_oper(channel, from_server))
--- 657,666 ----
  		send_to_server("MODE %s", channel);
  /*		send_to_server("WHO %s", channel);	*/
  		funny_set_ignore_channel(channel);
+ 		its_me = 1;
  	}
  	else
  		add_to_channel(channel, from, from_server, op, vo);
  
  #ifdef I_DONT_TRUST_MY_USERS
  	if (!get_channel_oper(channel, from_server))
***************
*** 667,676 ****
  	if (check_ignore_channel(from, FromUserHost, channel, IGNORE_CRAP) != IGNORED)
  	{
  		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);
  	}
  
  #ifdef I_DONT_TRUST_MY_USERS
  	in_on_who = 0;
--- 670,687 ----
  	if (check_ignore_channel(from, FromUserHost, channel, IGNORE_CRAP) != IGNORED)
  	{
  		message_from(channel, LOG_CRAP);
! 		if (do_hook(JOIN_LIST, "%s %s %s %s", 
! 							from, channel, FromUserHost, its_me ? "" : extra))
! 			say("%s (%s) has joined channel %s%s", 
! 							from, FromUserHost, channel, its_me ? "" : extra);
  		message_from((char *) 0, LOG_CURRENT);
  	}
+ 	
+ 	/*
+ 	** This should be done last to ensure that the userhost has been
+ 	** properly handled...
+ 	*/
+ 	notify_mark(from, 1, 0);
  
  #ifdef I_DONT_TRUST_MY_USERS
  	in_on_who = 0;
--- cut here ---

-- 
Kaspar Landsberg, <kl@berlin.Snafu.DE>













