Skip to content

Commit

Permalink
Add DM receive relay list to NDKKinds (nostr-dev-kit#259)
Browse files Browse the repository at this point in the history
  • Loading branch information
erskingardner authored Sep 11, 2024
1 parent 86ede3c commit 1a7fb27
Show file tree
Hide file tree
Showing 4 changed files with 10,049 additions and 8,490 deletions.
2 changes: 2 additions & 0 deletions ndk/src/events/kinds/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ export enum NDKKind {
InterestList = 10015,
CashuMintList = 10019,
EmojiList = 10030,
DirectMessageReceiveRelayList = 10050,

BlossomList = 10063,

Expand Down Expand Up @@ -159,6 +160,7 @@ export const NDKListKinds = [
NDKKind.SearchRelayList,
NDKKind.InterestList,
NDKKind.EmojiList,
NDKKind.DirectMessageReceiveRelayList,
NDKKind.FollowSet,
NDKKind.BookmarkSet,
NDKKind.CategorizedBookmarkList, // Backwards compatibility
Expand Down
5 changes: 5 additions & 0 deletions ndk/src/events/kinds/lists/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,10 @@ describe("NDKList", () => {
list.kind = 10002;
expect(list.title).toEqual("Relay Metadata");
});

it("defaults to `Direct Message Receive Relay List` for kind 10050 events", () => {
list.kind = 10050;
expect(list.title).toEqual("Direct Message Receive Relays");
});
});
});
2 changes: 2 additions & 0 deletions ndk/src/events/kinds/lists/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ export class NDKList extends NDKEvent {
return "Blocked Relays";
} else if (this.kind === NDKKind.SearchRelayList) {
return "Search Relays";
} else if (this.kind === NDKKind.DirectMessageReceiveRelayList) {
return "Direct Message Receive Relays";
} else if (this.kind === NDKKind.InterestList) {
return "Interests";
} else if (this.kind === NDKKind.EmojiList) {
Expand Down
Loading

0 comments on commit 1a7fb27

Please sign in to comment.