fix: also display contact names stored in name.full #179

This commit is contained in:
Linus Rath
2026-04-11 20:15:49 +02:00
parent 88d87be685
commit 457400ceee
3 changed files with 19 additions and 8 deletions
+4 -2
View File
@@ -203,12 +203,14 @@ export interface ContactCard {
}
export interface ContactName {
components: NameComponent[];
components?: NameComponent[];
isOrdered?: boolean;
full?: string;
defaultSeparator?: string;
}
export interface NameComponent {
kind: 'given' | 'surname' | 'prefix' | 'suffix' | 'additional' | 'separator' | 'credential';
kind: 'given' | 'surname' | 'prefix' | 'suffix' | 'additional' | 'separator' | 'credential' | 'title' | 'middle' | 'given2' | 'surname2' | 'generation';
value: string;
}
+1 -1
View File
@@ -564,7 +564,7 @@ function generateSingleVCard(contact: ContactCard): string {
const suffix = components.find(c => c.kind === "suffix")?.value || "";
const additional = components.find(c => c.kind === "additional")?.value || "";
const fn = [prefix, given, additional, surname, suffix].filter(Boolean).join(" ");
const fn = [prefix, given, additional, surname, suffix].filter(Boolean).join(" ") || contact.name?.full || "";
if (fn) {
lines.push(`FN:${encodeValue(fn)}`);
lines.push(`N:${encodeValue(surname)};${encodeValue(given)};${encodeValue(additional)};${encodeValue(prefix)};${encodeValue(suffix)}`);