Skip to content
Snippets Groups Projects
Commit 024189a2 authored by vjrj's avatar vjrj
Browse files

Humanize contact remove dup and add opt key

parent 0cb4f263
No related branches found
No related tags found
No related merge requests found
......@@ -78,21 +78,14 @@ String humanizeFromToPubKey(String publicAddress, String address) {
}
}
String humanizeContact(String publicAddress, Contact contact) {
final bool hasName = contact.name?.isNotEmpty ?? false;
final bool hasNick = contact.nick?.isNotEmpty ?? false;
String humanizeContact(String publicAddress, Contact contact,
[bool addKey = false]) {
if (contact.pubKey == publicAddress) {
return tr('your_wallet');
} else {
if (hasName && hasNick)
return '${contact.name} (${contact.nick})';
else if (hasNick)
return contact.nick!;
else if (hasName)
return contact.name!;
else
return humanizePubKey(contact.pubKey);
return addKey
? '${contact.title} (${humanizePubKey(contact.pubKey)})'
: contact.title;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment