From a787f58a9075f8fa29703b6c1ab89ba5e1a0addf Mon Sep 17 00:00:00 2001 From: iNPUTmice Date: Mon, 21 Jul 2014 18:20:26 +0200 Subject: [PATCH] fixed #292 --- .../conversations/services/XmppConnectionService.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/eu/siacs/conversations/services/XmppConnectionService.java b/src/eu/siacs/conversations/services/XmppConnectionService.java index ad522fd94..edd01ef39 100644 --- a/src/eu/siacs/conversations/services/XmppConnectionService.java +++ b/src/eu/siacs/conversations/services/XmppConnectionService.java @@ -901,6 +901,16 @@ public class XmppConnectionService extends Service { } public void deleteAccount(Account account) { + for(Conversation conversation : conversations) { + if (conversation.getAccount() == account) { + if (conversation.getMode() == Conversation.MODE_MULTI) { + leaveMuc(conversation); + } else if (conversation.getMode() == Conversation.MODE_SINGLE) { + conversation.endOtrIfNeeded(); + } + conversations.remove(conversation); + } + } if (account.getXmppConnection() != null) { this.disconnect(account, true); }