From 5c173f245dabf931621d4915cf4aadc4f7dd81d1 Mon Sep 17 00:00:00 2001 From: Yana Stamcheva Date: Wed, 24 Oct 2012 11:00:40 +0000 Subject: [PATCH] Fixes hang up behavior when the call is already ended. Fixes closing of call info window when the other party hangs up the call. --- .../impl/gui/main/call/CallDialog.java | 8 +++++--- .../impl/gui/main/call/CallManager.java | 2 ++ .../impl/gui/main/call/CallPanel.java | 15 +++++++++++++-- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/src/net/java/sip/communicator/impl/gui/main/call/CallDialog.java b/src/net/java/sip/communicator/impl/gui/main/call/CallDialog.java index 8cd4b405c..4bb68e7eb 100644 --- a/src/net/java/sip/communicator/impl/gui/main/call/CallDialog.java +++ b/src/net/java/sip/communicator/impl/gui/main/call/CallDialog.java @@ -106,7 +106,7 @@ protected void close(boolean escape) * * The delay implemented by CallDialog is 5 seconds. */ - public void close(CallPanel callPanel, boolean delay) + public void close(final CallPanel callPanel, boolean delay) { if (this.callPanel.equals(callPanel)) { @@ -128,7 +128,6 @@ public void actionPerformed(ActionEvent ev) } else { - this.callPanel.disposeCallInfoFrame(); dispose(); } } @@ -151,7 +150,10 @@ public void dispose() * such a case at this time so try to reduce the risk of memory leaks. */ if (this.callPanel != null) - this.callPanel.dispose(); + { + callPanel.disposeCallInfoFrame(); + callPanel.dispose(); + } } /** diff --git a/src/net/java/sip/communicator/impl/gui/main/call/CallManager.java b/src/net/java/sip/communicator/impl/gui/main/call/CallManager.java index 9c36631bc..63371ffa9 100644 --- a/src/net/java/sip/communicator/impl/gui/main/call/CallManager.java +++ b/src/net/java/sip/communicator/impl/gui/main/call/CallManager.java @@ -2351,8 +2351,10 @@ public void run() while (peerIter.hasNext()) peers.add(peerIter.next()); } + if (conference != null) peers.addAll(conference.getCallPeers()); + if (peer != null) peers.add(peer); diff --git a/src/net/java/sip/communicator/impl/gui/main/call/CallPanel.java b/src/net/java/sip/communicator/impl/gui/main/call/CallPanel.java index fd167c723..855a2e68d 100644 --- a/src/net/java/sip/communicator/impl/gui/main/call/CallPanel.java +++ b/src/net/java/sip/communicator/impl/gui/main/call/CallPanel.java @@ -458,10 +458,21 @@ public void actionPerformedOnHangupButton(boolean closeWait) this.disposeCallInfoFrame(); /* - * XXX It is the responsibility of CallManager to close this CallPanel + * It is the responsibility of CallManager to close this CallPanel * when a Call is ended. */ - CallManager.hangupCalls(callConference); + if (callConference.getCallCount() > 0) + CallManager.hangupCalls(callConference); + /* + * If however there are no more calls related to this panel we will + * close the window directly. This could happen in the case, where + * the other side has already hanged up the call, the call window shows + * the state disconnected and we press the hang up button. In this + * case the contained call is already null and we should only close the + * call window. + */ + else + callWindow.close(this, false); } /**