Always show presence name if known

But add jid in parens to avoid spoofing attacks when no presence
subscription.

In such cases usually there will also be a message from stranger warning snackbar.

(cherry picked from commit fa1487016ac1c92a71c39ea58346a2924531e487)
This commit is contained in:
Stephen Paul Weber 2024-01-10 12:47:34 -05:00 committed by 12aw
parent 838362b573
commit 6ec48cbcc5

View file

@ -185,8 +185,8 @@ public class Contact implements ListItem, Blockable {
ListItem bookmark = account.getBookmark(jid);
if (bookmark != null) {
return bookmark.getDisplayName();
} else if (!TextUtils.isEmpty(this.presenceName) && ((QuickConversationsService.isQuicksy() && JidHelper.isQuicksyDomain(jid.getDomain())) || mutualPresenceSubscription())) {
return this.presenceName;
} else if (!TextUtils.isEmpty(this.presenceName)) {
return this.presenceName + (mutualPresenceSubscription() ? "" : " (" + jid + ")");
} else if (jid.getLocal() != null) {
return JidHelper.localPartOrFallback(jid);
} else {