Skip to content

Commit

Permalink
use authname instead of displayname for vcard filename (#4233)
Browse files Browse the repository at this point in the history
* use authname instead of displayname for vcard filename

closes #4230

* use address if authname is empty

* Add pr number to changelog
  • Loading branch information
Simon-Laux authored Oct 21, 2024
1 parent 9bcca06 commit 1ebcc5a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
- some reactions dialog items not being clickable on secondary accounts (profiles) #4228
- target-electron: make sure log of stdio server is also logged to file
- improve accessibility a little #4133
- use authname instead of displayname for vcard filename #4233


<a id="1_46_8"></a>
Expand Down
10 changes: 5 additions & 5 deletions packages/frontend/src/components/composer/menuAttachment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,12 @@ export default function MenuAttachment({
selectedAccountId(),
[selectedContact.id]
)
const cleanDisplayname = selectedContact.displayName.replace(
/[^a-z_A-Z0-9]/gi,
''
)
// Use original name set by contact instead of nickname chosen by user
const cleanAuthname = (
selectedContact.authName || selectedContact.address
).replace(/[^a-z_A-Z0-9]/gi, '')
const tmp_file = await runtime.writeTempFile(
`VCard-${cleanDisplayname}.vcf`,
`VCard-${cleanAuthname}.vcf`,
vCardContact
)
addFileToDraft(tmp_file, 'Vcard')
Expand Down

0 comments on commit 1ebcc5a

Please sign in to comment.