[Phpfreechat-svn] SF.net SVN: phpfreechat: [513] trunk/src/commands
Status: Beta
Brought to you by:
kerphi
From: <ke...@us...> - 2006-05-27 19:11:13
|
Revision: 513 Author: kerphi Date: 2006-05-27 12:11:04 -0700 (Sat, 27 May 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=513&view=rev Log Message: ----------- Implement a basic 'kick' command 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:33:13 UTC (rev 512) +++ trunk/src/commands/kick.class.php 2006-05-27 19:11:04 UTC (rev 513) @@ -10,38 +10,19 @@ $u =& $this->u; - - + // kicking a user just add a command to play to the aimed user metadata. $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"; + $cmdtoplay["quit"][] = _pfc("kicked by %s", $sender); $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:33:13 UTC (rev 512) +++ trunk/src/commands/quit.class.php 2006-05-27 19:11:04 UTC (rev 513) @@ -15,20 +15,21 @@ // then remove the nickname file $container =& $c->getContainerInstance(); + $quitmsg = $param == "" ? _pfc("%s quit", $u->nick) : _pfc("%s quit (%s)", $u->nick, $param); // 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, $chandetail["recipient"], $id, 2); + $cmd->run($xml_reponse, $clientid, $quitmsg, $sender, $chandetail["recipient"], $id, 2); } // 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, $pvdetail["recipient"], $id, 2); + $cmd->run($xml_reponse, $clientid, $quitmsg, $sender, $pvdetail["recipient"], $id, 2); } // from the server $container->removeNick(NULL, $u->nick); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |