MCPcopy Index your code
hub / github.com/ChatLab/ChatLab / buildSessionInfo

Function buildSessionInfo

packages/core/src/query/session-queries.ts:61–80  ·  view source on GitHub ↗
(
  meta: SessionMeta,
  overview: SessionOverview,
  summaryCount: number = 0
)

Source from the content-addressed store, hash-verified

59 * Callers provide the inputs which may come from cache or fresh SQL.
60 */
61export function buildSessionInfo(
62 meta: SessionMeta,
63 overview: SessionOverview,
64 summaryCount: number = 0
65): CoreSessionInfo {
66 return {
67 name: meta.name,
68 platform: meta.platform,
69 type: meta.type,
70 importedAt: meta.importedAt,
71 messageCount: overview.totalMessages,
72 memberCount: overview.totalMembers,
73 groupId: meta.groupId,
74 groupAvatar: meta.groupAvatar,
75 ownerId: meta.ownerId,
76 firstMessageTs: overview.firstMessageTs,
77 lastMessageTs: overview.lastMessageTs,
78 summaryCount,
79 }
80}
81
82/**
83 * Convenience: read meta + overview from DB and return flat CoreSessionInfo.

Callers 5

buildSessionFunction · 0.90
getAllSessionsFunction · 0.90
getSessionFunction · 0.90
getSessionInfoFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected