Skip to content

Commit 6fe067c

Browse files
committed
chats: assume a single leaf document with messages
1 parent 5889ab1 commit 6fe067c

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

chats/rdflib/src/module/ChatsModuleRdfLib.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export class ChatsModuleRdfLib implements ChatsModule {
6868
const latestDay = await this.fetchLatestSubContainer(latestMonth);
6969
if (!latestDay) return [];
7070

71-
const messagesDocument = await this.fetchLatestDocument(latestDay);
71+
const messagesDocument = await this.fetchMessagesDocument(latestDay);
7272

7373
return new MessagesDocumentQuery(
7474
chatNode,
@@ -82,15 +82,15 @@ export class ChatsModuleRdfLib implements ChatsModule {
8282
return new DateContainerQuery(container, this.store).queryLatest();
8383
}
8484

85-
private async fetchLatestDocument(container: NamedNode) {
85+
private async fetchMessagesDocument(container: NamedNode) {
8686
await this.support.fetchNode(container);
8787

8888
const contents = new ContainerQuery(container, this.store).queryContents();
8989
const files = contents.filter(
9090
(it) =>
9191
!this.store.holds(it, rdf("type"), ldp("Container"), container.doc()),
9292
);
93-
const anyDocument = files[0]; // TODO actually get latest
93+
const anyDocument = files[0]; // this assumes there is one and only one leaf document containing the chat messages (typically chat.ttl)
9494
await this.support.fetchNode(anyDocument);
9595
return anyDocument;
9696
}

0 commit comments

Comments
 (0)