Skip to content

refactor: make NostrFilterGroup accept filters directly, add fromReq for REQ arrays#207

Merged
hoytech merged 1 commit intohoytech:masterfrom
Thunder-Blaze:refactor/nostrfiltergroup-unwrapped-constructor
Apr 22, 2026
Merged

refactor: make NostrFilterGroup accept filters directly, add fromReq for REQ arrays#207
hoytech merged 1 commit intohoytech:masterfrom
Thunder-Blaze:refactor/nostrfiltergroup-unwrapped-constructor

Conversation

@Thunder-Blaze
Copy link
Copy Markdown
Contributor

Description

The FIXME at line 266 notes that NostrFilterGroup::unwrapped() should be the default constructor. Currently, the main constructor expects a full REQ message array (["REQ", "subId", {filter}, ...]) and callers that just have filter objects must go through the unwrapped() static factory — which internally builds a fake REQ array wrapper to call the same constructor.

This refactoring:

  1. Makes the primary constructor accept filter objects directly (single object or array of objects).
  2. Moves the REQ-array parsing into a new fromReq() static method — used only by RelayIngester when parsing actual client REQ messages.
  3. Removes the unwrapped() static method.

Issue

  • FIXME in src/filters.h file on line number 266

Testing

  • The application builds and runs as expected

Copy link
Copy Markdown
Owner

@hoytech hoytech left a comment

Choose a reason for hiding this comment

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

Thanks!

@hoytech hoytech merged commit 2925355 into hoytech:master Apr 22, 2026
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.

2 participants