[Phpfreechat-svn] SF.net SVN: phpfreechat: [1063] trunk/src
Status: Beta
Brought to you by:
kerphi
From: <ke...@us...> - 2007-07-30 14:43:38
|
Revision: 1063 http://phpfreechat.svn.sourceforge.net/phpfreechat/?rev=1063&view=rev Author: kerphi Date: 2007-07-30 07:43:40 -0700 (Mon, 30 Jul 2007) Log Message: ----------- Add the 'sender', 'recipient' and 'recipientid' parameters in the cmdtoplay commands Modified Paths: -------------- trunk/src/pfccommand.class.php trunk/src/phpfreechat.class.php Modified: trunk/src/pfccommand.class.php =================================================================== --- trunk/src/pfccommand.class.php 2007-07-30 13:16:33 UTC (rev 1062) +++ trunk/src/pfccommand.class.php 2007-07-30 14:43:40 UTC (rev 1063) @@ -194,7 +194,7 @@ return false; } - function RunPendingCmdToPlay($nickid,$clientid,&$xml_reponse) + function RunPendingCmdToPlay($nickid,$context,&$xml_reponse) { $c =& pfcGlobalConfig::Instance(); $u =& pfcUserConfig::Instance(); @@ -217,10 +217,10 @@ $cmd =& pfcCommand::Factory($cmdtmp['cmdstr']); $cmdp = $cmdtmp['params']; if (!isset($cmdp['param'])) $cmdp['param'] = ''; - if (!isset($cmdp['sender'])) $cmdp['sender'] = null; - if (!isset($cmdp['recipient'])) $cmdp['recipient'] = null; - if (!isset($cmdp['recipientid'])) $cmdp['recipientid'] = null; - $cmdp['clientid'] = $clientid; // the clientid must be the current user one + if (!isset($cmdp['sender'])) $cmdp['sender'] = $context['sender']; + if (!isset($cmdp['recipient'])) $cmdp['recipient'] = $context['recipient']; + if (!isset($cmdp['recipientid'])) $cmdp['recipientid'] = $context['recipientid']; + $cmdp['clientid'] = $context['clientid']; // the clientid must be the current user one $cmdp['cmdtoplay'] = true; // used to run some specials actions in the command (ex: if the cmdtoplay is a 'leave' command, then show an alert to the kicked or banished user) if ($c->debug) $cmd->run($xml_reponse, $cmdp); Modified: trunk/src/phpfreechat.class.php =================================================================== --- trunk/src/phpfreechat.class.php 2007-07-30 13:16:33 UTC (rev 1062) +++ trunk/src/phpfreechat.class.php 2007-07-30 14:43:40 UTC (rev 1063) @@ -271,18 +271,19 @@ } + + $cmdp = array(); + $cmdp["clientid"] = $clientid; + $cmdp["sender"] = $sender; + $cmdp["recipient"] = $recipient; + $cmdp["recipientid"] = $recipientid; // before playing the wanted command // play the found commands into the meta 'cmdtoplay' - pfcCommand::RunPendingCmdToPlay($u->nickid, $clientid, $xml_reponse); - + pfcCommand::RunPendingCmdToPlay($u->nickid, $cmdp, $xml_reponse); + // play the wanted command $cmd =& pfcCommand::Factory($cmdname); - $cmdp = array(); - $cmdp["clientid"] = $clientid; $cmdp["param"] = $param; $cmdp["params"] = $params; - $cmdp["sender"] = $sender; - $cmdp["recipient"] = $recipient; - $cmdp["recipientid"] = $recipientid; if ($cmd != NULL) { // call the command This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |