[Phpfreechat-svn] SF.net SVN: phpfreechat: [526] trunk/src/commands/nick.class.php
Status: Beta
Brought to you by:
kerphi
From: <ke...@us...> - 2006-05-28 17:08:30
|
Revision: 526 Author: kerphi Date: 2006-05-28 10:08:25 -0700 (Sun, 28 May 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=526&view=rev Log Message: ----------- Add the "usage" parameter Modified Paths: -------------- trunk/src/commands/nick.class.php Modified: trunk/src/commands/nick.class.php =================================================================== --- trunk/src/commands/nick.class.php 2006-05-28 17:07:39 UTC (rev 525) +++ trunk/src/commands/nick.class.php 2006-05-28 17:08:25 UTC (rev 526) @@ -4,25 +4,27 @@ class pfcCommand_nick extends pfcCommand { + var $usage = "/nick {newnickname}"; + function run(&$xml_reponse, $clientid, $param, $sender, $recipient, $recipientid) { $c =& $this->c; $u =& $this->u; + if (trim($param) == "") + { + // error + $msg = _pfc("Missing parameter"); + $msg .= " (".$this->usage.")"; + $cmd =& pfcCommand::Factory("error"); + $cmd->run($xml_reponse, $clientid, $msg, $sender, $recipient, $recipientid); + return; + } + $newnick = phpFreeChat::FilterNickname($param); $oldnick = $u->nick; if ($c->debug) pxlog("/nick ".$newnick, "chat", $c->getId()); - - if ($newnick == "") - { - // the choosen nick is empty - if ($c->debug) pxlog("/nick the choosen nick is empty", "chat", $c->getId()); - $xml_reponse->addScript("pfc.handleResponse('nick', 'empty', '');"); - //$cmd =& pfcCommand::Factory("asknick"); - //$cmd->run($xml_reponse, $clientid, "", $sender, $recipient); - return; - } $container =& $c->getContainerInstance(); $newnickid = $container->getNickId($newnick); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |