caorongjin/liferay-portal — pull request #15 by hhuijser (2011-10-26 12:12:40+00:00)
Title: LPS-22482

Hey Alex,

I see that you just made a commit for LPS-22482, but I think there are some other problems with that if-else statement:

1. entire thread gets deleted when there are multiple pending messages, but no approved ones.
2. thread does NOT get deleted after the (only) draft message gets deleted.
3. message count is incorrect when deleting a pending/inactive/rejected message

Simply delete thread when there is only one message, update when there is more.
Status of the messages is really not important.
Even if you remove the single approved message in a thread with the remaining messages being all drafts, it's OK to leave the thread with the drafts.
It won't show up for anyone but the people who created the drafts.

Anyway, here is my 2 cents...

Hugo