worked around concurrent modification exception

This commit is contained in:
iNPUTmice 2014-12-03 00:54:07 +01:00
parent 4a80914603
commit 46b2760069
1 changed files with 11 additions and 11 deletions

View File

@ -580,23 +580,23 @@ public class ConversationFragment extends Fragment {
break; break;
} }
} }
for (Message message : this.conversation.getMessages()) {
if (message.getEncryption() == Message.ENCRYPTION_PGP
&& (message.getStatus() == Message.STATUS_RECEIVED || message
.getStatus() >= Message.STATUS_SEND)
&& message.getDownloadable() == null) {
if (!mEncryptedMessages.contains(message)) {
mEncryptedMessages.add(message);
}
}
}
decryptNext();
this.messageList.clear(); this.messageList.clear();
if (this.conversation.getMessages().size() == 0) { if (this.conversation.getMessages().size() == 0) {
messagesLoaded = false; messagesLoaded = false;
} else { } else {
this.messageList.addAll(this.conversation.getMessages()); this.messageList.addAll(this.conversation.getMessages());
messagesLoaded = true; messagesLoaded = true;
for (Message message : this.messageList) {
if (message.getEncryption() == Message.ENCRYPTION_PGP
&& (message.getStatus() == Message.STATUS_RECEIVED || message
.getStatus() >= Message.STATUS_SEND)
&& message.getDownloadable() == null) {
if (!mEncryptedMessages.contains(message)) {
mEncryptedMessages.add(message);
}
}
}
decryptNext();
updateStatusMessages(); updateStatusMessages();
} }
this.messageListAdapter.notifyDataSetChanged(); this.messageListAdapter.notifyDataSetChanged();