[Phpfreechat-svn] SF.net SVN: phpfreechat: [593] trunk/src/commands
Status: Beta
Brought to you by:
kerphi
From: <ke...@us...> - 2006-06-15 20:31:51
|
Revision: 593 Author: kerphi Date: 2006-06-15 13:31:43 -0700 (Thu, 15 Jun 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=593&view=rev Log Message: ----------- The "xxxx quit (timeout)" notification was broken Modified Paths: -------------- trunk/src/commands/getonlinenick.class.php trunk/src/commands/update.class.php trunk/src/containers/file.class.php Modified: trunk/src/commands/getonlinenick.class.php =================================================================== --- trunk/src/commands/getonlinenick.class.php 2006-06-15 20:21:26 UTC (rev 592) +++ trunk/src/commands/getonlinenick.class.php 2006-06-15 20:31:43 UTC (rev 593) @@ -11,10 +11,10 @@ // take care to disconnect timeouted users on this channel $disconnected_users = $container->removeObsoleteNick($recipient,$c->timeout); - foreach ($disconnected_users["nickid"] as $nid) + foreach ($disconnected_users["nick"] as $n) { $cmd =& pfcCommand::Factory("notice"); - $cmd->run($xml_reponse, $clientid, _pfc("%s quit (timeout)",$container->getNickname($nid)), $sender, $recipient, $recipientid, 2); + $cmd->run($xml_reponse, $clientid, _pfc("%s quit (timeout)", $n), $sender, $recipient, $recipientid, 2); } // get the cached nickname list Modified: trunk/src/commands/update.class.php =================================================================== --- trunk/src/commands/update.class.php 2006-06-15 20:21:26 UTC (rev 592) +++ trunk/src/commands/update.class.php 2006-06-15 20:31:43 UTC (rev 593) @@ -11,19 +11,7 @@ // do not update if user isn't active (didn't connect) if ($u->active) - { - $container =& $c->getContainerInstance(); - - // take care to disconnect timeouted users on the server - $disconnected_users = $container->removeObsoleteNick(NULL,$c->timeout); - // if whould be possible to echo these disconnected users on a server tab - // server tab is not yet available so I just commente the code - // foreach ($disconnected_users as $u) - // { - // $cmd =& pfcCommand::Factory("notice"); - // $cmd->run($xml_reponse, $clientid, _pfc("%s quit (timeout)",$u), $sender, $recipient, $recipientid, 2); - // } - + { // update the user nickname timestamp $cmd =& pfcCommand::Factory("updatemynick"); foreach( $u->channels as $id => $chan ) @@ -46,6 +34,17 @@ foreach( $u->privmsg as $id => $pv ) $cmd->run($xml_reponse, $clientid, $param, $sender, $pv["recipient"], $id); + // take care to disconnect timeouted users on the server + $container =& $c->getContainerInstance(); + $disconnected_users = $container->removeObsoleteNick(NULL,$c->timeout); + // if whould be possible to echo these disconnected users on a server tab + // server tab is not yet available so I just commente the code + // foreach ($disconnected_users as $u) + // { + // $cmd =& pfcCommand::Factory("notice"); + // $cmd->run($xml_reponse, $clientid, _pfc("%s quit (timeout)",$u), $sender, $recipient, $recipientid, 2); + // } + $xml_reponse->addScript("pfc.handleResponse('update', 'ok', '');"); } else Modified: trunk/src/containers/file.class.php =================================================================== --- trunk/src/containers/file.class.php 2006-06-15 20:21:26 UTC (rev 592) +++ trunk/src/containers/file.class.php 2006-06-15 20:31:43 UTC (rev 593) @@ -334,6 +334,7 @@ $f_time = filemtime($nick_dir."/".$file); if (time() > ($f_time+$timeout/1000) ) // user will be disconnected after 'timeout' secondes of inactivity { + $deleted_user["nick"][] = $this->getNickname($file); $deleted_user["nickid"][] = $file; $deleted_user["timestamp"][] = $f_time; @unlink($nick_dir."/".$file); // disconnect expired user This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |