[Phpfreechat-svn] SF.net SVN: phpfreechat: [604] trunk/src/commands
Status: Beta
Brought to you by:
kerphi
From: <ke...@us...> - 2006-06-16 18:47:49
|
Revision: 604 Author: kerphi Date: 2006-06-16 11:47:36 -0700 (Fri, 16 Jun 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=604&view=rev Log Message: ----------- Bug fix: the "max_msg" parameter was broken, setting this parameter to zero displayed blank screen on next reload Modified Paths: -------------- trunk/src/commands/connect.class.php trunk/src/commands/getnewmsg.class.php trunk/src/commands/join.class.php Modified: trunk/src/commands/connect.class.php =================================================================== --- trunk/src/commands/connect.class.php 2006-06-16 16:12:08 UTC (rev 603) +++ trunk/src/commands/connect.class.php 2006-06-16 18:47:36 UTC (rev 604) @@ -9,15 +9,28 @@ $c =& $this->c; $u =& $this->u; - // disconnect last connected users from the server if necessary $container =& $c->getContainerInstance(); $disconnected_users = $container->removeObsoleteNick(NULL, $c->timeout); + // reset the message id indicator (see getnewmsg.class.php) + // i.e. be ready to re-get all last posted messages + require_once(dirname(__FILE__)."/join.class.php"); + foreach($u->channels as $chan) + { + $channame = $chan["name"]; + $chanrecip = pfcCommand_join::GetRecipient($channame); + $chanid = pfcCommand_join::GetRecipientId($channame); + $from_id_sid = $c->prefix."from_id_".$c->getId()."_".$clientid."_".$chanid; + $from_id = $container->getLastId($chanrecip)-$c->max_msg; + $_SESSION[$from_id_sid] = ($from_id<0) ? 0 : $from_id; + } + + + // check if the user is alone on the server, and give it the admin status if yes $isadmin = $c->isadmin; if (!$isadmin) { - // check if the user is alone on the server, and give it the admin status if yes $users = $container->getOnlineNick(NULL); if (count($users["nickid"]) == 0) $isadmin = true; } Modified: trunk/src/commands/getnewmsg.class.php =================================================================== --- trunk/src/commands/getnewmsg.class.php 2006-06-16 16:12:08 UTC (rev 603) +++ trunk/src/commands/getnewmsg.class.php 2006-06-16 18:47:36 UTC (rev 604) @@ -11,7 +11,7 @@ // do nothing if the recipient is not defined if ($recipient == "") return; - // $xml_reponse->addScript("alert('getnewmsg: sender=".addslashes($sender)." param=".addslashes($param)." recipient=".addslashes($recipient)." recipientid=".addslashes($recipientid)."');"); + //$xml_reponse->addScript("alert('getnewmsg: sender=".addslashes($sender)." param=".addslashes($param)." recipient=".addslashes($recipient)." recipientid=".addslashes($recipientid)."');"); // check this methode is not being called if( isset($_SESSION[$c->prefix."lock_readnewmsg_".$c->getId()."_".$clientid]) ) Modified: trunk/src/commands/join.class.php =================================================================== --- trunk/src/commands/join.class.php 2006-06-16 16:12:08 UTC (rev 603) +++ trunk/src/commands/join.class.php 2006-06-16 18:47:36 UTC (rev 604) @@ -34,18 +34,13 @@ $nicklist_sid = $c->prefix."nicklist_".$c->getId()."_".$clientid."_".$chanid; $_SESSION[$nicklist_sid] = NULL; - // reset the message id indicator - // i.e. be ready to re-get all last posted messages - $container =& $c->getContainerInstance(); - $from_id_sid = $c->prefix."from_id_".$c->getId()."_".$clientid."_".$chanid; - $from_id = $container->getLastId($chanrecip)-$c->max_msg; - $_SESSION[$from_id_sid] = ($from_id<0) ? 0 : $from_id; - // show a join message $cmd =& pfcCommand::Factory("notice"); $cmd->run($xml_reponse, $clientid, _pfc("%s joins %s",$u->nick, $channame), $sender, $chanrecip, $chanid, 1); } - //$xml_reponse->addScript("alert('join: chan=".$channame."');"); + + + //$xml_reponse->addScript("alert('join: chan=".$channame.", from_id=".$from_id."');"); // $xml_reponse->addScript("alert('join: u->nick=".$u->nick." chanid=".$chanid." channame=".addslashes($channame)."');"); // $xml_reponse->addScript("alert('join: fromidsid=".$from_id_sid."');"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |