Home > programming > Mass-op plugin for Colloquy

Mass-op plugin for Colloquy

There’s no massop command in Colloquy, so here’s a javascript plugin that does it.

Copy/paste the following as whatever.js in your ~/Application Support/Colloquy/PlugIns/ directory:

function opNick(nick, connection, view)
{
	connection.sendRawMessage("MODE " + view.target() + " +o " + nick);
}
 
function massOp(connection, view)
{
	var members = view.chatMembers();
	var len = members.length;
 
	for (var i = 0; i < len; i++)
	{
		if (!members[i].operator())
		{
			opNick(members[i].nickname(), connection, view);
		}
	}
	return false;
 
}
 
// process the command and return true if you handle it or false to pass on to another plugin
function processUserCommand( command, arguments, connection, view ) {
	// return true if the command was handled or to prevent other plugins or Colloquy from handling it
	if (command == 'mop')
	{
		massOp(connection, view);
		return true;
	}
	return false;
}
Categories: programming Tags:
  1. August 29th, 2010 at 17:10 | #1

    there’s a much uglier and mostly untested version that ops 3 nicks at a time to avoid mode spam at http://blog.rhp.org/mop3.js.txt

  2. December 13th, 2010 at 14:43 | #2

    I think, that you commit an error. Write to me in PM, we will communicate.

  1. No trackbacks yet.