From ce3d93f5950e134414576e03f12ba06f46be14c8 Mon Sep 17 00:00:00 2001 From: Hamish Peebles Date: Fri, 25 Oct 2024 16:20:17 +0100 Subject: [PATCH] Fetch user details for users in your message activity feed (#6686) --- frontend/openchat-client/src/openchat.ts | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/frontend/openchat-client/src/openchat.ts b/frontend/openchat-client/src/openchat.ts index d57ebc438e..5e2928d5c2 100644 --- a/frontend/openchat-client/src/openchat.ts +++ b/frontend/openchat-client/src/openchat.ts @@ -1450,11 +1450,22 @@ export class OpenChat extends OpenChatAgentWorker { }); } - messageActivityFeed(): Promise { - return this.sendRequest({ + async messageActivityFeed(): Promise { + const feed = await this.sendRequest({ kind: "messageActivityFeed", since: this._liveState.globalState.messageActivitySummary.readUpToTimestamp, }); + + const userIds = new Set(); + for (const event of feed.events) { + if (event.userId !== undefined) { + userIds.add(event.userId); + } + } + + await this.getMissingUsers(userIds); + + return feed; } async approveAccessGatePayment(