From e9659f0fa3694525481f052da55f8dca2a5df79b Mon Sep 17 00:00:00 2001 From: kosyak Date: Sun, 18 Aug 2024 14:03:49 +0200 Subject: [PATCH] fix disappearing bookmarks (issue #12) --- .../conversations/ui/StartConversationActivity.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java b/src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java index 6fca415a9..076956815 100644 --- a/src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java @@ -1150,6 +1150,12 @@ public class StartConversationActivity extends XmppActivity implements XmppConne if (self.match(this, needle)) { this.contacts.add(self); } + + for (Bookmark bookmark : account.getBookmarks()) { + if (bookmark.match(this, needle)) { + tags.addAll(bookmark.getTags(this)); + } + } } } @@ -1764,6 +1770,12 @@ public class StartConversationActivity extends XmppActivity implements XmppConne ListItem item = getItem(i); List itemTags = item.getTags(activity); + if (item instanceof Contact && !((Contact) item).getAccount().getJid().equals(account.getJid())) { + continue; + } else if (item instanceof Bookmark && !((Bookmark) item).getAccount().getJid().equals(account.getJid())) { + continue; + } + if (itemTags.size() == 0 || (itemTags.size() == 1 && UIHelper.isStatusTag(activity, itemTags.get(0)))) { if (!generalTagAdded) { tagsAndAccounts.add(initialPosition, generalTag);