From: Lo?c C. <lo...@us...> - 2001-05-25 22:49:26
|
Update of /cvsroot/phpmychat/phpMyChat-0.15/chat/lib/commands In directory usw-pr-cvs1:/tmp/cvs-serv1653/chat/lib/commands Modified Files: join.cmd.php3 invite.cmd.php3 Log Message: Invited success message is locally displayed rather than stored in the db Index: join.cmd.php3 =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/lib/commands/join.cmd.php3,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** join.cmd.php3 2001/05/24 20:22:35 1.6 --- join.cmd.php3 2001/05/25 22:49:22 1.7 *************** *** 234,242 **** // Delete invitations sent to the current user for the room he is going to // enter in ! $dbLink->query("SELECT m_time FROM " . C_MSG_TBL . " WHERE username = 'SYS inviteTo' AND address = '$slashedNick' AND room = '$slashedTargetRoomName'"); ! while (list($sentTime) = $dbLink->nextRecord()) ! { ! $dbLink->query("DELETE FROM " . C_MSG_TBL . " WHERE m_time = $sentTime AND (username = 'SYS inviteFrom' OR (username = 'SYS inviteTo' AND address = '$slashedNick'))"); ! } // Update session data and enforce a complete refresh of the --- 234,238 ---- // Delete invitations sent to the current user for the room he is going to // enter in ! $dbLink->query("DELETE FROM " . C_MSG_TBL . " WHERE username = 'SYS inviteTo' AND address = '$slashedNick' AND room = '$slashedTargetRoomName'"); // Update session data and enforce a complete refresh of the Index: invite.cmd.php3 =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/lib/commands/invite.cmd.php3,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** invite.cmd.php3 2001/04/21 19:37:39 1.7 --- invite.cmd.php3 2001/05/25 22:49:22 1.8 *************** *** 45,49 **** $roomForNotifications = pmcSlashSingleQuotes(pmcSpecialChars($slashedCurrentRoomName, 0), 2); $roomForJs = pmcSlashSingleQuotes($roomForNotifications, 4); - $invitedsForNotifications = pmcSlashSingleQuotes(pmcSpecialChars($cmd[2], 0), 3); // Prepares the messages --- 45,48 ---- *************** *** 69,87 **** . ')'; - $theMessage = 'sprintf(L_INVITE_DONE, \\\'' . $invitedsForNotifications . '\\\')'; - - $inviterQuery = 'INSERT INTO ' . C_MSG_TBL . ' ' - . 'VALUES (' - . $currentRoomType . ', ' - . '\'' . $slashedCurrentRoomName . '\', ' - . '\'SYS inviteFrom\', ' - . $latin1 . ', ' - . $currentTime . ', ' - . '\'' . $slashedNick . '\', ' - . '\'#666699\', ' - . '\'' . $theMessage . '\', ' - . '\'' . $theMessage . '\'' - . ')'; - // Get all addressee and insert a message for each one of them $invitedUsers = explode(',', $cmd[2]); --- 68,71 ---- *************** *** 99,104 **** unset($invitedUsers); ! // Insert a message for the sender ! $dbLink->query($inviterQuery); $isCommand = true; --- 83,89 ---- unset($invitedUsers); ! // Define the success message for the sender ! // $error = sprintf(L_INVITE_DONE, str_replace(',', ', ', pmcSpecialChars($cmd[2], 0))); ! $error = sprintf(L_INVITE_DONE, str_replace(',', ', ', $cmd[2])); $isCommand = true; |