Show WA nicknames and auto-fill group subjects in access UI (4.9.1-ops.9).

Fetch groupMetadata.subject on @mentions for group cards; render contact pushName under phone rows so admins are not staring at bare numbers.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
oliver 2026-09-05 17:29:43 +08:00
parent e8e58924ca
commit a169b164a8
10 changed files with 268 additions and 182 deletions

View file

@ -194,6 +194,7 @@ export async function gateWhatsappInbound({
message,
sendText,
accountJid,
resolveGroupTitle,
}) {
const { phone, lid } = resolveInboundPhone(message);
const scene = message.kind === 'group' ? 'group' : 'direct';
@ -205,7 +206,15 @@ export async function gateWhatsappInbound({
current = await rememberWhatsappContact(workspaces, botId, current, message, { phone, lid });
}
if (scene === 'group' && addressed && message.conversationId) {
const title = message.contextSource?.()?.conversationTitle;
let title = message.contextSource?.()?.conversationTitle;
const existingTitle = current.groups?.[message.conversationId]?.title;
if (!title && !existingTitle && typeof resolveGroupTitle === 'function') {
try {
title = await resolveGroupTitle(message.conversationId);
} catch {
title = '';
}
}
const withGroup = ensureGroupBucket(current, message.conversationId, {
...(title ? { title } : {}),
});