unregister bookmark on conversation when bookmark is deleted

This commit is contained in:
iNPUTmice 2014-07-15 20:41:10 +02:00
parent fc5143734e
commit e20842608b
2 changed files with 7 additions and 0 deletions

View File

@ -122,4 +122,10 @@ public class Bookmark implements ListItem {
} }
return element; return element;
} }
public void unregisterConversation() {
if (this.mJoinedConversation != null) {
this.mJoinedConversation.deregisterWithBookmark();
}
}
} }

View File

@ -278,6 +278,7 @@ public class StartConversation extends XmppActivity {
@Override @Override
public void onClick(DialogInterface dialog, int which) { public void onClick(DialogInterface dialog, int which) {
bookmark.unregisterConversation();
Account account = bookmark.getAccount(); Account account = bookmark.getAccount();
account.getBookmarks().remove(bookmark); account.getBookmarks().remove(bookmark);
xmppConnectionService.pushBookmarks(account); xmppConnectionService.pushBookmarks(account);