From dbcc54799d45e2bd91feb4290ba9f3b904c1a624 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Sun, 11 Mar 2018 12:06:07 +0100 Subject: [PATCH] cache bookmark jid in bookmark --- src/main/java/eu/siacs/conversations/entities/Bookmark.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/eu/siacs/conversations/entities/Bookmark.java b/src/main/java/eu/siacs/conversations/entities/Bookmark.java index e4d441ccc..71466a99d 100644 --- a/src/main/java/eu/siacs/conversations/entities/Bookmark.java +++ b/src/main/java/eu/siacs/conversations/entities/Bookmark.java @@ -15,9 +15,11 @@ public class Bookmark extends Element implements ListItem { private Account account; private WeakReference conversation; + private Jid jid; public Bookmark(final Account account, final Jid jid) { super("conference"); + this.jid = jid; this.setAttribute("jid", jid.toString()); this.account = account; } @@ -31,6 +33,7 @@ public class Bookmark extends Element implements ListItem { Bookmark bookmark = new Bookmark(account); bookmark.setAttributes(element.getAttributes()); bookmark.setChildren(element.getChildren()); + bookmark.jid = bookmark.getAttributeAsJid("jid"); return bookmark; } @@ -65,7 +68,7 @@ public class Bookmark extends Element implements ListItem { @Override public Jid getJid() { - return this.getAttributeAsJid("jid"); + return this.jid; } @Override