feat(chat): add contact inbox sources with per-user hide filters

This commit is contained in:
Ruslan Bakiev
2026-02-23 10:41:02 +07:00
parent 6bc154a1e6
commit 95fd9a64ce
11 changed files with 538 additions and 29 deletions

View File

@@ -77,7 +77,7 @@ async function validateSessionFromPeer(peer: any) {
}
async function computeTeamSignature(teamId: string) {
const [omniMessageMax, contactMax, contactMessageMax, telegramConnectionMax] = await Promise.all([
const [omniMessageMax, contactMax, contactMessageMax, telegramConnectionMax, contactInboxMax, inboxPrefMax] = await Promise.all([
prisma.omniMessage.aggregate({
where: { teamId },
_max: { updatedAt: true },
@@ -94,6 +94,14 @@ async function computeTeamSignature(teamId: string) {
where: { teamId },
_max: { updatedAt: true },
}),
prisma.contactInbox.aggregate({
where: { teamId },
_max: { updatedAt: true },
}),
prisma.contactInboxPreference.aggregate({
where: { teamId },
_max: { updatedAt: true },
}),
]);
return [
@@ -101,6 +109,8 @@ async function computeTeamSignature(teamId: string) {
contactMax._max.updatedAt?.toISOString() ?? "",
contactMessageMax._max.createdAt?.toISOString() ?? "",
telegramConnectionMax._max.updatedAt?.toISOString() ?? "",
contactInboxMax._max.updatedAt?.toISOString() ?? "",
inboxPrefMax._max.updatedAt?.toISOString() ?? "",
].join("|");
}