From: vegard@hp825.bih.no (Vegard Engen)
Subject: user@host on incoming messages.
Originator: vegard@hp825.bih.no
Organization: Bergen College of Engineering, Bergen, Norway.
Date: Thu, 1 Oct 92 13:11:38 GMT


Thanks to AnneMarit, who requested this, I'm here releasing a patch
and a script that makes your ircII-client show the user@host on the
FIRST incoming /msg for every nick. It checks if the user@host is
changed, and displays it again if so. This works on ircII 2.2pre7,
haven't tested for others. 

Please note that this may or may not be compatible with future versions
of ircII.  Also note that I am NOT generally coding ircII, just when _I_
find something I think could be useful, or when I find a bug that _I_
need to fix :)) Well, here it is, use it at your own risk. It works for
me, but I can't guarantee it will work for anyone else. The rest of this
article should be saved in TWO different files. 

---- cut here - this, and up to the next "cut here", is parse.c.diff ----

*** parse.c.old	Mon Sep 21 17:04:22 1992
--- parse.c.new	Mon Sep 21 17:03:29 1992
***************
*** 449,459 ****
  	no_flood = check_flooding(from, flood_type,ptr);
  	switch (list_type) {
  	    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:
--- 449,459 ----
  	no_flood = check_flooding(from, flood_type,ptr);
  	switch (list_type) {
  	    case PUBLIC_MSG_LIST:
! 		if (no_flood && do_hook(list_type, "%s %s %s %s", from, FromUserHost, 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 %s", from, FromUserHost, to, ptr))
  		    put_it("%s-%s:%s-%s %s", high, from, to, high, ptr);
  		break;
  	    case MSG_LIST:
***************
*** 469,489 ****
  		    t = time(0);
  		    msg = (char *) new_malloc(strlen(ptr) + 20);
  		    sprintf(msg, "%s <%.16s>", ptr, ctime(&t));
! 		    if (no_flood && do_hook(list_type, "%s %s", from, msg))
  			put_it("%s*%s*%s %s", high, from, high, msg);
  		    new_free(&msg);
  		    beep_em(get_int_var(BEEP_WHEN_AWAY_VAR));
  		} else {
! 		    if (no_flood && do_hook(list_type, "%s %s", from, ptr))
  			put_it("%s*%s*%s %s", high, from, high, ptr);
  		}
  		break;
  	    case PUBLIC_LIST:
! 		if (no_flood && do_hook(list_type, "%s %s", from, ptr))
  		    put_it("%s<%s>%s %s", high, from, high, ptr);
  		break;
  	    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;
  	}
--- 469,489 ----
  		    t = time(0);
  		    msg = (char *) new_malloc(strlen(ptr) + 20);
  		    sprintf(msg, "%s <%.16s>", ptr, ctime(&t));
! 		    if (no_flood && do_hook(list_type, "%s %s %s", from, FromUserHost, msg))
  			put_it("%s*%s*%s %s", high, from, high, msg);
  		    new_free(&msg);
  		    beep_em(get_int_var(BEEP_WHEN_AWAY_VAR));
  		} else {
! 		    if (no_flood && do_hook(list_type, "%s %s %s", from, FromUserHost, ptr))
  			put_it("%s*%s*%s %s", high, from, high, ptr);
  		}
  		break;
  	    case PUBLIC_LIST:
! 		if (no_flood && do_hook(list_type, "%s %s %s", from, FromUserHost, ptr))
  		    put_it("%s<%s>%s %s", high, from, high, ptr);
  		break;
  	    case PUBLIC_OTHER_LIST:
! 		if (no_flood && do_hook(list_type, "%s %s %s %s", from, FromUserHost, to, ptr))
  		    put_it("%s<%s:%s>%s %s", high, from, to, high, ptr);
  		break;
  	}
***************
*** 531,540 ****
      log_type = set_lastlog_msg_level(LOG_PUBLIC);
      no_flooding = check_flooding(from, PUBLIC_FLOOD,text);
      if (is_current_channel(channel, 0)) {
! 	if (no_flooding && do_hook(PUBLIC_LIST, "%s %s", from, text))
  	    put_it("%s<%s>%s %s", high, from, high, text);
      } else {
! 	if (no_flooding && do_hook(PUBLIC_OTHER_LIST, "%s %s %s", from, channel, text))
  	    put_it("%s<%s:%s>%s %s", high, from, channel, high, text);
      }
      if (beep_on_level & LOG_PUBLIC)
--- 531,540 ----
      log_type = set_lastlog_msg_level(LOG_PUBLIC);
      no_flooding = check_flooding(from, PUBLIC_FLOOD,text);
      if (is_current_channel(channel, 0)) {
! 	if (no_flooding && do_hook(PUBLIC_LIST, "%s %s %s", from, FromUserHost, text))
  	    put_it("%s<%s>%s %s", high, from, high, text);
      } else {
! 	if (no_flooding && do_hook(PUBLIC_OTHER_LIST, "%s %s %s %s", from, FromUserHost, channel, text))
  	    put_it("%s<%s:%s>%s %s", high, from, channel, high, text);
      }
      if (beep_on_level & LOG_PUBLIC)

-------- cut here - the rest of the article is the script --------

# UserHost v 1.0
# Author: Veggen (vegard@bih.no) (Vegard Engen)
# Date: 30.09.92.

@ UsrHost = 0
alias ShowUserHost {
        @ UsrHost = MATCH($1 $($(${0}).UsrHost))
        ^if ( UsrHost )  
		{ echo *$0* $2- }
		{ assign $(${0}).UsrHost $1
		  echo *$0\($1\)* $2- }
}

on #^msg 2 * {
  ShowUserHost $0-
  }
on ^msg * comment

Newsgroups: alt.irc.ircii