<?php
/************************************************** 
 *                 Bot Gadu-Gadu                  * 
 ************************************************** 
 * Wersja: 2.5 Stable                             * 
 * Data: 17.09.2012 (12:07)                       * 
 * 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();
	}
}
?>