rem: screen.print_line(from_nick+" has quit "+channels.current.display+" ( "+full_message+" "+message.join(" ")+")"); 
add: screen.print_line(printf(QUIT_FORMAT,from_nick,channels.current.display,full_message+" "+message.join(" "))); 
context: function handle_command(prefix,command,message)  {	var from_nick=null;	var full_message=null;	var tmp_str=null;	var tmp_str2=null;	var	i=0;	switch(command)  {		case "PING":			sock.send("PONG "+message[0]+"\r\n");			break;		case "NOTICE":			message.shift();			from_nick=get_highlighted_nick(prefix,message);			full_message=message.join(" ");			full_message=full_message.substr(1);			full_message=full_message.replace(/\x01/g,"");			screen.print_line("\x01N\x01R$\x01N\x01W"+from_nick+"\x01N\x01R$\x01N\x01W "+full_message);			break;		case "KICK":			tmp_str=message.shift();			tmp_str2=message.shift();			from_nick=get_nick(prefix);			full_message=message.join(" ").substr(1);			if(tmp_str2.toUpperCase()==nick.toUpperCase())  {				channels.part(tmp_str,"");			}			screen.print_line("\x01N\x01R-\x01H\x01R- "+tmp_str2+" has been kicked from "+tmp_str+" ("+full_message+")");			break;		case "PRIVMSG":			if(message[1].substr(0,2)==":\x01")  {				// CTCP				handle_ctcp(prefix,message);			}			else  {				if(prefix=="")					from_nick="[-]";				else  {					from_nick=get_highlighted_nick(prefix,message);					message[0]=message[0].toUpperCase();					if(channels.current != undefined)  {						if(message[0]==channels.current.name)  {							from_nick="\x01N\x01B<\x01N\x01W"+from_nick+"\x01N\x01B>\x01N\x01W";						}						else  {							from_nick=from_nick+"\x01N\x01C-\x01H\x01C>\x01N\x01W";							if(message[0].slice(0,1)=="#" || message[0].slice(0,1)=="&")  {								from_nick=from_nick+"\x01N\x01C"+message[0]+":\x01N\x01W ";							}						}					}					else  {						from_nick="\x01N\x01B<\x01N\x01W"+from_nick+"\x01N\x01B>\x01N\x01W";					}				}				message.shift();				message[0]=message[0].substr(1);				screen.print_line(from_nick+" "+message.join(" "));			}			break;		case "JOIN":			from_nick=get_highlighted_nick(prefix,message);			tmp_str=get_nick(prefix);			if(tmp_str.toUpperCase()==nick.toUpperCase())  {				channels.joined(message[0].substr(1));			}			else  {				channels.nick_add(tmp_str,message[0].substr(1));			}			prefix=prefix.substr(1);			screen.print_line("\x01N\x01C"+from_nick+" ("+prefix+")"+" has joined "+message[0].substr(1));			break;		case "QUIT":			from_nick=get_highlighted_nick(prefix,message);			tmp_str=get_nick(prefix);			prefix=prefix.substr(1);			full_message=message.shift();			full_message=full_message.substr(1);			screen.print_line(from_nick+" has quit "+channels.current.display+" ( "+full_message+" "+message.join(" ")+")");			channels.nick_quit(tmp_str);			break;		case "NICK":			from_nick=get_highlighted_nick(prefix,message);			tmp_str2=get_nick(prefix);			prefix=prefix.substr(1);			tmp_str=message.shift();			tmp_str=tmp_str.substr(1);			tmp_str=tmp_str.split("!",1)[0]			screen.print_line(from_nick+" has changed nick to "+tmp_str);			if(tmp_str2.toUpperCase()==nick.toUpperCase())  {				nick=tmp_str;				screen.update_statline();			}			channels.nick_change(tmp_str2,tmp_str);			break;		case "SQUIT":			if(prefix.slice(0,1)==":")  {				from_nick=get_nick(prefix);				tmp_str=message.shift();				tmp_str2=message.shift();				tmp_str2=tmp_str2.substr(1);				screen.print_line(from_nick+" has disconnected the server "+tmp_str+" ( "+tmp_str2+message.join(" ")+" )");			}			else  {				tmp_str=message.shift();				tmp_str2=message.shift();				tmp_str2=tmp_str2.substr(1);				screen.print_line("The server "+tmp_str+" has disconnected ( "+tmp_str2+message.join(" ")+" )");			}		case "PART":			from_nick=get_highlighted_nick(prefix,message);			tmp_str=get_nick(prefix);			prefix=prefix.substr(1);			screen.print_line(from_nick+" ("+prefix+")"+" has left "+message[0].substr(1));			channels.nick_part(tmp_str,message[0].substr(1));			break;		case "MODE":			from_nick=get_highlighted_nick(prefix,message);			prefix=prefix.substr(1);			tmp_str=from_nick+" has set MODE "+message[0]+" for "+message[1];			if(message.length>1)  {				tmp_str=tmp_str+" Limit: "+message[1];			}			if(message.length>2)  {				tmp_str=tmp_str+" User: "+message[2];			}			if(message.length>3)  {				tmp_str=tmp_str+" ("+message[3]+")";			}			screen.print_line(tmp_str);			break;		case "TOPIC":			from_nick=get_highlighted_nick(prefix,message);			tmp_str=message.shift();			tmp_str2=message.join(" ");			tmp_str2=tmp_str2.substr(1);			for(i=0;i<channels.length;i++)  {				if(tmp_str.toUpperCase()==channels.channel[i].name)  {					channels.channel[i].topic=tmp_str2;					screen.update_statline();					screen.print_line(from_nick+" has changed the topic of "+tmp_str+" to '"+tmp_str2+"'");				}			}			break;		// Numeric reply codes.		// <word1> <word2> <word3> <word4> <word5> <word6> <word7> :Message		case "211":		// Trace Server			message.shift();			tmp_str=message.shift();			tmp_str=tmp_str+" "+message.shift();			tmp_str=tmp_str+" "+message.shift();			tmp_str=tmp_str+" "+message.shift();			tmp_str=tmp_str+" "+message.shift();			tmp_str=tmp_str+" "+message.shift();			tmp_str=tmp_str+" "+message.shift();			tmp_str2=message.shift();			tmp_str2="\x01H\x01C!! \x01N\x01C"+tmp_str+" "+tmp_str2.substr(1)+" "+message.join(" ")+"\x01N\x01W";			screen.print_line(tmp_str2);			break;		// <word1> <word2> <word3> <word4> <word5> <word6> :Message		case "352":		// WHO reply		case "206":		// Trace Server		case "213":		// Stats CLINE		case "214":		// Stats NLINE		case "215":		// Stats ILINE		case "216":		// Stats KLINE		case "218":		// Stats YLINE			message.shift();			tmp_str=message.shift();			tmp_str=tmp_str+" "+message.shift();			tmp_str=tmp_str+" "+message.shift();			tmp_str=tmp_str+" "+message.shift();			tmp_str=tmp_str+" "+message.shift();			tmp_str=tmp_str+" "+message.shift();			tmp_str2=message.shift();			tmp_str2="\x01H\x01C!! \x01N\x01C"+tmp_str+" "+tmp_str2.substr(1)+" "+message.join(" ")+"\x01N\x01W";			screen.print_line(tmp_str2);			break;		// <word1> <word2> <word3> <word4> <word5> :Message		case "241":		// Stats LLINE			message.shift();			tmp_str=message.shift();			tmp_str=tmp_str+" "+message.shift();			tmp_str=tmp_str+" "+message.shift();			tmp_str=tmp_str+" "+message.shift();			tmp_str=tmp_str+" "+message.shift();			tmp_str2=message.shift();			tmp_str2="\x01H\x01C!! \x01N\x01C"+tmp_str+" "+tmp_str2.substr(1)+" "+message.join(" ")+"\x01N\x01W";			screen.print_line(tmp_str2);			break;		// <word1> <word2> <word3> <word4> :Message		case "311":		// WHOIS reply		case "314":		// WHOWAS reply		case "200":		// Trace Link		case "243":		// Stats OLINE		case "244":		// Stats HLINE			message.shift();			tmp_str=message.shift();			tmp_str=tmp_str+" "+message.shift();			tmp_str=tmp_str+" "+message.shift();			tmp_str=tmp_str+" "+message.shift();			tmp_str2=message.shift();			tmp_str2="\x01H\x01C!! \x01N\x01C"+tmp_str+" "+tmp_str2.substr(1)+" "+message.join(" ")+"\x01N\x01W";			screen.print_line(tmp_str2);			break;		// <word1> <word2> <word3> :Message		case "324":		// Channel Modes		case "201":		// Trace Connecting		case "202":		// Trace Handshake		case "203":		// Trace Unknown		case "204":		// Trace Operator		case "205":		// Trace User		case "208":		// New type of trace		case "261":		// Trace LOG			message.shift();			tmp_str=message.shift();			tmp_str=tmp_str+" "+message.shift();			tmp_str=tmp_str+" "+message.shift();			tmp_str2=message.shift();			tmp_str2="\x01H\x01C!! \x01N\x01C"+tmp_str+" "+tmp_str2.substr(1)+" "+message.join(" ")+"\x01N\x01W";			screen.print_line(tmp_str2);			break;		// <word1> <word2> :Message		case "312":		// WHOISSERVER Reply		case "317":		// WHOISIDLE Reply		case "322":		// LIST data		case "341":		// Invite being sent		case "351":		// (server) VERSION reply		case "364":		// Links		case "367":		// Ban List		case "212":		// Stats Command			message.shift();			tmp_str=message.shift();			tmp_str=tmp_str+" "+message.shift();			tmp_str2=message.shift();			tmp_str2="\x01H\x01C!! \x01N\x01C"+tmp_str+" "+tmp_str2.substr(1)+" "+message.join(" ")+"\x01N\x01W";			screen.print_line(tmp_str2);			break;		// <word> :Message		case "313":		// WHOISOPERATOR Reply		case "319":		// WHOISCHANNELS Reply		case "301":		// AWAY Reply		case "318":		// End of WHOIS Reply		case "369":		// End of WHOWAS Reply		case "321":		// LIST Start		case "342":		// Is Summoning.		case "315":		// End of WHO		case "365":		// End of LINKS		case "368":		// End of ban list		case "382":		// Rehashing		case "391":		// Time reply		case "219":		// End if stats		case "221":		// UMODE reply		case "252":		// # Operators online		case "253":		// # unknown connections		case "254":		// # channels		case "256":		// Admin info			message.shift();			tmp_str=message.shift();			tmp_str2=message.shift();			tmp_str2="\x01H\x01C!! \x01N\x01C"+tmp_str+" - "+tmp_str2.substr(1)+" "+message.join(" ")+"\x01N\x01W";			screen.print_line(tmp_str2);			break;					case "376":		// MOTD End			if (loading) {				loading = false;				channels.join(default_channel);			}		// :Message		case "001":		// Sent on successful registration		case "002":		// Sent on successful registration		case "003":		// Sent on successful registration		case "004":		// Sent on successful registration		case "005":		// Sent on successful registration		case "265":             // Local Users		case "266":             // Global Users		case "381":		// You're OPER		case "302":		// USERHOST Reply		case "303":		// ISON Reply		case "305":		// You are no longer away		case "306":		// You are now marked as away		case "323":		// LIST end		case "371":		// INFO		case "374":		// End if info list		case "392":		// USERS Start		case "393":		// USERS		case "394":		// USERS End		case "395":		// No users		case "242":		// Stats Uptime		case "251":		// LUSER Client		case "255":		// # Clients / # Servers		case "257":		// Admin LOC 1		case "258":		// Admin LOC 2		case "259":		// Admin e-mail		case "375":		// MOTD Start		case "372":		// MOTD		case "333":		// Extended TOPIC info (apparently)			message.shift();			tmp_str=message.shift();			tmp_str="\x01H\x01C!! \x01N\x01C"+tmp_str.substr(1)+" "+message.join(" ")+"\x01N\x01W";			screen.print_line(tmp_str);			break;				case "331":		// No Topic		case "332":		// Topic			message.shift();			tmp_str=message.shift();			tmp_str2=message.join(" ");			tmp_str2=tmp_str2.substr(1);			for(i=0;i<channels.length;i++)  {				if(tmp_str.toUpperCase()==channels.channel[i].name)  {					channels.channel[i].topic=tmp_str2;					screen.update_statline();				}			}			break;		case "353":		// Name reply			message.shift();			message.shift();			tmp_str=message.shift();			message[0]=message[0].substr(1);			for(i=0;i<message.length;i++)  {				if(message[i].slice(0,1)=="@" || message[i].slice(0,1)=="+")  {					message[i]=message[i].substr(1);				}			}			for(i=0;i<channels.length;i++)  {				if(tmp_str.toUpperCase()==channels.channel[i].name)  {					channels.channel[i].nick=message;				}			}			screen.print_line("\x01N\x01BPeople in "+tmp_str+" right now: "+message.join(" "));			break;					case "366":		// End of Names			break;		// Error Codes		// <word1> <word2> :Message errors		case "441":		// Nick not on channel		case "443":		// User already on channel (invite)			message.shift();			tmp_str=message.shift();			tmp_str=tmp_str+" "+message.shift();			tmp_str2=message.shift();			tmp_str2="\x01H\x01R!! \x01N\x01R"+tmp_str+" "+tmp_str2.substr(1)+" "+message.join(" ")+"\x01N\x01W";			screen.print_line(tmp_str2);			break;		// <word> :Message errors.		case "433":		// Nickname already in use			message.shift();			nick=message.shift()+"_";			sock.send("NICK " + nick + "\r\n");			break;		case "401":		// No such nick		case "402":		// No such server		case "403":		// No such channel		case "404":		// Cannot send to channel		case "405":		// Too Many Channels		case "406":		// Was no suck nickname		case "407":		// Too many targets		case "413":		// No toplevel domain specified		case "414":		// Wildcard in TLD		case "421":		// Unknown Command		case "423":		// No admin info available		case "432":		// Erroneous Nick... bad chars		case "436":		// Nick collision KILL		case "442":		// You aren't on that channel		case "444":		// User not logged in (From SUMMON command)		case "461":		// Not enough params		case "467":		// Channel key already set		case "471":		// Channel is full (+l)		case "472":		// Unknown mode		case "473":		// Invide only channel (And YOU aren't invided)		case "474":		// Banned from channel		case "475":		// Bad channel key (+k)		case "482":		// Not ChanOP so can't do that.			message.shift();			tmp_str=message.shift();			tmp_str2=message.shift();			tmp_str2="\x01H\x01R!! \x01N\x01R"+tmp_str+" - "+tmp_str2.substr(1)+" "+message.join(" ")+"\x01N\x01W";			screen.print_line(tmp_str2);			break;					// :Message errors.		case "422":		// MOTD is missing		case "409":		// No origin		case "411":		// No recipient		case "412":		// No text to send		case "424":		// File Error		case "431":		// No nickname given		case "445":		// SUMMON disabled		case "446":		// USERS disabled		case "451":		// You aren't registered		case "462":		// You're ALREADY registered		case "463":		// You aren't allowed to connect (HOST based)		case "464":		// Incorrect password		case "465":		// You are banned		case "481":		// You aren't an IRCOP so you can't do that.		case "483":		// You can't kill a server.		case "491":		// No O-lines for your host		case "501":		// Unknown MODE flag		case "502":		// Can't change other users mode			message.shift();			tmp_str=message.shift();			tmp_str="\x01H\x01R!! \x01N\x01R"+tmp_str.substr(1)+" "+message.join(" ")+"\x01N\x01W";			screen.print_line(tmp_str);			break;		default:			screen.print_line("\x01N\x01R"+prefix+" "+command+" "+message.join(" ")+"\x01N\x01W");	}}
meta: 9592	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9592/2a9267c11b066bd6eeec69cd88348759f5ba9f02/irc.js/clean/irc.js