Skip to content

Conversation

tcheeric
Copy link
Owner

Summary

  • Add TextNoteEventExample to demonstrate creating, signing, and sending a text note with the out-of-the-box class
  • Document the example in CODEBASE_OVERVIEW.md

Testing

  • ./mvnw -q verify (fails: Network is unreachable)

https://chatgpt.com/codex/tasks/task_b_689b89117df083318c9ef4cc074921b4

Copy link
Contributor

@Copilot 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 adds a new example demonstrating text note creation and sending using the TextNoteEvent class, along with corresponding documentation updates.

  • Introduces TextNoteEventExample to showcase creating, signing, and sending text notes with the out-of-the-box TextNoteEvent class
  • Updates CODEBASE_OVERVIEW.md with a new section documenting the TextNoteEvent usage pattern
  • Provides an alternative approach to text note creation compared to existing GenericEvent examples

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
nostr-java-examples/src/main/java/nostr/examples/TextNoteEventExample.java New example class demonstrating TextNoteEvent usage with relay communication
docs/CODEBASE_OVERVIEW.md Added documentation section explaining TextNoteEvent creation pattern with code example

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.


public static void main(String[] args) throws Exception {
Identity identity = Identity.generateRandomIdentity();
TextNoteEvent event = new TextNoteEvent(identity.getPublicKey(), List.<BaseTag>of(),
Copy link
Preview

Copilot AI Aug 12, 2025

Choose a reason for hiding this comment

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

The explicit type parameter List.<BaseTag>of() is unnecessary in modern Java. Use List.of() instead for cleaner code.

Suggested change
TextNoteEvent event = new TextNoteEvent(identity.getPublicKey(), List.<BaseTag>of(),
TextNoteEvent event = new TextNoteEvent(identity.getPublicKey(), List.of(),

Copilot uses AI. Check for mistakes.

public static void main(String[] args) throws Exception {
Identity identity = Identity.generateRandomIdentity();
TextNoteEvent event = new TextNoteEvent(identity.getPublicKey(), List.<BaseTag>of(),
"Hello from TextNoteEvent!\n");
Copy link
Preview

Copilot AI Aug 12, 2025

Choose a reason for hiding this comment

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

[nitpick] The trailing newline character in the message content appears unnecessary and may cause formatting issues. Consider removing it unless specifically required.

Suggested change
"Hello from TextNoteEvent!\n");
"Hello from TextNoteEvent!");

Copilot uses AI. Check for mistakes.

@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@tcheeric tcheeric merged commit c3d5e58 into develop Aug 12, 2025
3 checks passed
@tcheeric tcheeric deleted the codex/add-example-class-for-textnoteevent branch August 12, 2025 19:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants