[Phpfreechat-svn] SF.net SVN: phpfreechat: [726] trunk/src
Status: Beta
Brought to you by:
kerphi
From: <ke...@us...> - 2006-09-02 21:20:35
|
Revision: 726 http://svn.sourceforge.net/phpfreechat/?rev=726&view=rev Author: kerphi Date: 2006-09-02 14:20:15 -0700 (Sat, 02 Sep 2006) Log Message: ----------- Now display the errors when messages can't be written in the default file container Modified Paths: -------------- trunk/src/commands/notice.class.php trunk/src/commands/send.class.php trunk/src/containers/file.class.php Modified: trunk/src/commands/notice.class.php =================================================================== --- trunk/src/commands/notice.class.php 2006-09-02 20:42:09 UTC (rev 725) +++ trunk/src/commands/notice.class.php 2006-09-02 21:20:15 UTC (rev 726) @@ -21,7 +21,15 @@ { $container =& $c->getContainerInstance(); $msg = phpFreeChat::FilterSpecialChar($msg); - $container->write($recipient, $u->nick, "notice", $msg); + $res = $container->write($recipient, $u->nick, "notice", $msg); + if (is_array($res)) + { + $cmdp = $p; + $cmdp["param"] = implode(",",$res); + $cmd =& pfcCommand::Factory("error"); + $cmd->run($xml_reponse, $cmdp); + return; + } } if ($c->debug) pxlog("/notice ".$msg." (flag=".$flag.")", "chat", $c->getId()); } Modified: trunk/src/commands/send.class.php =================================================================== --- trunk/src/commands/send.class.php 2006-09-02 20:42:09 UTC (rev 725) +++ trunk/src/commands/send.class.php 2006-09-02 21:20:15 UTC (rev 726) @@ -79,6 +79,14 @@ { $container =& $c->getContainerInstance(); $msgid = $container->write($recipient, $nick, "send", $text); + if (is_array($msgid)) + { + $cmdp = $p; + $cmdp["param"] = implode(",",$msgid); + $cmd =& pfcCommand::Factory("error"); + $cmd->run($xml_reponse, $cmdp); + return; + } if ($c->debug) pxlog("/send ".$text." (a user just sent a message -> nick=".$u->nick.")", "chat", $c->getId()); // a message has been posted so : Modified: trunk/src/containers/file.class.php =================================================================== --- trunk/src/containers/file.class.php 2006-09-02 20:42:09 UTC (rev 725) +++ trunk/src/containers/file.class.php 2006-09-02 21:20:15 UTC (rev 726) @@ -459,9 +459,11 @@ $c->container_cfg_server_dir."/messages"; // check the messages directory exists $errors = @test_writable_dir($msg_dir, $chan."/messages"); + if (count($errors) > 0) return $errors; // an error occurs ? // request a unique id for this new message $msg_id = $this->_requestMsgId($chan); + if (is_array($msg_id)) return $msg_id; // an error occurs ? $msg_filename = $msg_dir."/".$msg_id; // format message @@ -706,6 +708,7 @@ $c->container_cfg_server_dir; // check the directory exists $errors = @test_writable_dir($chan_dir, $chan_dir); + if (count($errors) > 0) return $errors; $index_filename = $chan_dir . "/messages.index"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |