Use bookmark name for a contact when there is no roster item but is a bookmark

Stephen Paul Weber created

Especially useful since shortcut code assumes contact right now.

Change summary

src/main/java/eu/siacs/conversations/entities/Contact.java | 5 +++++
1 file changed, 5 insertions(+)

Detailed changes

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

@@ -170,6 +170,11 @@ public class Contact implements ListItem, Blockable {
             return this.systemName;
         } else if (!TextUtils.isEmpty(this.serverName)) {
             return this.serverName;
+        }
+
+        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 (jid.getLocal() != null) {