fix telegram contact identity context for in/out messages
This commit is contained in:
@@ -212,19 +212,12 @@ function buildContactProfile(
|
||||
normalized: OmniInboundEnvelopeV1["payloadNormalized"],
|
||||
externalContactId: string,
|
||||
): ContactProfile {
|
||||
const firstName =
|
||||
asString(normalized.contactFirstName) ??
|
||||
asString(normalized.fromFirstName) ??
|
||||
asString(normalized.chatFirstName);
|
||||
const lastName =
|
||||
asString(normalized.contactLastName) ??
|
||||
asString(normalized.fromLastName) ??
|
||||
asString(normalized.chatLastName);
|
||||
const username =
|
||||
asString(normalized.contactUsername) ??
|
||||
asString(normalized.fromUsername) ??
|
||||
asString(normalized.chatUsername);
|
||||
const title = asString(normalized.contactTitle) ?? asString(normalized.chatTitle);
|
||||
// Use only normalized contact-* fields (counterparty), avoid sender/chat fallbacks
|
||||
// to prevent accidental renames to the business owner name on OUT events.
|
||||
const firstName = asString(normalized.contactFirstName);
|
||||
const lastName = asString(normalized.contactLastName);
|
||||
const username = asString(normalized.contactUsername);
|
||||
const title = asString(normalized.contactTitle);
|
||||
|
||||
const fullName = [firstName, lastName].filter(Boolean).join(" ");
|
||||
const displayName =
|
||||
|
||||
Reference in New Issue
Block a user