Skip to content

Commit

Permalink
Feat: Messages work
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrianBalunan committed Apr 21, 2026
1 parent 35f72aa commit 4cd19f3
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public void setMessage(Message message) {

messageFrom.setText(message.getFrom().getName());
messageTitle.setText(message.getTitle());
messageContent.setStyle(message.getContent());
messageContent.setText(message.getContent());
messageDate.setText(message.getTimeAndDate().toString());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ private void handleSendMessage(ActionEvent event) {
MessageDAO messageDAO = new MessageDAO(conn);
Charity charity = authToken.isCharityUser();
Message message = new Message(title, authToken.isCharityUser(), content);
messageDAO.addMessage(message, authToken.getCurrentUser().getId().toString());
messageDAO.addMessage(message);
showAlert(Alert.AlertType.INFORMATION, "Sent!", "Your message has been sent to all donors.");
messageTitleField.clear();
messageContentField.clear();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class MessageDAO {
public MessageDAO(DatabaseConnection connection){
this.connection = connection;
}
public boolean addMessage(Message message, String user_id){
public boolean addMessage(Message message){
// First fetch all unique donors for this charity
List<String> donorIds = getDonorIdsForCharity(message.getFrom().getUUID().toString());

Expand All @@ -37,7 +37,7 @@ public boolean addMessage(Message message, String user_id){
stmt.setString(3, message.getContent());
stmt.setDate(4, Date.valueOf(message.getTimeAndDate()));
stmt.setString(5, message.getFrom().getUUID().toString());
stmt.setString(6, user_id);
stmt.setString(6, donorId);
stmt.addBatch();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
</Label>

<!-- Preview -->
<Label fx:id="messageContent" style="-fx-text-fill: #777777;" text="Something">
<Label fx:id="messageContent" style="-fx-text-fill: #DDDDDD;" text="Something">
<font><Font size="11.0" /></font>
</Label>

Expand Down

0 comments on commit 4cd19f3

Please sign in to comment.