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

Function ensureReplyStats

packages/core/src/query/contact-queries.ts:261–267  ·  view source on GitHub ↗
(contactId: number)

Source from the content-addressed store, hash-verified

259 .all(...replyTimeFilter.params) as Array<{ replySenderId: number; replyTs: number; targetSenderId: number }>
260
261 const ensureReplyStats = (contactId: number) => {
262 const existing = replyStats.get(contactId)
263 if (existing) return existing
264 const created = { repliesFromOwnerToContact: 0, repliesFromContactToOwner: 0, lastInteractionTs: null }
265 replyStats.set(contactId, created)
266 return created
267 }
268
269 for (const row of replyRows) {
270 if (row.replySenderId === ownerMemberId && contactById.has(row.targetSenderId)) {

Callers 1

getGroupContactFactsFunction · 0.85

Calls 2

setMethod · 0.80
getMethod · 0.65

Tested by

no test coverage detected