[Phpfreechat-svn] SF.net SVN: phpfreechat: [578] trunk/themes/default/templates/pfcclient.js.tpl.ph
Status: Beta
Brought to you by:
kerphi
From: <ke...@us...> - 2006-06-14 16:27:58
|
Revision: 578 Author: kerphi Date: 2006-06-14 09:27:46 -0700 (Wed, 14 Jun 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=578&view=rev Log Message: ----------- Bug fix: channels were not joined in the correct order (last channel in the parameter array mus be the last joined channel and the active one) Modified Paths: -------------- trunk/themes/default/templates/pfcclient.js.tpl.php Modified: trunk/themes/default/templates/pfcclient.js.tpl.php =================================================================== --- trunk/themes/default/templates/pfcclient.js.tpl.php 2006-06-14 15:40:38 UTC (rev 577) +++ trunk/themes/default/templates/pfcclient.js.tpl.php 2006-06-14 16:27:46 UTC (rev 578) @@ -157,18 +157,6 @@ else { this.sendRequest('/nick', this.nickname); - - // now join channels comming from sessions - // or the default one - <?php - if (count($u->channels) == 0) - foreach($c->channels as $ch) - echo "this.sendRequest('/join', '".addslashes($ch)."');\n"; - foreach($u->channels as $ch) - echo "this.sendRequest('/join', '".addslashes($ch["name"])."');\n"; - foreach($u->privmsg as $pv) - echo "this.sendRequest('/privmsg', '".addslashes($pv["name"])."');\n"; - ?> } // give focus the the input text box if wanted @@ -300,16 +288,26 @@ } else if (cmd == "nick") { - if (resp == "connected") + if (resp == "connected" || resp == "notchanged") { // now join channels comming from sessions // or the default one <?php if (count($u->channels) == 0) - foreach($c->channels as $ch) - echo "this.sendRequest('/join', '".addslashes($ch)."');\n"; - foreach($u->channels as $ch) - echo "this.sendRequest('/join', '".addslashes($ch["name"])."');\n"; + // the last joined channel must be the last entry in the parameter list + for($i=0; $i<count($c->channels); $i++) + { + $ch = $c->channels[$i]; + $cmd = $i < count($c->channels)-1 ? "/join2" : "/join"; + echo "this.sendRequest('".$cmd."', '".addslashes($ch)."');\n"; + } + // the last joined channel must be the last entry in the parameter list + for($i=0; $i<count($u->channels); $i++) + { + $ch = $u->channels[$i]; + $cmd = $i < count($u->channels)-1 ? "/join2" : "/join"; + echo "this.sendRequest('".$cmd."', '".addslashes($ch)."');\n"; + } foreach($u->privmsg as $pv) echo "this.sendRequest('/privmsg', '".addslashes($pv["name"])."');\n"; ?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |