<?php
/************************************************** 
 *                 Bot Gadu-Gadu                  * 
 ************************************************** 
 * Wersja: 2.2 Stable                             * 
 * Data: 25.06.2012 (21:15)                       * 
 * Autor: Jacek Kowalski (http://jacekk.info)     * 
 *                                                * 
 * Utwor rozprowadzany na licencji                * 
 * http://creativecommons.org/licenses/by-nc/2.5/ * 
 **************************************************/

class bot_legacy_module implements BotModule {
	function handle($msg, $params) {
		require_once(BOT_TOPDIR.'/modules/'.$params[0]);
		
		if(!defined('BOT_TYPE')) {
			define('BOT_TYPE', $msg->userAlt->interface);
		}
		
		$_GET['to'] = $msg->userAlt->bot;
		$_GET['from'] = $msg->userAlt->uid;
		
		try {
			call_user_func(array($params[1], $params[2]), $msg->command, $msg->args);
		}
		catch(BotLegacyEnd $e) {
		}
		
		return GGapi::getResponse();
	}
}
?>