/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 *
 * The contents of this file are subject to the Mozilla Public License
 * Version 1.1 (the "License"); you may not use this file except in
 * compliance with the License. You may obtain a copy of the License at
 * http://www.mozilla.org/MPL/ 
 * 
 * Software distributed under the License is distributed on an "AS IS" basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 * for the specific language governing rights and limitations under the
 * License. 
 *
 * The Original Code is ChatZilla
 * 
 * The Initial Developer of the Original Code is
 * Robert Ginda
 * Portions created by Robert Ginda are Copyright (C) 2003 Robert Ginda.
 *
 * Alternatively, the contents of this file may be used under the
 * terms of the GNU Public License (the "GPL"), in which case the
 * provisions of the GPL are applicable instead of those above.
 * If you wish to allow use of your version of this file only
 * under the terms of the GPL and not to allow others to use your
 * version of this file under the MPL, indicate your decision by
 * deleting the provisions above and replace them with the notice
 * and other provisions required by the GPL.  If you do not delete
 * the provisions above, a recipient may use your version of this
 * file under either the MPL or the GPL.
 *
 * Contributor(s):
 *  Robert Ginda, <rginda@hacksrus`com>, original author
 */

/*
 * This sample script shows how to modify chatzilla's network list.  You
 * can drop it into a new directory in your chatzilla script path, or
 * add the important lines to init.js at the script path root.
 *
 * Here's the short answer to how get chatzilla to see this file:
 *
 *   1. Locate your chatzilla profile path.  You can do this by typing
 *      this command in chatzilla:
 *
 *         /pref profilePath
 *
 *   2. Create a new subdirectory in <chatzilla-profile>/scripts/.  You
 *      might want to call it mynetworks/, but you don't have to.
 *
 *   3. Copy this file to your new subdirectory.
 *
 *   4. Restart chatzilla.
 *
 * See http://www.hacksrus.com/~ginda/chatzilla/faq/#scripts for
 * more information on how to script chatzilla.
 *
 */

const __id = "my-networks";
const __maj_version = 1
const __min_version = 0
const __description = "Custom networks";

function initPlugin(glob)
{
    // this function will be called when chatzilla starts up.

    plugin.id = __id;
    plugin.major = __maj_version;
    plugin.minor = __min_version;    
    plugin.version = __maj_version + "." + __min_version
    plugin.description = __description;

    /*
     * client.addNetwork can be used to create new network objects, or
     * overwrite existing network objects.  The first parameter is the
     * name of the network.  The second is an array of objects.  Each
     * object in the array represents a server on the network, and should
     * have "name" (hostname) and "port" properties, as shown in the 
     * code that follows this comment.
     *
     * To remove a network, delete it from the client.networks object, like
     * this:
     *
     *     delete client.networks["moznet"]
     *
     */

    // redefine efnet to contain only this one server
    client.addNetwork("efnet", [{name: "irc.prison.net", port: 6667}]);

    // add ircnet, with two servers
    client.addNetwork("ircnet",
                      [{name: "irc-1.stealth.net", port: 6667},
                      {name: "irc.estpak.ee", port: 6667}]);
}

