cache bookmark jid in bookmark

This commit is contained in:
Daniel Gultsch 2018-03-11 12:06:07 +01:00
parent e767c5e75b
commit dbcc54799d

View file

@ -15,9 +15,11 @@ public class Bookmark extends Element implements ListItem {
private Account account; private Account account;
private WeakReference<Conversation> conversation; private WeakReference<Conversation> conversation;
private Jid jid;
public Bookmark(final Account account, final Jid jid) { public Bookmark(final Account account, final Jid jid) {
super("conference"); super("conference");
this.jid = jid;
this.setAttribute("jid", jid.toString()); this.setAttribute("jid", jid.toString());
this.account = account; this.account = account;
} }
@ -31,6 +33,7 @@ public class Bookmark extends Element implements ListItem {
Bookmark bookmark = new Bookmark(account); Bookmark bookmark = new Bookmark(account);
bookmark.setAttributes(element.getAttributes()); bookmark.setAttributes(element.getAttributes());
bookmark.setChildren(element.getChildren()); bookmark.setChildren(element.getChildren());
bookmark.jid = bookmark.getAttributeAsJid("jid");
return bookmark; return bookmark;
} }
@ -65,7 +68,7 @@ public class Bookmark extends Element implements ListItem {
@Override @Override
public Jid getJid() { public Jid getJid() {
return this.getAttributeAsJid("jid"); return this.jid;
} }
@Override @Override