[Phpfreechat-svn] SF.net SVN: phpfreechat: [799] trunk/src/commands/leave.class.php
Status: Beta
Brought to you by:
kerphi
From: <ke...@us...> - 2006-10-04 01:46:04
|
Revision: 799 http://svn.sourceforge.net/phpfreechat/?rev=799&view=rev Author: kerphi Date: 2006-09-27 09:33:38 -0700 (Wed, 27 Sep 2006) Log Message: ----------- [en] Bug fix: when leaving and joining the same channel the message history was lost. [15min] [fr] Bug fix: quitter et rejoindre le meme salon provoquait la perte de l'historique des messages de ce channel. [15min] Modified Paths: -------------- trunk/src/commands/leave.class.php Modified: trunk/src/commands/leave.class.php =================================================================== --- trunk/src/commands/leave.class.php 2006-09-27 16:30:22 UTC (rev 798) +++ trunk/src/commands/leave.class.php 2006-09-27 16:33:38 UTC (rev 799) @@ -71,8 +71,19 @@ } // remove the nickname from the channel/pv - $container =& $c->getContainerInstance(); - $container->removeNick($leave_recip, $u->nickid); + $ct =& $c->getContainerInstance(); + $ct->removeNick($leave_recip, $u->nickid); + + // reset the sessions indicators + $chanrecip = $leave_recip; + $chanid = $leave_id; + // reset the fromid flag + $from_id_sid = "pfc_from_id_".$c->getId()."_".$clientid."_".$chanid; + $from_id = $ct->getLastId($chanrecip)-$c->max_msg; + $_SESSION[$from_id_sid] = ($from_id<0) ? 0 : $from_id; + // reset the oldmsg flag + $oldmsg_sid = "pfc_oldmsg_".$c->getId()."_".$clientid."_".$chanid; + $_SESSION[$oldmsg_sid] = true; // return ok to the client // then the client will remove the channel' tab This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |