aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart/messenger/services/XmppConnectionService.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/de/pixart/messenger/services/XmppConnectionService.java')
-rw-r--r--src/main/java/de/pixart/messenger/services/XmppConnectionService.java13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java
index 2a458414c..2fb1e6ae3 100644
--- a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java
+++ b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java
@@ -1553,15 +1553,15 @@ public class XmppConnectionService extends Service {
}
Conversation conversation = find(bookmark);
if (conversation != null) {
- conversation.setBookmark(bookmark);
+ bookmark.setConversation(conversation);
} else if (bookmark.autojoin() && bookmark.getJid() != null && autojoin) {
conversation = findOrCreateConversation(account, bookmark.getJid(), true, true, false);
- conversation.setBookmark(bookmark);
+ bookmark.setConversation(conversation);
}
}
}
}
- account.setBookmarks(new ArrayList<>(bookmarks.values()));
+ account.setBookmarks(new CopyOnWriteArrayList<>(bookmarks.values()));
} else {
Log.d(Config.LOGTAG, account.getJid().toBareJid() + ": could not fetch bookmarks");
}
@@ -2664,7 +2664,10 @@ public class XmppConnectionService extends Service {
if (account.getStatus() == Account.State.ONLINE || now) {
sendPresencePacket(conversation.getAccount(), mPresenceGenerator.leave(conversation.getMucOptions()));
conversation.getMucOptions().setOffline();
- conversation.deregisterWithBookmark();
+ Bookmark bookmark = conversation.getBookmark();
+ if (bookmark != null) {
+ bookmark.setConversation(null);
+ }
Log.d(Config.LOGTAG, conversation.getAccount().getJid().toBareJid() + ": leaving muc " + conversation.getJid());
} else {
account.pendingConferenceLeaves.add(conversation);
@@ -4176,7 +4179,7 @@ public class XmppConnectionService extends Service {
bookmark.setAutojoin(getPreferences().getBoolean("autojoin", getResources().getBoolean(R.bool.autojoin)));
account.getBookmarks().add(bookmark);
pushBookmarks(account);
- conversation.setBookmark(bookmark);
+ bookmark.setConversation(conversation);
}
public boolean verifyFingerprints(Contact contact, List<XmppUri.Fingerprint> fingerprints) {