register("chatto", chatto, "Causes all text to be sent to the specified user until :q is entered.");
register("exclude", dontchatto, "Excludes the specified user from the conversation until :q is entered");

function dontchatto(command,user)
{
	chatuser = user;
	sendcommand = "notsayto";
	bind(K_BIND_INPUT, "prefixsend");
}

function chatto(command,user)
{
	chatuser = user;
	sendcommand = "sayto";
	bind(K_BIND_INPUT, "prefixsend");
}

function prefixsend(text)
{
	if(text == ":q")
	{
		unbind(K_BIND_INPUT, "prefixsend");
	}
	else
	{
		exec(sendcommand + " " + chatuser + " " + text);
	}
	return false;
}

