rem: }  if (who.Channel) 
add: } else if (who.Channel) { 
context: function IRCClient_do_complex_who(cmd) {	var who = new Who();	var tmp;	var eow = "*";	var add = true;	// assume the user is doing + by default	var arg = 1;	var whomask = "";	var chan;	// RFC1459 Compatibility.  "WHO <mask> o"  Only do it if we find a	// wildcard, otherwise assume we're doing a complex WHO with 'modes'	if (cmd[2] && ( (cmd[1].match(/[*]/)) || cmd[1].match(/[?]/)) ||	    (cmd[1].match(/[0]/)) && !cmd[3] && (cmd[2].toLowerCase() == "o")) {		tmp = cmd[1];		cmd[1] = cmd[2];		cmd[2] = tmp;	}	for (myflag in cmd[1]) {		switch (cmd[1][myflag]) {			case "+":				if (!add)					add = true;				break;			case "-":				if (add)					add = false;				break;			case "a":				who.tweak_mode(WHO_AWAY,add);				break;			case "c":				arg++;				if (cmd[arg]) {					who.tweak_mode(WHO_CHANNEL,add);					who.Channel = cmd[arg];				}				break;			case "g":				arg++;				if (cmd[arg]) {					who.tweak_mode(WHO_REALNAME,add);					who.RealName = cmd[arg];				}				break;			case "h":				arg++;				if (cmd[arg]) {					who.tweak_mode(WHO_HOST,add);					who.Host = cmd[arg];				}				break;			case "i":				arg++;				if (cmd[arg]) {					who.tweak_mode(WHO_IP,add);					who.IP = cmd[arg];				}				break;			case "l":				arg++;				if (cmd[arg]) {					who.tweak_mode(WHO_CLASS,add);					who.Class = parseInt(cmd[arg]);				}			case "m": // we never set -m				arg++;				if (cmd[arg]) {					who.tweak_mode(WHO_UMODE,true);					if (!add) {						var tmp_umode = "";						if ((cmd[arg][0] != "+") ||						    (cmd[arg][0] != "-") )							tmp_umode += "+";						tmp_umode += cmd[arg].replace(/[-]/g," ");						tmp_umode = tmp_umode.replace(/[+]/g,"-");						who.UMode = tmp_umode.replace(/[ ]/g,"+");					} else {						who.UMode = cmd[arg];					}				}				break;			case "n":				arg++;				if (cmd[arg]) {					who.Nick = cmd[arg];					who.tweak_mode(WHO_NICK,add);				}				break;			case "o":				who.tweak_mode(WHO_OPER,add);				break;			case "s":				arg++;				if (cmd[arg]) {					who.Server = cmd[arg];					who.tweak_mode(WHO_SERVER,add);				}				break;			case "t":				arg++;				if (cmd[arg]) {					who.Time = parseInt(cmd[arg]);					who.tweak_mode(WHO_TIME,add);				}				break;			case "u":				arg++;				if (cmd[arg]) {					who.User = cmd[arg];					who.tweak_mode(WHO_USER,add);				}				break;			case "C":				who.tweak_mode(WHO_FIRST_CHANNEL,add);				break;			case "M":				who.tweak_mode(WHO_MEMBER_CHANNEL,add);				break;			case "I":				who.tweak_mode(WHO_SHOW_IPS_ONLY,add);				break;			default:				break;		}	}	// Check to see if the user passed a generic mask to us for processing.	arg++;	if (cmd[arg])		whomask = cmd[arg];	var regexp = "^[0]{1,}$";	if (whomask.match(regexp))		whomask = "*";	// allow +c/-c to override.	if (!who.Channel && ((whomask[0] == "#") || (whomask[0] == "&")))		who.Channel = whomask;	// Strip off any @ or + in front of a channel and set the flags.	var sf_op = false;	var sf_voice = false;	var sf_done = false;	var tmp_wc = who.Channel;	for (cc in tmp_wc) {		switch(tmp_wc[cc]) {			case "@":				sf_op = true;				who.Channel = who.Channel.slice(1);				break;			case "+":				sf_voice = true;				who.Channel = who.Channel.slice(1);				break;			default: // assume we're done				sf_done = true;				break;		}		if (sf_done)			break;	}	delete tmp_wc; // don't need this anymore.	// Now we traverse everything and apply the criteria the user passed.	var who_count = 0;	for (who_client in Users) {		var wc = Users[who_client];		var flag_M = this.onchanwith(wc);		// Don't even bother if the target is +i and the		// user isn't an oper or on a channel with the target.		if ( (wc.mode&USERMODE_INVISIBLE) &&		     !(this.mode&USERMODE_OPER) &&		     !flag_M)			continue;		if ((who.add_flags&WHO_AWAY) && !wc.away)			continue;		else if ((who.del_flags&WHO_AWAY) && wc.away)			continue;		if (who.add_flags&WHO_CHANNEL) {			if (!wc.channels[who.Channel.toUpperCase()])				continue;			if (sf_op && Channels[who.Channel.toUpperCase()]&&			    !Channels[who.Channel.toUpperCase()].modelist			    [CHANMODE_OP][wc.id])				continue;			if(sf_voice&&Channels[who.Channel.toUpperCase()]&&			    !Channels[who.Channel.toUpperCase()].modelist			    [CHANMODE_VOICE][wc.id])				continue;		} else if (who.del_flags&WHO_CHANNEL) {				if (wc.channels[who.Channel.toUpperCase()])				continue;			if (sf_op && Channels[who.Channel.toUpperCase()]&&			    Channels[who.Channel.toUpperCase()].modelist			    [CHANMODE_OP][wc.id])				continue;			if(sf_voice&&Channels[who.Channel.toUpperCase()]&&			    Channels[who.Channel.toUpperCase()].modelist			    [CHANMODE_VOICE][wc.id])				continue;		}		if ((who.add_flags&WHO_REALNAME) &&		    !wildmatch(wc.realname,who.RealName))			continue;		else if ((who.del_flags&WHO_REALNAME) &&		    wildmatch(wc.realname,who.RealName))			continue;		if ((who.add_flags&WHO_HOST) &&		    !wildmatch(wc.hostname,who.Host))			continue;		else if ((who.del_flags&WHO_HOST) &&		    wildmatch(wc.hostname,who.Host))			continue;		if ((who.add_flags&WHO_IP) &&		    !wildmatch(wc.ip,who.IP))			continue;		else if ((who.del_flags&WHO_IP) &&		    wildmatch(wc.ip,who.IP))			continue;		if (who.add_flags&WHO_UMODE) { // no -m			var sic = false;			var madd = true;			for (mm in who.UMode) {				switch(who.UMode[mm]) {					case "+":						if (!madd)							madd = true;						break;					case "-":						if (madd)							madd = false;						break;					case "o":					case "i":					case "w":					case "b":					case "g":					case "s":					case "c":					case "r":					case "k":					case "f":					case "y":					case "d":					case "n":					case "h":					case "F":						if (						   (!madd && (wc.mode&						   USERMODE_CHAR							[who.UMode[mm]])						   )						||						   (madd && !(wc.mode&						   USERMODE_CHAR							[who.UMode[mm]])						   ) )							sic = true;						break;					default:						break;				}				if (sic)					break;			}			if (sic)				continue;		}		if ((who.add_flags&WHO_NICK) &&		    !wildmatch(wc.nick,who.Nick))			continue;		else if ((who.del_flags&WHO_NICK) &&		    wildmatch(wc.nick,who.Nick))			continue;		if ((who.add_flags&WHO_OPER) &&		    !(wc.mode&USERMODE_OPER))			continue;		else if ((who.del_flags&WHO_OPER) &&		    (wc.mode&USERMODE_OPER))			continue;		if ((who.add_flags&WHO_SERVER) &&		    !wildmatch(wc.servername,who.Server))			continue;		else if ((who.del_flags&WHO_SERVER) &&		    wildmatch(wc.servername,who.Server))			continue;		if ((who.add_flags&WHO_USER) &&		    !wildmatch(wc.uprefix,who.User))			continue;		else if ((who.del_flags&WHO_USER) &&		    wildmatch(wc.uprefix,who.User))			continue;		if ((who.add_flags&WHO_MEMBER_CHANNEL) && !flag_M)			continue;		else if ((who.del_flags&WHO_MEMBER_CHANNEL) && flag_M)			continue;		if ((who.add_flags&WHO_TIME) &&		    ((time() - wc.connecttime) < who.Time) )			continue;		else if ((who.del_flags&WHO_TIME) &&		    ((time() - wc.connecttime) > who.Time) )			continue;		if ((who.add_flags&WHO_CLASS) &&		    (wc.ircclass != who.Class))			continue;		else if ((who.del_flags&WHO_CLASS) &&		    (wc.ircclass == who.Class))			continue;		if (whomask && !wc.match_who_mask(whomask))			continue;       		chan = "";		if ((who.add_flags&WHO_FIRST_CHANNEL) && !who.Channel) {			for (x in wc.channels) {				if(wc.channels[x] &&				   (!(Channels[wc.channels[x]].mode&				       CHANMODE_SECRET ||				      Channels[wc.channels[x]].mode&				       CHANMODE_PRIVATE				      ) ||				this.channels[wc.channels[x].toUpperCase]||				this.mode&USERMODE_OPER)				   ) {					chan = Channels[wc.channels[x]].nam;					break;				}			}		}		if (who.Channel)			chan = who.Channel;		var show_ips_only;		if (who.add_flags&WHO_SHOW_IPS_ONLY)			show_ips_only = true;		else			show_ips_only = false;		// If we made it this far, we're good.		if (chan && Channels[chan.toUpperCase()]) {			var chkwho = this.numeric352(wc,show_ips_only,Channels[chan.toUpperCase()]);			if (!chkwho)				umode_notice(USERMODE_OPER,"Notice","WHO returned 0 for user: " + wc.nick + " (C)");		} else {			var chkwho = this.numeric352(wc,show_ips_only);			if (!chkwho)				umode_notice(USERMODE_OPER,"Notice","WHO returned 0 for user: " + wc.nick + " (D)");		}		who_count++;		if (!(this.mode&USERMODE_OPER) && (who_count >= max_who))			break;	}	if (who.Channel)		eow = who.Channel;	else if (cmd[2])		eow = cmd[2];	this.numeric(315, eow + " :End of /WHO list. (Complex)");}
meta: 9592	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9592/8e827bdecb04679155adebfc0d3059428c1c52a7/ircd.js/buggy/ircd.js