Be better about identity resolution for stats view

This commit is contained in:
Jack Kingsman
2026-03-19 21:42:39 -07:00
parent b021a4a8ac
commit 33c2b0c948
4 changed files with 170 additions and 7 deletions
+8 -1
View File
@@ -163,10 +163,17 @@ function getSourceInfo(
case PayloadType.TextMessage:
case PayloadType.Request:
case PayloadType.Response: {
const contactKey = packet.decrypted_info?.contact_key?.toUpperCase() ?? null;
if (contactKey) {
return {
sourceKey: contactKey,
sourceLabel: packet.decrypted_info?.sender || toSourceLabel(contactKey),
};
}
const sourceHash = (decoded.payload.decoded as { sourceHash?: string }).sourceHash;
if (!sourceHash) return { sourceKey: null, sourceLabel: null };
return {
sourceKey: sourceHash.toUpperCase(),
sourceKey: `hash1:${sourceHash.toUpperCase()}`,
sourceLabel: sourceHash.toUpperCase(),
};
}