[Phpfreechat-svn] SF.net SVN: phpfreechat: [607] trunk/src/commands
Status: Beta
Brought to you by:
kerphi
From: <ke...@us...> - 2006-06-16 20:40:38
|
Revision: 607 Author: kerphi Date: 2006-06-16 13:40:30 -0700 (Fri, 16 Jun 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=607&view=rev Log Message: ----------- Bug fix: the oldmsg flag was broken Modified Paths: -------------- trunk/src/commands/connect.class.php trunk/src/commands/getnewmsg.class.php Modified: trunk/src/commands/connect.class.php =================================================================== --- trunk/src/commands/connect.class.php 2006-06-16 20:30:27 UTC (rev 606) +++ trunk/src/commands/connect.class.php 2006-06-16 20:40:30 UTC (rev 607) @@ -21,11 +21,14 @@ $channame = $chan["name"]; $chanrecip = pfcCommand_join::GetRecipient($channame); $chanid = pfcCommand_join::GetRecipientId($channame); + // reset the fromid flag $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; + // reset the oldmsg flag + $oldmsg_sid = $c->prefix."oldmsg_".$c->getId()."_".$clientid."_".$chanid; + $_SESSION[$oldmsg_sid] = true; } - // check if the user is alone on the server, and give it the admin status if yes $isadmin = $c->isadmin; Modified: trunk/src/commands/getnewmsg.class.php =================================================================== --- trunk/src/commands/getnewmsg.class.php 2006-06-16 20:30:27 UTC (rev 606) +++ trunk/src/commands/getnewmsg.class.php 2006-06-16 20:40:30 UTC (rev 607) @@ -37,6 +37,13 @@ $from_id = $container->getLastId($recipient)-$c->max_msg; if ($from_id < 0) $from_id = 0; } + // check if this is the first time you get messages + $oldmsg_sid = $c->prefix."oldmsg_".$c->getId()."_".$clientid."_".$recipientid; + if (isset($_SESSION[$oldmsg_sid])) + { + unset($_SESSION[$oldmsg_sid]); + $oldmsg = true; + } //$xml_reponse->addScript("alert('getnewmsg: fromidsid=".$from_id_sid."');"); //$xml_reponse->addScript("alert('getnewmsg: recipient=".$recipient." fromid=".$from_id."');"); @@ -61,7 +68,7 @@ $m_recipientid = $recipientid; $m_cmd = $d["cmd"]; $m_param = phpFreeChat::PostFilterMsg($d["param"]); - $js .= "Array(".$m_id.",'".addslashes($m_date)."','".addslashes($m_time)."','".addslashes($m_sender)."','".addslashes($m_recipientid)."','".addslashes($m_cmd)."','".addslashes($m_param)."',".(date("d/m/Y") == $m_date ? 1 : 0).",".($from_id == 0? 1 : 0)."),"; + $js .= "Array(".$m_id.",'".addslashes($m_date)."','".addslashes($m_time)."','".addslashes($m_sender)."','".addslashes($m_recipientid)."','".addslashes($m_cmd)."','".addslashes($m_param)."',".(date("d/m/Y") == $m_date ? 1 : 0).",".($oldmsg ? 1 : 0)."),"; $data_sent = true; } if ($js != "") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |