Always show presence name if known

Stephen Paul Weber created

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.

Change summary

src/main/java/eu/siacs/conversations/entities/Contact.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

Detailed changes

src/main/java/eu/siacs/conversations/entities/Contact.java 🔗

@@ -176,8 +176,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 {