Skip to content

Comments

Fix console chat logging and improve empty message handling#11

Merged
matcldr merged 1 commit intomasterfrom
1.4.3
May 23, 2025
Merged

Fix console chat logging and improve empty message handling#11
matcldr merged 1 commit intomasterfrom
1.4.3

Conversation

@matcldr
Copy link
Contributor

@matcldr matcldr commented May 23, 2025

CHANGES:

  • Add console logging for regular chat messages (issue Chat log doesn't appear on console #10)
  • Prevent display of empty messages when set to ""
  • Update message handling to skip null messages completely

Previously, only private messages were logged to console and empty messages would show as blank lines in the chat. Now all chat messages appear in the console log, and empty messages are completely skipped when configured as empty strings in messages.yml.

Closes #10

CHANGES:
- Add console logging for regular chat messages (issue #10)
- Prevent display of empty messages when set to ""
- Update message handling to skip null messages completely

Previously, only private messages were logged to console and empty
messages would show as blank lines in the chat. Now all chat messages
appear in the console log, and empty messages are completely skipped
when configured as empty strings in messages.yml.

Closes #10
@matcldr matcldr requested a review from Copilot May 23, 2025 22:09
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR improves chat handling by fixing console logging for regular chat messages and preventing the display of empty messages in chat. Key changes include adding a console log for chat messages, introducing a null check for empty system messages, and updating the message toggle command to safely handle potential null responses.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/main/java/com/noximity/remmyChat/services/FormatService.java Added a null check in formatSystemMessage to skip empty messages.
src/main/java/com/noximity/remmyChat/listeners/ChatListener.java Introduced plain text logging for formatted chat messages.
src/main/java/com/noximity/remmyChat/commands/MsgToggleCommand.java Wrapped system message sending with a null check.
README.md Updated documentation to reflect the new version and features.

String message = plugin.getMessages().getMessage(path);

// Skip empty messages completely by returning null
if (message == null || message.trim().isEmpty()) {
Copy link

Copilot AI May 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Returning null here might lead to potential NullPointerExceptions if any caller forgets to perform a null check. Consider returning Component.empty() instead or explicitly documenting that null is a valid response.

Copilot uses AI. Check for mistakes.
@matcldr matcldr merged commit 38d6240 into master May 23, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Chat log doesn't appear on console

1 participant