[Phpfreechat-svn] SF.net SVN: phpfreechat: [512] trunk/src/commands
Status: Beta
Brought to you by:
kerphi
From: <ke...@us...> - 2006-05-27 10:33:23
|
Revision: 512 Author: kerphi Date: 2006-05-27 03:33:13 -0700 (Sat, 27 May 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=512&view=rev Log Message: ----------- Bug fix: the quit command didn't works Modified Paths: -------------- trunk/src/commands/kick.class.php trunk/src/commands/quit.class.php Modified: trunk/src/commands/kick.class.php =================================================================== --- trunk/src/commands/kick.class.php 2006-05-27 10:29:54 UTC (rev 511) +++ trunk/src/commands/kick.class.php 2006-05-27 10:33:13 UTC (rev 512) @@ -9,7 +9,39 @@ $c =& $this->c; $u =& $this->u; - $xml_reponse->addScript("alert('/kick $param command');"); + + + + $container =& $c->getContainerInstance(); + $nickid = $container->getNickId($param); + + if ($nickid != "undefined") + { + $cmdtoplay = $container->getMeta("cmdtoplay", "nickname", $nickid); + if (is_string($cmdtoplay)) $cmdtoplay = unserialize($cmdtoplay); + if (!is_array($cmdtoplay)) $cmdtoplay = array(); + if (!isset($cmdtoplay["quit"])) $cmdtoplay["quit"] = array(); + $cmdtoplay["quit"][] = "dummy param"; + $container->setMeta(serialize($cmdtoplay), "cmdtoplay", "nickname", $nickid); + } + $xml_reponse->addScript("alert('/kick $param command -> $nickid');"); + + + /* + $cmdtoplay = $container->getMeta("cmdtoplay", "nickname", $u->privmsg[$recipientid]["pvnickid"]); + if (is_string($cmdtoplay)) $cmdtoplay = unserialize($cmdtoplay); + if (!is_array($cmdtoplay)) $cmdtoplay = array(); + if (!isset($cmdtoplay["privmsg2"])) $cmdtoplay["privmsg2"] = array(); + if (!in_array($u->nick, $cmdtoplay["privmsg2"])) + { + $cmdtoplay["privmsg2"][] = $u->nick; + $container->setMeta(serialize($cmdtoplay), "cmdtoplay", "nickname", $u->privmsg[$recipientid]["pvnickid"]); + // $xml_reponse->addScript("alert('cmdtoplay[]=".serialize($cmdtoplay)."');"); + } + */ + + + } } Modified: trunk/src/commands/quit.class.php =================================================================== --- trunk/src/commands/quit.class.php 2006-05-27 10:29:54 UTC (rev 511) +++ trunk/src/commands/quit.class.php 2006-05-27 10:33:13 UTC (rev 512) @@ -15,18 +15,23 @@ // then remove the nickname file $container =& $c->getContainerInstance(); - foreach( $u->channels as $id => $chan ) - if ($container->removeNick($chan, $u->nick)) + + // from the channels + foreach( $u->channels as $id => $chandetail ) + if ($container->removeNick($chandetail["recipient"], $u->nick)) { $cmd =& pfcCommand::Factory("notice"); - $cmd->run($xml_reponse, $clientid, _pfc("%s quit", $u->nick), $sender, $chan["recipient"], $id, 2); + $cmd->run($xml_reponse, $clientid, _pfc("%s quit", $u->nick), $sender, $chandetail["recipient"], $id, 2); } - foreach( $u->privmsg as $id => $pv ) - if ($container->removeNick($pv, $u->nick)) + // from the private messages + foreach( $u->privmsg as $id => $pvdetail ) + if ($container->removeNick($pvdetail["recipient"], $u->nick)) { $cmd =& pfcCommand::Factory("notice"); - $cmd->run($xml_reponse, $clientid, _pfc("%s quit", $u->nick), $sender, $pv["recipient"], $id, 2); + $cmd->run($xml_reponse, $clientid, _pfc("%s quit", $u->nick), $sender, $pvdetail["recipient"], $id, 2); } + // from the server + $container->removeNick(NULL, $u->nick); $xml_reponse->addScript("pfc.handleResponse('quit', 'ok', '');"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |