remove bookmark after a room is destroyed

This commit is contained in:
Christoph Scholz 2018-12-27 14:27:37 +01:00
parent 835c89328d
commit 77b42ba9ca

View file

@ -1853,11 +1853,18 @@ public class XmppConnectionService extends Service {
if (conversation.getMode() == Conversation.MODE_MULTI) { if (conversation.getMode() == Conversation.MODE_MULTI) {
if (conversation.getAccount().getStatus() == Account.State.ONLINE) { if (conversation.getAccount().getStatus() == Account.State.ONLINE) {
Bookmark bookmark = conversation.getBookmark(); Bookmark bookmark = conversation.getBookmark();
if (maySyncronizeWithBookmarks && bookmark != null && bookmark.autojoin() && synchronizeWithBookmarks()) { if (maySyncronizeWithBookmarks && bookmark != null && synchronizeWithBookmarks()) {
if (conversation.getMucOptions().getError() == MucOptions.Error.DESTROYED) {
Account account = bookmark.getAccount();
bookmark.setConversation(null);
account.getBookmarks().remove(bookmark);
pushBookmarks(account);
} else if (bookmark.autojoin()) {
bookmark.setAutojoin(false); bookmark.setAutojoin(false);
pushBookmarks(bookmark.getAccount()); pushBookmarks(bookmark.getAccount());
} }
} }
}
leaveMuc(conversation); leaveMuc(conversation);
} else { } else {
if (conversation.getContact().getOption(Contact.Options.PENDING_SUBSCRIPTION_REQUEST)) { if (conversation.getContact().getOption(Contact.Options.PENDING_SUBSCRIPTION_REQUEST)) {