diff --git a/src/main/java/Service/MessageService.java b/src/main/java/Service/MessageService.java index 84d0e29..76e678a 100644 --- a/src/main/java/Service/MessageService.java +++ b/src/main/java/Service/MessageService.java @@ -25,9 +25,8 @@ public MessageService(MessageDAO messageDAO, AccountDAO accountDAO) { this.accountDAO = accountDAO; } - public boolean messageIsValid(int posted_by, String message_text) { + public boolean messageIsValid(String message_text) { if (message_text.length() == 0 || message_text.length() > 255) return false; - else if (accountDAO.findAccountByAccountId(posted_by) == null) return false; else return true; } @@ -43,6 +42,10 @@ public Message getMessageById(int message_id) { return messageDAO.getMessageById(message_id); } + public Message updateMessageById(int message_id, String updated_message_text) { + return messageDAO.updateMessageById(message_id, updated_message_text); + } + public Message deleteMessageById(int message_id) { return messageDAO.deleteMessageById(message_id); }