1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-23 18:02:15 -05:00

the refactoring to combine batch and record logic added an extra check

that broke delete of single messages from message list.
This commit is contained in:
Jesse Vincent 2011-07-23 18:44:18 -04:00
parent 4fe8b23349
commit 7b7601082b

View File

@ -1170,12 +1170,9 @@ public class MessageList
* Never {@code null}. * Never {@code null}.
*/ */
private void onDelete(final List<MessageInfoHolder> holders) { private void onDelete(final List<MessageInfoHolder> holders) {
// FIXME: removeMessage does it own check on the 'selected' field, we're duplicating the logic here...
final List<Message> messagesToRemove = new ArrayList<Message>(); final List<Message> messagesToRemove = new ArrayList<Message>();
for (MessageInfoHolder holder : holders) { for (MessageInfoHolder holder : holders) {
if (holder.selected) { messagesToRemove.add(holder.message);
messagesToRemove.add(holder.message);
}
} }
mHandler.removeMessages(holders); mHandler.removeMessages(holders);
mController.deleteMessages(messagesToRemove.toArray(EMPTY_MESSAGE_ARRAY), null); mController.deleteMessages(messagesToRemove.toArray(EMPTY_MESSAGE_ARRAY), null);