This commit is contained in:
2023-09-22 12:17:33 +01:00
parent dadf5159bd
commit 5182b65591
8 changed files with 134 additions and 68 deletions

View File

@ -60,11 +60,16 @@ export class Nip4ChatSystem extends ExternalStore<Array<Chat>> implements ChatSy
{} as Record<string, Array<NostrEvent>>,
);
return [...Object.entries(chats)].map(([k, v]) => Nip4ChatSystem.createChatObj(encodeTLVEntries("chat4" as NostrPrefix, {
type: TLVEntryType.Author,
value: k,
length: 32,
}), v));
return [...Object.entries(chats)].map(([k, v]) =>
Nip4ChatSystem.createChatObj(
encodeTLVEntries("chat4" as NostrPrefix, {
type: TLVEntryType.Author,
value: k,
length: 32,
}),
v,
),
);
}
static createChatObj(id: string, messages: Array<NostrEvent>) {