rem: USERMODE_OPER)) ) sic = true; break; case "i": if ( (!madd && (wc.mode& USERMODE_INVISIBLE)) || (madd && !(wc.mode& USERMODE_INVISIBLE)) ) 
add: USERMODE_CHAR [who.UMode[mm]]) ) ) 
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;	if (cmd[2] && cmd[2].toLowerCase() == "o") { // RFC1459 Compatibility.		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 Clients) {		if (Clients[who_client] && !Clients[who_client].server &&		    ( (Clients[who_client].conntype > 1) &&		      (Clients[who_client].conntype < 4) ) ) {			var wc = Clients[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.onchannel(who.Channel.toUpperCase()))					continue;				if (sf_op && Channels[who.Channel.toUpperCase()]&&				    !Channels[who.Channel.toUpperCase()].ismode(				     wc.id,CHANMODE_OP))					continue;				if(sf_voice&&Channels[who.Channel.toUpperCase()]&&				    !Channels[who.Channel.toUpperCase()].ismode(				     wc.id,CHANMODE_VIOCE))					continue;			} else if (who.del_flags&WHO_CHANNEL) {					if (wc.onchannel(who.Channel.toUpperCase()))					continue;				if (sf_op && Channels[who.Channel.toUpperCase()]&&				    Channels[who.Channel.toUpperCase()].ismode(				     wc.id,CHANMODE_OP))					continue;				if(sf_voice&&Channels[who.Channel.toUpperCase()]&&				    Channels[who.Channel.toUpperCase()].ismode(				     wc.id,CHANMODE_VOICE))					continue;			}			if ((who.add_flags&WHO_REALNAME) &&			    !match_irc_mask(wc.realname,who.RealName))				continue;			else if ((who.del_flags&WHO_REALNAME) &&			    match_irc_mask(wc.realname,who.RealName))				continue;			if ((who.add_flags&WHO_HOST) &&			    !match_irc_mask(wc.hostname,who.Host))				continue;			else if ((who.del_flags&WHO_HOST) &&			    match_irc_mask(wc.hostname,who.Host))				continue;			if ((who.add_flags&WHO_IP) &&			    !match_irc_mask(wc.ip,who.IP))				continue;			else if ((who.del_flags&WHO_IP) &&			    match_irc_mask(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":							if (							   (!madd && (wc.mode&							   USERMODE_OPER))							||							   (madd && !(wc.mode&							   USERMODE_OPER))							   )								sic = true;							break;						case "i":							if (							   (!madd && (wc.mode&							   USERMODE_INVISIBLE))							||							   (madd && !(wc.mode&							   USERMODE_INVISIBLE))							   )								sic = true;							break;						default:							break;					}					if (sic)						break;				}				if (sic)					continue;			}			if ((who.add_flags&WHO_NICK) &&			    !match_irc_mask(wc.nick,who.Nick))				continue;			else if ((who.del_flags&WHO_NICK) &&			    match_irc_mask(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) &&			    !match_irc_mask(wc.servername,who.Server))				continue;			else if ((who.del_flags&WHO_SERVER) &&			    match_irc_mask(wc.servername,who.Server))				continue;			if ((who.add_flags&WHO_USER) &&			    !match_irc_mask(wc.uprefix,who.User))				continue;			else if ((who.del_flags&WHO_USER) &&			    match_irc_mask(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.onchannel(wc.channels[x])||						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()])				this.numeric352(wc,show_ips_only,Channels[chan.toUpperCase()]);			else				this.numeric352(wc,show_ips_only);			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/31006ab4a41a856a00ee4605fa77ef5b83544a92/ircd.js/buggy/ircd.js