try {
try {
for (WeakReference<MultiUserChat> entry : groupChatCache.values()) {
MultiUserChat chat = entry.get();
if (chat != null && chat.isJoined()) {
chat.leave();
}
}
// there seems to be no way to leave a 1-on-1 chat with Smack
this.groupChatCache.clear();