[Phpfreechat-svn] SF.net SVN: phpfreechat: [839] trunk/src/commands
Status: Beta
Brought to you by:
kerphi
From: <ke...@us...> - 2006-10-22 13:23:38
|
Revision: 839 http://svn.sourceforge.net/phpfreechat/?rev=839&view=rev Author: kerphi Date: 2006-10-22 06:23:30 -0700 (Sun, 22 Oct 2006) Log Message: ----------- [en] Bug fix: when max_msg was set to 0 the first posted message in a PV was lost. [1h30] [fr] Bug fix : lorsque max_msg valait 0 le premier message post?\195?\169 dans un message priv?\195?\169 ?\195?\169tait perdu. [1h30] Modified Paths: -------------- trunk/src/commands/connect.class.php trunk/src/commands/privmsg.class.php Modified: trunk/src/commands/connect.class.php =================================================================== --- trunk/src/commands/connect.class.php 2006-10-20 20:39:06 UTC (rev 838) +++ trunk/src/commands/connect.class.php 2006-10-22 13:23:30 UTC (rev 839) @@ -21,6 +21,7 @@ // i.e. be ready to re-get all last posted messages if ($getoldmsg) { + // reset the channel identifiers require_once(dirname(__FILE__)."/join.class.php"); $channels = array(); if (count($u->channels) == 0) @@ -40,6 +41,21 @@ $oldmsg_sid = "pfc_oldmsg_".$c->getId()."_".$clientid."_".$chanid; $_SESSION[$oldmsg_sid] = true; } + // reset the private messages identifiers + if (count($u->privmsg) > 0) + { + foreach($u->privmsg as $recipientid2 => $pv) + { + $recipient2 = $pv['recipient']; + // reset the fromid flag + $from_id_sid = "pfc_from_id_".$c->getId()."_".$clientid."_".$recipientid2; + $from_id = $ct->getLastId($recipient2)-$c->max_msg; + $_SESSION[$from_id_sid] = ($from_id<0) ? 0 : $from_id; + // reset the oldmsg flag + $oldmsg_sid = "pfc_oldmsg_".$c->getId()."_".$clientid."_".$recipientid2; + $_SESSION[$oldmsg_sid] = true; + } + } } // check if the user is alone on the server, and give it the admin status if yes Modified: trunk/src/commands/privmsg.class.php =================================================================== --- trunk/src/commands/privmsg.class.php 2006-10-20 20:39:06 UTC (rev 838) +++ trunk/src/commands/privmsg.class.php 2006-10-22 13:23:30 UTC (rev 839) @@ -78,7 +78,7 @@ // reset the message id indicator // i.e. be ready to re-get all last posted messages $from_id_sid = "pfc_from_id_".$c->getId()."_".$clientid."_".$pvrecipientid; - $from_id = $container->getLastId($pvrecipient)-$c->max_msg; + $from_id = $container->getLastId($pvrecipient)-$c->max_msg-1; $_SESSION[$from_id_sid] = ($from_id<0) ? 0 : $from_id; // register the user (and his metadata) in this pv This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |