this.messageId = messageId;
}
@Override
protected UserMessageEx doExecute(PartakeConnection con, IPartakeDAOs daos) throws DAOException, PartakeException {
UserMessageEx message = MessageDAOFacade.findUserReceivedMessage(con, daos, messageId);
if (message == null)
throw new PartakeException(UserErrorCode.INVALID_NOTFOUND);
if (!user.getId().equals(message.getReceiverId()))
throw new PartakeException(UserErrorCode.FORBIDDEN_MESSAGE_SHOW);
if (!message.isOpened()) {
UserReceivedMessage newMessage = new UserReceivedMessage(message);
newMessage.setOpened(true);
newMessage.setModifiedAt(TimeUtil.getCurrentDateTime());
daos.getUserReceivedMessageAccess().put(con, newMessage);
}