From: Lo?c C. <lo...@us...> - 2001-04-12 09:37:47
|
Update of /cvsroot/phpmychat/phpMyChat-0.15/chat/lib/commands In directory usw-pr-cvs1:/tmp/cvs-serv29569/chat/lib/commands Modified Files: ignore.cmd.php3 Log Message: Fix a bug with '/ignore - users1,users2....' Index: ignore.cmd.php3 =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/lib/commands/ignore.cmd.php3,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** ignore.cmd.php3 2001/04/11 23:06:14 1.1 --- ignore.cmd.php3 2001/04/12 09:37:44 1.2 *************** *** 110,114 **** $toRemove = explode(',', $cmd[3]); $ignoredUsers = explode(',', $dbSessionVars['ignoredSenders']); - $updateList = false; reset($toRemove); for ($i = 0; $i < count($toRemove); $i++) --- 110,113 ---- *************** *** 120,124 **** if ($pos >= 0) { ! $ignoredUsers[$i] = ''; $updateList = true; } --- 119,123 ---- if ($pos >= 0) { ! $ignoredUsers[$pos] = ''; $updateList = true; } *************** *** 128,141 **** if ($updateList) { ! $ignList = ''; ! for (reset($ignoredUsers); $ignName = current($ignoredUsers); next($ignoredUsers)) ! { ! if ($ignName != '') ! $ignList .= ($ignList != '') ! ? ',' . $ignName ! : $ignName; ! } ! $dbSessionVars['ignoredSenders'] = $ignList; ! $doRefreshMessages = true; } unset($ignoredUsers); --- 127,134 ---- if ($updateList) { ! $ignList = join(',', $ignoredUsers); ! $ignList = ereg_replace('^,|,$', '', str_replace(',,', ',', $ignList)); ! $dbSessionVars['ignoredSenders'] = $ignList; ! $doRefreshMessages = true; } unset($ignoredUsers); |