mirror of
https://github.com/mjl-/mox.git
synced 2025-07-10 09:14:39 +03:00
webmail: show email address instead of display name of "from" header in message listing if display name contains chars from "<@>"
it could be an attempt to confuse the reader with an email address. a classic.
This commit is contained in:
@ -316,10 +316,11 @@ const formatAddressFull = (a: api.MessageAddress): string => {
|
||||
return s
|
||||
}
|
||||
|
||||
// format just the name, or otherwies just the email address.
|
||||
// format just the name if present and it doesn't look like an address, or otherwise just the email address.
|
||||
const formatAddressShort = (a: api.MessageAddress): string => {
|
||||
if (a.Name) {
|
||||
return a.Name
|
||||
const n = a.Name
|
||||
if (n && !n.includes('<') && !n.includes('@') && !n.includes('>')) {
|
||||
return n
|
||||
}
|
||||
return '<' + a.User + '@' + a.Domain.ASCII + '>'
|
||||
}
|
||||
|
Reference in New Issue
Block a user