return;
}
final Iterator<Message> imessages = messages.iterator();
while(imessages.hasNext()) {
final Message message = imessages.next();
if(message != null) {
if(!keepDeleted && Boolean.TRUE.equals(message.getDeleted())) {
imessages.remove();
} else if(MessageType.ACTION.getCode().equals(message.getType())) {
// all actions of everyone are always seen
} else if (MessageType.OFF.getCode().equals(message.getType())) {
// player cans see OFF of GM (to him or public) and its own
if(!(characterKey.equals(message.getAuthor())
|| isPublicGMOFF(message)
|| message.getNonNullTo().contains(characterKey))) {
imessages.remove();
}
} else if (MessageType.DICEROLL.getCode().equals(message.getType())) {
// character can see its own dices, that's all.
if(!characterKey.equals(message.getAuthor())) {
imessages.remove();
}
}
} else {
imessages.remove();