MCPcopy Create free account
hub / github.com/ChatLab/ChatLab / getLatestContactMessageTs

Function getLatestContactMessageTs

packages/core/src/query/contact-queries.ts:111–122  ·  view source on GitHub ↗
(db: DatabaseAdapter)

Source from the content-addressed store, hash-verified

109}
110
111export function getLatestContactMessageTs(db: DatabaseAdapter): number | null {
112 const row = db
113 .prepare(
114 `SELECT MAX(msg.ts) as ts
115 FROM message msg
116 JOIN member m ON msg.sender_id = m.id
117 WHERE ${nonSystemMessageCondition(db, 'msg', 'm')}`
118 )
119 .get() as { ts: number | null } | undefined
120
121 return row?.ts ?? null
122}
123
124export function getPrivateContactFacts(
125 db: DatabaseAdapter,

Callers 4

computeSessionFactsFunction · 0.90
computeSessionFactsFunction · 0.90

Calls 3

getMethod · 0.65
prepareMethod · 0.65

Tested by

no test coverage detected