Better cleanup of Inbox messages. Encapsulate all SQL in Inbox/Message. Fix workflow. Upgrade script to cleanup state table. Fixes bug #11595.

This commit is contained in:
Colin Kuskie 2010-06-07 10:44:12 -07:00
parent 28eabdd997
commit 30e869b66d
6 changed files with 72 additions and 30 deletions

View file

@ -411,8 +411,8 @@ sub delete {
$db->write("DELETE FROM userSession WHERE userId=?",[$userId]);
# remove inbox entries
$db->write("DELETE FROM inbox_messageState WHERE userId=?",[$userId]);
$db->write("DELETE FROM inbox WHERE userId=? AND (groupId IS NULL OR groupId='')",[$userId]);
my $inbox = WebGUI::Inbox->new($session);
$inbox->deleteMessagesForUser($self);
# Shop cleanups
my $sth = $session->db->prepare('select addressBookId from addressBook where userId=?');