api!: remove Contact.get_name_n_addr() and related APIs

UIs should use display name everywhere and avoid displaying email addresses.

BREAKING CHANGE: dc_contact_get_name_n_addr() CFFI is removed
BREAKING CHANGE: JSON-RPC contact objects don't have nameAndAddr field anymore
This commit is contained in:
link2xt
2026-09-18 17:35:50 +00:00
committed by l
parent 7876115d86
commit e1d58706ce
7 changed files with 8 additions and 69 deletions

View File

@@ -104,7 +104,7 @@ pub fn sanitize_name_and_addr(name: &str, addr: &str) -> (String, String) {
let mut name = sanitize_name(name);
// If the 'display name' is just the address, remove it:
// Otherwise, the contact would sometimes be shown as "alice@example.com (alice@example.com)" (see `get_name_n_addr()`).
// Otherwise, the contact would sometimes be shown as "alice@example.com (alice@example.com)".
// If the display name is empty, DC will just show the address when it needs a display name.
if name == addr {
name = "".to_string();